visual studio 2006 problem

This is a discussion on visual studio 2006 problem within the C++ Programming forums, part of the General Programming Boards category; hi all, can we use different functionalities of vectors like "rbegin","rend",end,erase,in visual studio 6 editon? I am facing problems in ...

  1. #1
    Registered User
    Join Date
    Dec 2007
    Posts
    78

    visual studio 2006 problem

    hi all,
    can we use different functionalities of vectors like "rbegin","rend",end,erase,in visual studio 6 editon?
    I am facing problems in this, while transfering my project from visual studio 2005 express edition to visual studio 2006...

    If yes can anyone suggest the method or setting required?

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    21,936
    can we use different functionalities of vectors like "rbegin","rend",end,erase,in visual studio 6 editon?
    Generally, yes. However, why use such a pre-standard compiler?
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  3. #3
    Registered User
    Join Date
    Dec 2007
    Posts
    78
    my customer is having visual studio 6.
    Can you please suggest any changes i need to do?

  4. #4
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    21,936
    You will need to post the smallest and simplest program that demonstrates the problem. Things like slightly difference scope in for loops could come into play.
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  5. #5
    Registered User
    Join Date
    Dec 2007
    Posts
    78
    I am having problems in vectors only, especially in functionalities of vectors like "rbegin","rend",end,erase. I am unable to access them..
    Is this requires some cahnge in settins?

  6. #6
    Registered User
    Join Date
    Jan 2005
    Posts
    7,340
    Please note that it is Visual Studio 6.0, not Visual Studio 2006. Visual Studio 6.0 is from 1998 or around there. At ten years old it might time for your customer to upgrade to a newer and more standards compliant compiler.

    The code for vectors is generally the same in version 6.0 as it is in 2005, so you'll have to post code and errors if you are having problems. There should be nothing special that you need to do with regards to vectors, rbegin, rend, end and erase.

  7. #7
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    21,936
    I am having problems in vectors only, especially in functionalities of vectors like "rbegin","rend",end,erase. I am unable to access them..
    Honestly, that is very vague. Test with:
    Code:
    #include <iostream>
    #include <vector>
    
    int main()
    {
        std::vector<int> vec;
        vec.push_back(1);
        vec.push_back(2);
        vec.push_back(3);
        std::vector<int>::reverse_iterator i;
        for (i = vec.rbegin(); i != vec.rend(); ++i)
        {
            std::cout << *i << ' ';
        }
        std::cout << std::endl;
    }
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  8. #8
    Registered User
    Join Date
    Dec 2007
    Posts
    78
    I am having vector declaration as shown below.

    Code:
    vector<point> tmppts1(RevActSection.Points.rbegin(),RevActSection.Points.rend());
    But i am getting this error while compiling:


    D:\Backup_QI-287\GEConfidential\rajesh\Hitachi_runner_blade\cod e_runner_blade\RunnerBlade\defGeometry.cpp(97) : error C2664: '__thiscall std::vector<struct point,class std::allocator<struct point> >::std::vector<struct point,class std::allocator<str
    uct point> >(unsigned int,const struct point &,const class std::allocator<struct point> &)' : cannot convert parameter 1 from 'class std::reverse_iterator<struct point *,struct point,struct point &,struct point *,int>' to 'unsigned int'
    No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called

  9. #9
    Registered User
    Join Date
    Jan 2005
    Posts
    7,340
    How is RevActSection.Points declared?

  10. #10
    Registered User
    Join Date
    Dec 2007
    Posts
    78
    RevActSection declaration:

    Code:
    Section RevActSection = ActionSide.Sections[i];
    Section RevReActSection = ReactionSide.Sections[i];

    RevActSection is object of strcture "Section"

    Section declaration:

    Code:
    struct Section{
    	char Name[256];
    	int NumberOfPoints;
    	std::vector <struct point> Points;
                        }
    
    struct point{
    	double pt[3];
                      };

  11. #11
    Registered User
    Join Date
    Jan 2005
    Posts
    7,340
    I'm not sure. Can you place that code into a small program and see if it compiles. You could probably do it with just the code you've posted.

    I'm wondering if changing the name of the point struct to something else would help.

  12. #12
    Registered User
    Join Date
    Dec 2007
    Posts
    78
    I think there is some problem in settings of Visual Studio 6 or some support files may not be in place...................
    Can this be a case?

  13. #13
    Registered User
    Join Date
    Jan 2005
    Posts
    7,340
    It's possible, but I think another explanation is probably more likely. Have you moved that code to its own project? It shouldn't be that hard.

  14. #14
    Registered User
    Join Date
    Dec 2007
    Posts
    78
    ya i have done that, but i am still having that problem..

    Thing is this code is already completed succesfully in visual studio express edition 2005 & while transfering it to visual studio 6 i am having this problems..

  15. #15
    CSharpener vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,484
    Do you have Platform SDK properly installed and configured to work with VS6? It could resolve a lot of problems with the outdated compiler of VS6
    The first 90% of a project takes 90% of the time,
    the last 10% takes the other 90% of the time.

Page 1 of 3 123 LastLast
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Another syntax error
    By caldeira in forum C Programming
    Replies: 31
    Last Post: 09-05-2008, 01:01 AM
  2. Console Font Size
    By bradszy in forum Windows Programming
    Replies: 34
    Last Post: 04-26-2008, 07:09 AM
  3. ras.h errors
    By Trent_Easton in forum Windows Programming
    Replies: 8
    Last Post: 07-15-2005, 10:52 PM
  4. Learning OpenGL
    By HQSneaker in forum C++ Programming
    Replies: 7
    Last Post: 08-06-2004, 08:57 AM
  5. Linking error
    By DockyD in forum C++ Programming
    Replies: 10
    Last Post: 01-20-2003, 04:27 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21