Linker error in VS 2005 but not 2008?

Started by
6 comments, last by ChrisPepper1989 14 years, 4 months ago
Hello everyone, ive got a weird thing happening at the moment, im trying to move a project back to VS 2005 as i now have professional 2005 with visual assist and some other add ons and ive come across a problem when i do a full rebuild in 2008 (express) i get no problems and my demos work fine, but after using good old Project convertor and opening up the same solution in 2005 and running i get this error: Error 16 error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall std::_Container_base_secure::_Orphan_all(void)const " (__imp_?_Orphan_all@_Container_base_secure@std@@QBEXXZ) referenced in function "public: void __thiscall std::deque<unsigned char *,class std::allocator<unsigned char *> >::push_back(unsigned char * const &)" (?push_back@?$deque@PAEV?$allocator@PAE@std@@@std@@QAEXABQAE@Z) boy.lib I've gotten better at decoding linker errors but this one has me completely stumped the boy.lib project doesnt even have a deque, im really very confused, ive tried building each project seperatley in the correct order and this doesnt seem to solve it. If i re-build the entire project in 2008 and then go down to 2005 and run im fine untill i change something -> run and then i get this linker error Error 5 error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall std::_Container_base_secure::~_Container_base_secure(void)" (__imp_??1_Container_base_secure@std@@QAE@XZ) boy.lib over and over again, if i rebuild im back to the linker error above, is there a pragma i need to use or is there simple somethings that are uncompitable in 2005? im using the 2D boy framework so im not sure if theres anything going on that is 2008 specific but like i say if there is that linker error insnt helping as there are no deques used... Thank you in advance for any help given, Chris
Advertisement
Just a crazy wild guess, but are you using:
throw ("some text" + anStdString);

Instead of:
throw MyExceptionType("some text" + anStdString);

I remember VS 2005 having some weird bug related to that that generates similar linkage issues.
There was a "throw some string" deep in the boy lib, and i commented it out, but unforntunatley im still getting the same linker error:

Error 43 error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall std::_Container_base_secure::_Orphan_all(void)const " (__imp_?_Orphan_all@_Container_base_secure@std@@QBEXXZ) referenced in function "public: void __thiscall std::deque<unsigned char *,class std::allocator<unsigned char *> >::push_back(unsigned char * const &)" (?push_back@?$deque@PAEV?$allocator@PAE@std@@@std@@QAEXABQAE@Z) boy.lib

Thank you for you suggestion though its really appreciated
Well it sounds to me that theres something wrong with the crt libraries that are being linked. Either the wrong version, or something else. Also, did you make sure to delete the release/debug directories when you migrated? Some transitional files can muck stuff up as well.
I actually didnt clean out the debug/release stuff orinally but after doing it im still getting the same problem. As far as i know there are no issues with crt libaries being linked. Is there anyway i can tell teh compiller to ignore error LNK2019?? i have one idea for fixing it but ill have to try that tommorow, im gonna catch some zzzzs

thank you so much for your help if you can think of anything else that would be fantastic
Sorry you can't 'ignore' an error like that :) It's trying to resolve linking symbols and it can't. That's a fatal error. If all else fails, you could simply re-create the project in VS2005, and move the files over (and add any custom libs and such as needed).
Was boy.lib built with VS 2005 or VS 2008? You *cannot* link two different libraries that were built with different compiler versions.

If you're building with 2005, every single library going into your executable as an input, either directly or indirectly, must have been built using 2005.

In my experience, this is almost always the problem when dealing with linker errors switching compiler versions.

If you're using any open source 3rd party libraries, those also must be recompiled with the new Visual Studio
I thought this, cache_hit which is why i rebuilt all libaries in 2005, but i think ill take another look because i have a sneaking feeling i am trying to use one libary that was comiled in 2008, boy.lib was recompiled in 2005 but i think that it uses a libary that i havent recompiled in 2005, i will double check this and get back (im not on my home computer right now so i cant check it)

Thanks alot i will let you know how i get on

This topic is closed to new replies.

Advertisement