Linker Error Undefined Reference To Std String Size Const
Contents |
here for a quick undefined reference to `std::__cxx11 overview of the site Help Center Detailed answers undefined reference to std string operator to any questions you might have Meta Discuss the workings and policies of undefined reference to `std::allocator
C++ Undefined Reference To
up C++ errors while compiling up vote 13 down vote favorite Trying to compile a game, but getting 100+ errors like: C:\Users\AppData\Local\Temp\cctQCagR.o: In function `load_image(std::string)': main.cpp:(.text+0x4bd4): undefined reference to `std::string::c_str() const' C:\Users\Bill\AppData\Local\Temp\cctQCagR.o: In function `createShip(float, float)': main.cpp:(.text+0x4da4): undefined reference to `std::allocator
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss
Undefined Reference To Winmain
the workings and policies of this site About Us Learn more about undefined reference to function c++ Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions gcc Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. http://stackoverflow.com/questions/3081815/c-errors-while-compiling Join them; it only takes a minute: Sign up C++ linking problems, seems like I cant link against standard C++ stuff up vote 17 down vote favorite 1 I am trying to use a library I've compiled myself in an iOS app. The library is the Tesseract OCR lib. It seems like compiling that (and its dependencies) have http://stackoverflow.com/questions/12849517/c-linking-problems-seems-like-i-cant-link-against-standard-c-stuff gone ok. However, when I try to link against this lib in my app project, the app fails to link. The link errors surprise me; it seems like there are problems with the Tesseract stuff finding pretty standard C++ stuff. Any suggestions about what I might be doing wrong would be most helpful. Here is a snippet of the kind of link errors I'm seeing. Undefined symbols for architecture armv7: "std::string::find_last_of(char const*, unsigned long) const", referenced from: tesseract::WordSizeModel::Init(std::string const&, std::string const&) in libtesseract.a(word_size_model.o) "std::string::find_first_of(std::string const&, unsigned long) const", referenced from: tesseract::CubeUtils::SplitStringUsing(std::string const&, std::string const&, std::vector
files, but I didn't figure out how I can make the main program work. The errors http://www.cplusplus.com/forum/beginner/25188/ that appear (when I try to compile the source files) are: 1. median.cpp 1
2
[Linker error] undefined reference to `WinMain@16' ld returned 1 exit status 2. grade.cpp 1
2
3
[Linker error] undefined reference to `median(std::vector<double, std::allocator<double> >)' [Linker error] undefined reference to `WinMain@16' ld returned 1 exit status 3. student_info.cpp 1
2
[Linker error] undefined reference undefined reference to `WinMain@16' ld returned 1 exit status 4. 4_data_headers_partitioning.cpp (the main program) 1
2
3
4
[Linker error] undefined reference to `read(std::istream&, Student_info&)' [Linker error] undefined reference to `compare(Student_info const&, Student_info const&)' [Linker error] undefined reference to `grade(Student_info const&)' ld returned 1 exit status I attached the source files here: http://www.2shared.com/file/US8dNvZz/partitioning.html Can you help me a undefined reference to little? What I do wrong? Or what I omit? Thanks in advance for your help. (I'm using dev c++ 4.9.9.2 under windows) Jun 19, 2010 at 1:14pm UTC magnificence7 (188) I can't find where to download your files, maybe posting it helps? Anyway, are you sure you've compiled all your source files before linking? Jun 20, 2010 at 1:55am UTC Zhuge (4639) It seems like you are trying to compile all the cpp files as separate programs (hence, looking for WinMain in the other cpps). I don't know how dev c++ works, but there is probably a way to specify a "project" or something that indicates that your files are together a single program. Jun 20, 2010 at 1:56pm UTC Duoas (10453) Yes, start Dev-C++ and create a new Project. Add your main program's cpp file, then add the other cpp files you intend to use in your project. Make sure you create a "Console Application" project -- not a Windows (GUI) application projec