![]() |
| | #1 |
| Registered User Join Date: Dec 2003
Posts: 20
| undefined reference to `std::basic_string under Cygwin Code: $ gcc FileClass2.cpp In file included from FileClass2.cpp:3: require.h:58:26: warning: no newline at end of file /cygdrive/c/DOKUME~1/KHAJA~1.MOH/LOKALE~1/Temp/ccI3GSd5.o:FileClass2.cpp:(.text+ 0xd): undefined reference to `std::basic_string<char, std::char_traits<char>, st d::allocator<char> >::size() const' /cygdrive/c/DOKUME~1/KHAJA~1.MOH/LOKALE~1/Temp/ccI3GSd5.o:FileClass2.cpp:(.text+ 0x60): undefined reference to `std::basic_string<char, std::char_traits<char>, s td::allocator<char> >::operator[](unsigned int) const' /cygdrive/c/DOKUME~1/KHAJA~1.MOH/LOKALE~1/Temp/ccI3GSd5.o:FileClass2.cpp:(.text+ 0x9f): undefined reference to `std::basic_string<char, std::char_traits<char>, s td::allocator<char> >::operator[](unsigned int) const' /cygdrive/c/DOKUME~1/KHAJA~1.MOH/LOKALE~1/Temp/ccI3GSd5.o:FileClass2.cpp:(.text+ 0xce): undefined reference to `std::basic_string<char, std::char_traits<char>, s td::allocator<char> >::operator[](unsigned int) const' /cygdrive/c/DOKUME~1/KHAJA~1.MOH/LOKALE~1/Temp/ccI3GSd5.o:FileClass2.cpp:(.text+ 0x205): undefined reference to `___gxx_personality_sj0' collect2: ld returned 1 exit status Last edited by Salem; 09-04-2006 at 05:32 AM. Reason: code tagged - please learn to use them! |
| kpmkhaja is offline | |
| | #2 |
| C++ Witch Join Date: Oct 2003 Location: Singapore
Posts: 12,460
| You have a C++ program, not a C program.
__________________ C + C++ Compiler: MinGW port of GCC Build + Version Control System: SCons + Bazaar Look up a C/C++ Reference and learn How To Ask Questions The Smart Way |
| laserlight is online now | |
| | #3 |
| Registered User Join Date: Dec 2003
Posts: 20
| undefined reference to `std::basic_string oh sorry a CPP program is there any solution for this i know something to do with linker but not able to sort it out |
| kpmkhaja is offline | |
| | #4 |
| +++ OK NO CARRIER Join Date: Oct 2001
Posts: 11,292
| Stop compiling as C, and move to the C++ board. You can't compile C++ on a C compiler. Quzah.
__________________ Hundreds of thousands of dipshits can't be wrong. Are you up for the suck? |
| quzah is offline | |
| | #5 |
| and the hat of Destiny Join Date: Aug 2001 Location: The edge of the known universe
Posts: 22,495
| Moved to C++ board. |
| Salem is offline | |
| | #6 |
| Registered User Join Date: Mar 2009
Posts: 2
| Ashish Patel just compile with g++ compiler g++ -c <cpp-file> g++ -o <bin-file> <obj-file> |
| zoom2ashish is offline | |
![]() |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Getting an error with OpenGL: collect2: ld returned 1 exit status | Lorgon Jortle | C++ Programming | 6 | 05-08-2009 08:18 PM |
| Undefined Reference Compiling Error | AlakaAlaki | C++ Programming | 1 | 06-27-2008 11:45 AM |
| Screwy Linker Error - VC2005 | Tonto | C++ Programming | 5 | 06-19-2007 02:39 PM |
| C OpenGL Compiler Error? | Matt3000 | C Programming | 12 | 07-07-2006 04:42 PM |
| c++ linking problem for x11 | kron | Linux Programming | 1 | 11-19-2004 10:18 AM |