Thread: Compile Errors Due to STL & Iterator

  1. #1
    Registered User
    Join Date
    Nov 2001
    Posts
    1,348

    Compile Errors Due to STL & Iterator

    Hi.

    I posted two threads earlier about STL and cin, cout, ifstream and ofstream. I implemented code based on inputs from other members.

    Here is the code:


    void ScanList::scanData(ifstream &source, ofstream &output)
    {
    string oneLine;
    std::deque dataList;

    while(veri)
    {
    std::getline(source, oneLine);

    if (oneLine[0] == NULL || !isdigit(oneLine[0]))
    {

    if (source.eof())
    {
    veri = false;
    continue;
    }

    else
    continue;

    }

    else
    dataList.push_back(oneLine);


    if (source.eof())
    veri = false;
    }

    std::unique(dataList.begin(), dataList.end());

    /*
    std::deque::iterator beginITER = dataList.begin();

    while (beginITER != dataList.end())
    {
    output << *beginITER;
    beginITER++;
    }
    */

    std:stream_iterator outFile(output, "\n");
    std::copy(dataList.begin(), dataList.end(), outFile);
    dataList.clear();
    }


    VC++ gave these four warnings:


    Compiling...mScanList.cppD:\C++\mScanList.cpp(81) : warning C4786: 'std::reverse_iterator,std::allocator >,std::allocator,std::allocator > > >::const_iterator,std::basic_string,std::allocat or >,std::basic_string,std::allocator > const &,std::basic_string,std::allocator > const *,int>' : identifier was truncated to '255' characters in the debug informationD:\C++\mScanList.cpp(81) : warning C4786: 'std::reverse_iterator,std::allocator >,std::allocator,std::allocator > > >::iterator,std::basic_string,std::allocator >,std::basic_string,std::allocator > &,std::basic_string,std::allocator > *,int>' : identifier was truncated to '255' characters in the debug informationc:\program files\microsoft visual studio\vc98\include\deque(191) : warning C4786: 'std::deque,std::allocator >,std::allocator,std::allocator > > >::deque,std::allocator >,std::allocator,std::allocator > > >' : identifier was truncated to '255' characters in the debug informationc:\program files\microsoft visual studio\vc98\include\deque(208) : warning C4786: 'std::deque,std::allocator >,std::allocator,std::allocator > > >::~deque,std::allocator >,std::allocator,std::allocator > > >' : identifier was truncated to '255' characters in the debug informationmScanList.obj - 0 error(s), 4 warning(s)


    VC++ outputs those warnings no even when I used the second technique which the compile ignored because of /* and */.

    Does anyone know what it is talking about and how to elimate the warnings?

    Thanks,
    Kuphryn

  2. #2
    Skunkmeister Stoned_Coder's Avatar
    Join Date
    Aug 2001
    Posts
    2,572
    std::deque dataList;

    what TYPE of deque are you trying to use ?

    maybe std::deque<int> datalist; ?
    Free the weed!! Class B to class C is not good enough!!
    And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi

  3. #3
    Registered User
    Join Date
    Nov 2001
    Posts
    1,348
    Thanks.

    I saw a couple of responses at Gamedev that it is just a compile warning having to doing with 255 characters. The following code would turn it off:

    #pragma warning( disable : 4786 )

    Kuphryn

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Quake 2 Compile Errors
    By Mercury in forum Game Programming
    Replies: 9
    Last Post: 01-26-2002, 09:40 PM
  2. Two compile errors i need help with.
    By Unregistered in forum C Programming
    Replies: 10
    Last Post: 01-06-2002, 09:52 AM
  3. Compile Errors ...
    By ginoitalo in forum C++ Programming
    Replies: 1
    Last Post: 12-31-2001, 02:22 AM
  4. compile errors
    By spider in forum C++ Programming
    Replies: 4
    Last Post: 12-11-2001, 08:43 AM
  5. Replies: 5
    Last Post: 11-13-2001, 04:38 PM