Unresolved symbols in libstdc++

Marco Alanen marco.alanen@sbg.se
Wed Nov 10 09:41:00 GMT 2004


Greetings

(I posted this in cygwin.talk, but then I realized that this was a much 
more suited place)
I'm trying to get a fairly large C++ project to compile using the mingw 
tools in cygwin. I've sorted out most of the errors so far, but now I'm 
stuck on the executable linking .

Compilation flags: (probably a TON of useless compilation and linker 
flags, but I've been trying virtually everything here):
   gcc -pipe -g -O -Wall -fno-rtti -fno-exceptions -I/usr/include -I
   /usr/include/mingw -I /usr/include/w32api -mno-cygwin -mwindows
   -mwin32 -D__MINGW32__ -DWIN32 -march=pentium-mmx -mmmx
   -malign-double -mpreferred-stack-boundary=8 -traditional

Linker flags:
   <lots of object files> -lsbg_fltk -lflvw -lmsvcrt -lpng -ljpeg -lz
   -lstdc++ -lgcc -lcrtdll -lmingw32 -lmingwex -lopengl32 -lglu32 -lgdi32
   -lwsock32 -lm

These are the linker errors I get. The strange thing is that those 
functions are implemented in libgcc.a.
/usr/lib/mingw/libstdc++.a(stl-inst.o)(.text$_ZNSt24__default_alloc_templateILb1ELi0EE5_LockC2Ev+0x2b):stl-inst.cc: 
undefined reference to `___gthr_win32_mutex_lock'
/usr/lib/mingw/libstdc++.a(stl-inst.o)(.text$_ZNSt24__default_alloc_templateILb1ELi0EE5_LockC1Ev+0x2b):stl-inst.cc: 
undefined reference to `___gthr_win32_mutex_lock'
/usr/lib/mingw/libstdc++.a(stl-inst.o)(.text$_ZNSt24__default_alloc_templateILb1ELi0EE5_LockD2Ev+0x2b):stl-inst.cc: 
undefined reference to `___gthr_win32_mutex_unlock'

/usr/lib/mingw/libstdc++.a(stl-inst.o)(.text$_ZNSt24__default_alloc_templateILb1ELi0EE5_LockD1Ev+0x2b):stl-inst.cc: 
undefined reference to `___gthr_win32_mutex_unlock'

/usr/lib/mingw/libstdc++.a(stl-inst.o)(.text$_ZNSt24__default_alloc_templateILb1ELi0EE8allocateEj+0xfb):stl-inst.cc: 
undefined reference to `___gthr_win32_mutex_unlock
'
/usr/lib/mingw/libstdc++.a(stl-inst.o)(.text$_ZNSt24__default_alloc_templateILb1ELi0EE8allocateEj+0x151):stl-inst.cc: 
undefined reference to `___gthr_win32_mutex_lock'

/usr/lib/mingw/libstdc++.a(stl-inst.o)(.text$_ZNSt24__default_alloc_templateILb1ELi0EE8allocateEj+0x1d6):stl-inst.cc: 
undefined reference to `___gthr_win32_mutex_unloc
k'
/usr/lib/mingw/libstdc++.a(stl-inst.o)(.text$_ZNSt15_STL_mutex_lock13_M_initializeEv+0x8f):stl-inst.cc: 
undefined reference to `___gthr_win32_once'
/usr/lib/mingw/libstdc++.a(stl-inst.o)(.text$_ZNSt15_STL_mutex_lock13_M_initializeEv+0xa1):stl-inst.cc: 
undefined reference to `___gthr_win32_mutex_lock'
/usr/lib/mingw/libstdc++.a(stl-inst.o)(.text$_ZNSt15_STL_mutex_lock13_M_initializeEv+0xc1):stl-inst.cc: 
undefined reference to `___gthr_win32_once'
/usr/lib/mingw/libstdc++.a(stl-inst.o)(.text$_ZNSt15_STL_mutex_lock13_M_initializeEv+0x7e):stl-inst.cc: 
undefined reference to `___gthr_win32_mutex_unlock'
/usr/lib/mingw/libmingw32.a(main.o)(.text+0x106):main.c: undefined 
reference to `_WinMain@16'

I found a guy who had the same problem as me, and he was adviced to 
reinstall gcc since his versions differed. That isn't the case for me, 
but I can try it out if it helps.
http://www.cygwin.com/ml/cygwin/2003-12/msg00270.html

Any ideas what I should do or what I should add to this post in order to 
solve my problem? I'm currently reinstalling cygwin from scratch to 
eliminate any screwups from my side. I'll use nothing but stable packages.

  Thank you /Marco
U


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/



More information about the Cygwin mailing list