Version on desktop: 4.9.9.2
Version on laptop: 4.8.9.0
Both running on XP professional.
This is my first ever post to any forum, please bear with me if I offend some protocol. I usually manage to solve problems on my own, but this one has me beaten.
The problem arose with a project that has been happily working for a couple of months and compiled OK just last week. I have been using the 4.9.9.2 version exclusively all that time.
I made an insignificant change to a pair of the files (.h & .cpp) in my project (Yes, I know but please read on before crucifying me...) and I was presented with a host of linker errors which I feel sure are unrelated to my minor code change.
I reverted to the original version of the header and code file - same problem.
I used a small experimental project from months ago which has its own, unchanged copies of the files I changed and a simpler main file - same problem.
There is no issue with a single file project either from example code or my own.
I resorted to the laptop running an earlier version of DevC++ using the (modified) files that showed up the problem initially - the project compiles and links just as I expected.
I have uninstalled and reinstalled DevC++ three times on the desktop being more thorough in removing traces of the old installation each time, finally deleting the the project and layout files. Still no joy.
Paths are devoid of spaces.
I will welcome any suggestions you may have regarding this unexpected change in behaviour.
I still don't know the cause, but the solution seems to be that if you get one of these bizarre [linker error]undefined reference to '__something_you_have_never_heard_of' messages delete ALL the object files in your project and recompile everything. It does not seem necessary to delete the project and layout files.
Well, I've enjoyed talking to me - cheers!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I sort of feel like I'm talking to myself - at least I don't get very may contradictions :-)
Well, this is a mystery.
I tried a few different things including installing 4.9.8.0 back on the desktop but that did not solve anything (no surprise there). The following experiments were done using the small test program rather than the project that originally showed up the problem still using 4.8.9.0.
I renamed the project and layout files, created a new project and added the source files - same problem. I copied the files from the offending project to a new directory c:\a_work\AAA, created a new console project and added them to it - eh voila - it compiled & linked. Odd, I thought. To try to track the cause I created a long path and put the files there, created a new project etc. and it compiled & linked no bother. Lastly I created a new folder (C:\a_Work\CPP_practice\Experiments\A-AA) next door to the original (C:\a_Work\CPP_practice\Experiments\Linker-test) and did it all again - imagine my surprise when it compiled & linked (and ran, of course). Finally I deleted all but the source files in the Linker-test directory and, yet again, created a new project and added the old files to it - you guessed it - the rotten thing compiled, linked and ran just like new.
I guess this must just be another feature of XP.
Incidentally VC++ will not compile this project at all - it seems to have a different definition of strings that precludes the following
string s;
while(source.getinfo(s)) //Read strings from the file
cout<<s<<endl; <- complains about using "<<" on a string but s.c_str() is OK
and
int streamer::getinfo(string & mystring){
if(mystream>>mystring) return 1; <- complains about ">>" I didn't solve this one
else return 0;
}
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
undefined reference to `_Unwind_Resume'
Version on desktop: 4.9.9.2
Version on laptop: 4.8.9.0
Both running on XP professional.
This is my first ever post to any forum, please bear with me if I offend some protocol. I usually manage to solve problems on my own, but this one has me beaten.
The problem arose with a project that has been happily working for a couple of months and compiled OK just last week. I have been using the 4.9.9.2 version exclusively all that time.
I made an insignificant change to a pair of the files (.h & .cpp) in my project (Yes, I know but please read on before crucifying me...) and I was presented with a host of linker errors which I feel sure are unrelated to my minor code change.
I reverted to the original version of the header and code file - same problem.
I used a small experimental project from months ago which has its own, unchanged copies of the files I changed and a simpler main file - same problem.
There is no issue with a single file project either from example code or my own.
I resorted to the laptop running an earlier version of DevC++ using the (modified) files that showed up the problem initially - the project compiles and links just as I expected.
I have uninstalled and reinstalled DevC++ three times on the desktop being more thorough in removing traces of the old installation each time, finally deleting the the project and layout files. Still no joy.
Paths are devoid of spaces.
I will welcome any suggestions you may have regarding this unexpected change in behaviour.
Best regards, David.
Compile log:
Compiler: Default compiler
Building Makefile: "H:\Analyse\Makefile.win"
Executing make...
make.exe -f "H:\Analyse\Makefile.win" all
g++.exe main.o analysis.o filestuff.o -o "Analysenew.exe" -L"C:/Dev-Cpp/lib" main.o(.text+0x2c70):main.cpp: undefined reference to
_Unwind_Resume' main.o(.text$_ZNSt14__simple_allocIPN8Gradient8valstoreESt24__default_alloc_templateILb1ELi0EEE10deallocateEPS2_j[std::__simple_alloc<Gradient::valstore*, std::__default_alloc_template<true, 0> >::deallocate(Gradient::valstore**, unsigned int)]+0x1a):main.cpp: undefined reference to
std::default_alloc_template<true, 0>::deallocate(void*, unsigned int)'main.o(.text$_ZNSt14simple_allocIP9drawstoreSt24default_alloc_templateILb1ELi0EEE10deallocateEPS1_j[std::simple_alloc<drawstore*, std::default_alloc_template<true, 0> >::deallocate(drawstore**, unsigned int)]+0x1a):main.cpp: undefined reference to
std::__default_alloc_template<true, 0>::deallocate(void*, unsigned int)' main.o(.text$_ZNSt14__simple_allocIN8Gradient8valstoreESt24__default_alloc_templateILb1ELi0EEE10deallocateEPS1_j[std::__simple_alloc<Gradient::valstore, std::__default_alloc_template<true, 0> >::deallocate(Gradient::valstore*, unsigned int)]+0x27):main.cpp: undefined reference to
std::default_alloc_template<true, 0>::deallocate(void, unsigned int)'main.o(.text$_ZNSt14simple_allocI9drawstoreSt24default_alloc_templateILb1ELi0EEE10deallocateEPS0_j[std::simple_alloc<drawstore, std::default_alloc_template<true, 0> >::deallocate(drawstore*, unsigned int)]+0x1a):main.cpp: undefined reference to
std::__default_alloc_template<true, 0>::deallocate(void*, unsigned int)'main.o(.eh_frame+0x12):main.cpp: undefined reference to
gxx_personality_v0'analysis.o(.text+0x958):analysis.cpp: undefined reference to_Unwind_Resume' analysis.o(.text+0xa5e):analysis.cpp: undefined reference to
_Unwind_Resume'analysis.o(.text+0xf73):analysis.cpp: undefined reference to
_Unwind_Resume' analysis.o(.text+0x111b):analysis.cpp: undefined reference to
_Unwind_Resume'analysis.o(.text+0x1328):analysis.cpp: undefined reference to
_Unwind_Resume' analysis.o(.text+0x153a):analysis.cpp: more undefined references to
_Unwind_Resume' followanalysis.o(.text$_ZNSt14simple_allocIN8Gradient8valstoreESt24default_alloc_templateILb1ELi0EEE8allocateEj[std::simple_alloc<Gradient::valstore, std::default_alloc_template<true, 0> >::allocate(unsigned int)]+0x24):analysis.cpp: undefined reference to
std::__default_alloc_template<true, 0>::allocate(unsigned int)' analysis.o(.text$_ZNSt14__simple_allocIP9drawstoreSt24__default_alloc_templateILb1ELi0EEE8allocateEj[std::__simple_alloc<drawstore*, std::__default_alloc_template<true, 0> >::allocate(unsigned int)]+0x17):analysis.cpp: undefined reference to
std::default_alloc_template<true, 0>::allocate(unsigned int)'analysis.o(.text$_ZNSt14simple_allocI9drawstoreSt24default_alloc_templateILb1ELi0EEE8allocateEj[std::simple_alloc<drawstore, std::default_alloc_template<true, 0> >::allocate(unsigned int)]+0x17):analysis.cpp: undefined reference to
std::__default_alloc_template<true, 0>::allocate(unsigned int)' analysis.o(.text$_ZNSt14__simple_allocIPN8Gradient8valstoreESt24__default_alloc_templateILb1ELi0EEE8allocateEj[std::__simple_alloc<Gradient::valstore*, std::__default_alloc_template<true, 0> >::allocate(unsigned int)]+0x17):analysis.cpp: undefined reference to
std::default_alloc_template<true, 0>::allocate(unsigned int)'analysis.o(.eh_frame+0x12):analysis.cpp: undefined reference to
__gxx_personality_v0' filestuff.o(.eh_frame+0x11):filestuff.cpp: undefined reference to
gxx_personality_v0'collect2: ld returned 1 exit statusmake.exe: ** [Analysenew.exe] Error 1Execution terminated
I still don't know the cause, but the solution seems to be that if you get one of these bizarre [linker error]undefined reference to '__something_you_have_never_heard_of' messages delete ALL the object files in your project and recompile everything. It does not seem necessary to delete the project and layout files.
Well, I've enjoyed talking to me - cheers!
I sort of feel like I'm talking to myself - at least I don't get very may contradictions :-)
Well, this is a mystery.
I tried a few different things including installing 4.9.8.0 back on the desktop but that did not solve anything (no surprise there). The following experiments were done using the small test program rather than the project that originally showed up the problem still using 4.8.9.0.
I renamed the project and layout files, created a new project and added the source files - same problem. I copied the files from the offending project to a new directory c:\a_work\AAA, created a new console project and added them to it - eh voila - it compiled & linked. Odd, I thought. To try to track the cause I created a long path and put the files there, created a new project etc. and it compiled & linked no bother. Lastly I created a new folder (C:\a_Work\CPP_practice\Experiments\A-AA) next door to the original (C:\a_Work\CPP_practice\Experiments\Linker-test) and did it all again - imagine my surprise when it compiled & linked (and ran, of course). Finally I deleted all but the source files in the Linker-test directory and, yet again, created a new project and added the old files to it - you guessed it - the rotten thing compiled, linked and ran just like new.
I guess this must just be another feature of XP.
Incidentally VC++ will not compile this project at all - it seems to have a different definition of strings that precludes the following
string s;
while(source.getinfo(s)) //Read strings from the file
cout<<s<<endl; <- complains about using "<<" on a string but s.c_str() is OK
and
int streamer::getinfo(string & mystring){
if(mystream>>mystring) return 1; <- complains about ">>" I didn't solve this one
else return 0;
}