General Category > General Discussion about just::thread
Trying to get to 1st base with TDM gcc4.5.2 under WinXP
Leor:
Still trying to get just:;thread to play nice with TDM gcc 4.5.2, on my WinXP Pro system.
First attempt to install the "vanilla" 32-bit TDM 4.5.2 failed due to the installer not finding a required file on the server.
So, I gave the 32/64-bit version a shot. Its installer did run normally, so supposedly I now have that version correctly installed in E:\MinGW64.
With the latest just::thread happily installed in E:\JustThread, and carefully following the readme.txt instructions, it seems to be hanging up at link time. Here's a little BAT file I'm using to try to compile a minimal test program, thread1.cpp:
set CPLUS_INCLUDE_PATH=e:\justthread\include
set LD_INCLUDE_PATH=e:\justthread\lib
g++ -mthreads -m32 -std=c++0x thread1.cpp -o thread1.exe -ljustthread32 -lwinmm
What I see when running this:
e:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.6.1/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -ljustthread32
collect2: ld returned 1 exit status
Any idea why it fails to locate the file in the lib folder? (BTW, I've also tried doing this by setting the LIB environment variable, and it still can't find it...)
Thanks!
Anthony Williams:
I am not sure why it is not working for you.
Probably the easiest option in the short term is to specify the path directly:
g++ -m32 -mthreads -std=c++0x -Ie:/justthread/include foo.cpp -o foo.exe e:/justthread/lib/libjustthread32.a -lwinmm
Leor:
Well, one step forward and another back. Note that I misspelled the name of the library path variable above (using LD_INCLUDE PATH instead of LD_LIBRARY_PATH).
Even with that corrected, though, I still get the same linker error as above.
When I provide the full pathname as per your suggestion (or, in fact, copy the required .a file to the current directory and give its name without any path at all), it does not seem to resolve any symbols. The result of attempting the compilation is now:
c:\temp\ccb20mvj.o:thread1.cpp:(.text+0x9a): undefined reference to `std::__jssX
46::thread::join()'
c:\temp\ccb20mvj.o:thread1.cpp:(.text$_ZN5__jss6__cm4624__basic_thread_base_data
C2Ev[__ZN5__jss6__cm4624__basic_thread_base_dataC2Ev]+0x8): undefined reference
to `vtable for __jss::__cm46::__basic_thread_base_data'
c:\temp\ccb20mvj.o:thread1.cpp:(.text$_ZN5__jss5(T4, __thread_base_data, Ev cons
t)[__ZN5__jss5(T4, __thread_base_data, Ev const)]+0x16): undefined reference to
`vtable for __jss::__X46::__thread_base_data'
c:\temp\ccb20mvj.o:thread1.cpp:(.text$_ZNSt8__jssX466threadD1Ev[__ZNSt8__jssX466
threadD1Ev]+0xd): undefined reference to `std::__jssX46::thread::joinable() cons
t'
c:\temp\ccb20mvj.o:thread1.cpp:(.text$_ZNSt8__jssX466threadC1IRFvvEEEOT_[__ZNSt8
__jssX466threadC1IRFvvEEEOT_]+0x65): undefined reference to `std::__jssX46::thre
ad::start_thread(__jss::__X46::__thread_func_wrapper_base const&)'
c:\temp\ccb20mvj.o:thread1.cpp:(.text$_ZN5__jss5__X4611thread_dataINS0_9__invoke
rIvRFvvEIEEEED1Ev[__ZN5__jss5__X4611thread_dataINS0_9__invokerIvRFvvEIEEEED1Ev]+
0x21): undefined reference to `__jss::__X46::__thread_base_data::~__thread_base_
data()'
collect2: ld returned 1 exit status
This is just nuts. I'm having such a hard time today with stuff that is supposed to be simple...
Anthony Williams:
--- Quote from: Leor on November 19, 2011, 04:18:10 AM ---When I provide the full pathname as per your suggestion (or, in fact, copy the required .a file to the current directory and give its name without any path at all), it does not seem to resolve any symbols. The result of attempting the compilation is now:
c:\temp\ccb20mvj.o:thread1.cpp:(.text+0x9a): undefined reference to `std::__jssX
46::thread::join()'
--- End quote ---
This symbol will not be resolved by the current release of just::thread. The name indicates that this code was compiled with gcc 4.6, which is not supported for the TDM port. I guess your PATH still has TDM 4.6.1 on it.
Leor:
Well, that's interesting, Anthony! The last thing I expected after installing from the tdm 4.5.2 installer would be to find out it had actually installed version 4.6.1 ... but that's exactly that the 32/64 bit 4.5.2 "experimental" version did. I guess the experiment is still in progress...
So I can't install the straight 32-bit 4.5.2 because the installer immediately fails, and when I try to install the 32/64-bit, it installs the 4.6.1 compiler and who the heck knows what versions of other things.
And those are the only two options the 4.5.2 installer gives me.
You gotta love it.
Unless you have some other idea of how I can get some version of gcc going that just::thread will work with, I guess I'm doing all my testing with VC10.
Navigation
[0] Message Index
[#] Next page
Go to full version