Strange linker error building TBB under mingw

Strange linker error building TBB under mingw

Hi, I have encounted a strange linker error building TBB under mingw and I need some help.
My platform:Windows 7, 64 bit, SP1Mingw installed from mingw-get-inst-20110802.exegcc --version 4.5.2
TBB Version:tbb30_20110705oss
TBB make command: <>mingw32-make arch=ia32 compiler=gcc runtime=mingw tbb
The build of TBB completes successfully. Now I try to build the following program (main.cpp):

#include "tbb/task_scheduler_init.h"

using namespace tbb;

int main() {
task_scheduler_init init;
return 0;
}

with this command:g++ main.cpp -I./tbb/tbb30_20110704oss/include/ -L./tbb/tbb30_20110704oss/build/windows_ia32_gcc_mingw_release/ -ltbband I get this linker error:

C:\\Users\\cpadwick\\AppData\\Local\\Temp\\ccAWoCp3.o:main.cpp:(.text$_ZN3tbb19task_scheduler_initC1Eij[tbb::task_scheduler_init::task_scheduler_init(int, unsigned int)]+0x33): undefined reference to `tbb::task_scheduler_init::initialize(int, unsigned int)'C:\\Users\\cpadwick\\AppData\\Local\\Temp\\ccAWoCp3.o:main.cpp:(.text$_ZN3tbb19task_scheduler_initD1Ev[tbb::task_scheduler_init::~task_scheduler_init()]+0x16): undefined reference to `tbb::task_scheduler_init::terminate()'collect2: ld returned 1 exit status

Things I have tried already:
-The -L path is correct.
-the library tbb.dll exists.
-I have tried running "nm" on tbb.dll and also on main.o. Here are the results, filtered by symbols with task_scheduler_init in the name:

$ nm main.o | grep task_scheduler_init00000000 t .text$_ZN3tbb19task_scheduler_initC1Eij00000000 t .text$_ZN3tbb19task_scheduler_initD1Ev U __ZN3tbb19task_scheduler_init10initializeEij U __ZN3tbb19task_scheduler_init9terminateEv00000000 T __ZN3tbb19task_scheduler_initC1Eij00000000 T __ZN3tbb19task_scheduler_initD1Ev

$ nm ./tbb/tbb30_20110704oss/build/windows_ia32_gcc_mingw_release/tbb.dll | grep task_scheduler_init676c9ce4 T __ZN3tbb19task_scheduler_init10initializeEi676c9c58 T __ZN3tbb19task_scheduler_init10initializeEij676c9b90 T __ZN3tbb19task_scheduler_init19default_num_threadsEv676c9b28 T __ZN3tbb19task_scheduler_init9terminateEv

I also ran "nm --demangle" on both main.o and tbb.dll. Here are the results:
$ nm --demangle main.o | grep task_scheduler_init00000000 t .text$_ZN3tbb19task_scheduler_initC1Eij00000000 t .text$_ZN3tbb19task_scheduler_initD1Ev U tbb::task_scheduler_init::initialize(int, unsigned int) U tbb::task_scheduler_init::terminate()00000000 T tbb::task_scheduler_init::task_scheduler_init(int, unsigned int)00000000 T tbb::task_scheduler_init::~task_scheduler_init(),

$ nm --demangle ./tbb/tbb30_20110704oss/build/windows
_ia32_gcc_mingw_release/tbb.dll | grep task_scheduler_init676c9ce4 T tbb::task_scheduler_init::initialize(int)676c9c58 T tbb::task_scheduler_init::initialize(int, unsigned int)676c9b90 T tbb::task_scheduler_init::default_num_threads()676c9b28 T tbb::task_scheduler_init::terminate()

So the mystery appears to be why can't ld resolve the symboltbb::task_scheduler_init::initialize(int, unsigned int) when it is *clearly* being exported in the tbb library? A parallel (har har) mystery is that a colleague of mine can build the same version of TBB with the same version of mingw and experiences no issues when trying to link the same example program.

Any help would be greatly appreciated. Thanks!

6 Beiträge / 0 neu
Letzter Beitrag
Nähere Informationen zur Compiler-Optimierung finden Sie in unserem Optimierungshinweis.

hello,Isnon-mingw version of tbb.dll around?it looks like ld picks up non-mingw version of tbb.dll beforemingw version of tbb.dll. I do not remember exactly whether $LIB/$LD_LIBRARY_PATH/$PATH or-L should go first to linker for mingw.hope this helps.--Vladimir

Hi, I was able to check the search path for ld with this command:$ ld --verbose | grep SEARCH_DIR | tr -s ' ;' \\012SEARCH_DIR("=/usr/local/lib")SEARCH_DIR("=/lib")SEARCH_DIR("=/usr/lib")There are definitely no other copies of tbb.dll in those locations. I also passed the version of tbb.dll that I built on my machine to my colleague. when he tries to link against my version of tbb.dll, he gets the same linker error. He passed me his version of tbb.dll, and I can link against that version without error.I have attached my tbb build log for reference, although I don't see anything worrisome in there.

Created .buildwindows_ia32_gcc_mingw_release and ..._debug directories
C:/MinGW/bin/mingw32-make -C ".buildwindows_ia32_gcc_mingw_debug"  -r -f ../../build/Makefile.tbb cfg=debug tbb_root=../..
mingw32-make[1]: Entering directory `c:/Users/cpadwick/ipl2-workspace/tbb/tbb30_20110704oss/build/windows_ia32_gcc_mingw_debug'
../../build/Makefile.tbb:39: CONFIG: cfg=debug arch=ia32 compiler=gcc os=windows runtime=mingw
g++ -c -MMD -g -O0 -DTBB_USE_DEBUG -DUSE_WINTHREAD -D_WIN32_WINNT=0x0501 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m32  -D__TBB_BUILD=1 -Wall  -Wno-uninitialized -Wno-parentheses    -I../../src -I../../src/rml/include -I../../include ../../src/tbb/concurrent_hash_map.cpp
g++ -c -MMD -g -O0 -DTBB_USE_DEBUG -DUSE_WINTHREAD -D_WIN32_WINNT=0x0501 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m32  -D__TBB_BUILD=1 -Wall  -Wno-uninitialized -Wno-parentheses    -I../../src -I../../src/rml/include -I../../include ../../src/tbb/concurrent_queue.cpp
g++ -c -MMD -g -O0 -DTBB_USE_DEBUG -DUSE_WINTHREAD -D_WIN32_WINNT=0x0501 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m32  -D__TBB_BUILD=1 -Wall  -Wno-uninitialized -Wno-parentheses    -I../../src -I../../src/rml/include -I../../include ../../src/tbb/concurrent_vector.cpp
g++ -c -MMD -g -O0 -DTBB_USE_DEBUG -DUSE_WINTHREAD -D_WIN32_WINNT=0x0501 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m32  -D__TBB_BUILD=1 -Wall  -Wno-uninitialized -Wno-parentheses    -I../../src -I../../src/rml/include -I../../include ../../src/tbb/dynamic_link.cpp
g++ -c -MMD -g -O0 -DTBB_USE_DEBUG -DUSE_WINTHREAD -D_WIN32_WINNT=0x0501 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m32  -D__TBB_BUILD=1 -Wall  -Wno-uninitialized -Wno-parentheses    -I../../src -I../../src/rml/include -I../../include ../../src/tbb/itt_notify.cpp
g++ -c -MMD -g -O0 -DTBB_USE_DEBUG -DUSE_WINTHREAD -D_WIN32_WINNT=0x0501 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m32  -D__TBB_BUILD=1 -Wall  -Wno-uninitialized -Wno-parentheses    -I../../src -I../../src/rml/include -I../../include ../../src/tbb/cache_aligned_allocator.cpp
g++ -c -MMD -g -O0 -DTBB_USE_DEBUG -DUSE_WINTHREAD -D_WIN32_WINNT=0x0501 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m32  -D__TBB_BUILD=1 -Wall  -Wno-uninitialized -Wno-parentheses    -I../../src -I../../src/rml/include -I../../include ../../src/tbb/pipeline.cpp
g++ -c -MMD -g -O0 -DTBB_USE_DEBUG -DUSE_WINTHREAD -D_WIN32_WINNT=0x0501 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m32  -D__TBB_BUILD=1 -Wall  -Wno-uninitialized -Wno-parentheses    -I../../src -I../../src/rml/include -I../../include ../../src/tbb/queuing_mutex.cpp
g++ -c -MMD -g -O0 -DTBB_USE_DEBUG -DUSE_WINTHREAD -D_WIN32_WINNT=0x0501 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m32  -D__TBB_BUILD=1 -Wall  -Wno-uninitialized -Wno-parentheses    -I../../src -I../../src/rml/include -I../../include ../../src/tbb/queuing_rw_mutex.cpp
g++ -c -MMD -g -O0 -DTBB_USE_DEBUG -DUSE_WINTHREAD -D_WIN32_WINNT=0x0501 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m32  -D__TBB_BUILD=1 -Wall  -Wno-uninitialized -Wno-parentheses    -I../../src -I../../src/rml/include -I../../include ../../src/tbb/reader_writer_lock.cpp
g++ -c -MMD -g -O0 -DTBB_USE_DEBUG -DUSE_WINTHREAD -D_WIN32_WINNT=0x0501 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m32  -D__TBB_BUILD=1 -Wall  -Wno-uninitialized -Wno-parentheses    -I../../src -I../../src/rml/include -I../../include ../../src/tbb/spin_rw_mutex.cpp
g++ -c -MMD -g -O0 -DTBB_USE_DEBUG -DUSE_WINTHREAD -D_WIN32_WINNT=0x0501 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m32  -D__TBB_BUILD=1 -Wall  -Wno-uninitialized -Wno-parentheses    -I../../src -I../../src/rml/include -I../../include ../../src/tbb/spin_mutex.cpp
g++ -c -MMD -g -O0 -DTBB_USE_DEBUG -DUSE_WINTHREAD -D_WIN32_WINNT=0x0501 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m32  -D__TBB_BUILD=1 -Wall  -Wno-uninitialized -Wno-parentheses    -I../../src -I../../src/rml/include -I../../include ../../src/tbb/critical_section.cpp
g++ -c -MMD -g -O0 -DTBB_USE_DEBUG -DUSE_WINTHREAD -D_WIN32_WINNT=0x0501 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m32  -D__TBB_BUILD=1 -Wall  -Wno-uninitialized -Wno-parentheses    -I../../src -I../../src/rml/include -I../../include ../../src/tbb/task.cpp
cmd /C cscript /nologo /E:jscript ../../build/version_info_windows.js gcc ia32 "g++ -g -O0 -DTBB_USE_DEBUG -DUSE_WINTHREAD -D_WIN32_WINNT=0x0501 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m32  -D__TBB_BUILD=1 -Wall  -Wno-uninitialized -Wno-parentheses " > version_string.tmp
g++ -c -MMD -g -O0 -DTBB_USE_DEBUG -DUSE_WINTHREAD -D_WIN32_WINNT=0x0501 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m32  -D__TBB_BUILD=1 -Wall  -Wno-uninitialized -Wno-parentheses    -I. -I../../src -I../../src/rml/include -I../../include ../../src/tbb/tbb_misc.cpp
g++ -c -MMD -g -O0 -DTBB_USE_DEBUG -DUSE_WINTHREAD -D_WIN32_WINNT=0x0501 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m32  -D__TBB_BUILD=1 -Wall  -Wno-uninitialized -Wno-parentheses    -I../../src -I../../src/rml/include -I../../include ../../src/tbb/tbb_misc_ex.cpp
g++ -c -MMD -g -O0 -DTBB_USE_DEBUG -DUSE_WINTHREAD -D_WIN32_WINNT=0x0501 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m32  -D__TBB_BUILD=1 -Wall  -Wno-uninitialized -Wno-parentheses    -I../../src -I../../src/rml/include -I../../include ../../src/tbb/mutex.cpp
g++ -c -MMD -g -O0 -DTBB_USE_DEBUG -DUSE_WINTHREAD -D_WIN32_WINNT=0x0501 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m32  -D__TBB_BUILD=1 -Wall  -Wno-uninitialized -Wno-parentheses    -I../../src -I../../src/rml/include -I../../include ../../src/tbb/recursive_mutex.cpp
g++ -c -MMD -g -O0 -DTBB_USE_DEBUG -DUSE_WINTHREAD -D_WIN32_WINNT=0x0501 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m32  -D__TBB_BUILD=1 -Wall  -Wno-uninitialized -Wno-parentheses    -I../../src -I../../src/rml/include -I../../include ../../src/tbb/condition_variable.cpp
g++ -c -MMD -g -O0 -DTBB_USE_DEBUG -DUSE_WINTHREAD -D_WIN32_WINNT=0x0501 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m32  -D__TBB_BUILD=1 -Wall  -Wno-uninitialized -Wno-parentheses    -I../../src -I../../src/rml/include -I../../include ../../src/tbb/tbb_thread.cpp
g++ -c -MMD -g -O0 -DTBB_USE_DEBUG -DUSE_WINTHREAD -D_WIN32_WINNT=0x0501 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m32  -D__TBB_BUILD=1 -Wall  -Wno-uninitialized -Wno-parentheses    -I../../src -I../../src/rml/include -I../../include ../../src/tbb/concurrent_monitor.cpp
g++ -c -MMD -g -O0 -DTBB_USE_DEBUG -DUSE_WINTHREAD -D_WIN32_WINNT=0x0501 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m32  -D__TBB_BUILD=1 -Wall  -Wno-uninitialized -Wno-parentheses    -I../../src -I../../src/rml/include -I../../include ../../src/tbb/private_server.cpp
g++ -c -MMD -g -O0 -DTBB_USE_DEBUG -DUSE_WINTHREAD -D_WIN32_WINNT=0x0501 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m32  -D__TBB_BUILD=1 -Wall  -Wno-uninitialized -Wno-parentheses    -I../../src -I../../src/rml/include -I../../include ../../src/rml/client/rml_tbb.cpp
g++ -c -MMD -g -O0 -DTBB_USE_DEBUG -DUSE_WINTHREAD -D_WIN32_WINNT=0x0501 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m32  -D__TBB_BUILD=1 -Wall  -Wno-uninitialized -Wno-parentheses    -I../../src -I../../src/rml/include -I../../include ../../src/tbb/task_group_context.cpp
g++ -c -MMD -g -O0 -DTBB_USE_DEBUG -DUSE_WINTHREAD -D_WIN32_WINNT=0x0501 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m32  -D__TBB_BUILD=1 -Wall  -Wno-uninitialized -Wno-parentheses    -I../../src -I../../src/rml/include -I../../include ../../src/tbb/governor.cpp
g++ -c -MMD -g -O0 -DTBB_USE_DEBUG -DUSE_WINTHREAD -D_WIN32_WINNT=0x0501 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m32  -D__TBB_BUILD=1 -Wall  -Wno-uninitialized -Wno-parentheses    -I../../src -I../../src/rml/include -I../../include ../../src/tbb/market.cpp
g++ -c -MMD -g -O0 -DTBB_USE_DEBUG -DUSE_WINTHREAD -D_WIN32_WINNT=0x0501 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m32  -D__TBB_BUILD=1 -Wall  -Wno-uninitialized -Wno-parentheses    -I../../src -I../../src/rml/include -I../../include ../../src/tbb/arena.cpp
g++ -c -MMD -g -O0 -DTBB_USE_DEBUG -DUSE_WINTHREAD -D_WIN32_WINNT=0x0501 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m32  -D__TBB_BUILD=1 -Wall  -Wno-uninitialized -Wno-parentheses    -I../../src -I../../src/rml/include -I../../include ../../src/tbb/scheduler.cpp
g++ -c -MMD -g -O0 -DTBB_USE_DEBUG -DUSE_WINTHREAD -D_WIN32_WINNT=0x0501 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m32  -D__TBB_BUILD=1 -Wall  -Wno-uninitialized -Wno-parentheses    -I../../src -I../../src/rml/include -I../../include ../../src/tbb/observer_proxy.cpp
g++ -c -MMD -g -O0 -DTBB_USE_DEBUG -DUSE_WINTHREAD -D_WIN32_WINNT=0x0501 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m32  -D__TBB_BUILD=1 -Wall  -Wno-uninitialized -Wno-parentheses    -I../../src -I../../src/rml/include -I../../include ../../src/tbb/tbb_statistics.cpp
g++ -c -MMD -g -O0 -DTBB_USE_DEBUG -DUSE_WINTHREAD -D_WIN32_WINNT=0x0501 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m32  -D__TBB_BUILD=1 -Wall  -Wno-uninitialized -Wno-parentheses    -I../../src -I../../src/rml/include -I../../include ../../src/tbb/tbb_main.cpp
g++ -c -MMD -g -O0 -DTBB_USE_DEBUG -DUSE_WINTHREAD -D_WIN32_WINNT=0x0501 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m32  -D__TBB_BUILD=1 -Wall  -Wno-uninitialized -Wno-parentheses    -I../../src -I../../src/rml/include -I../../include ../../src/old/concurrent_vector_v2.cpp
g++ -c -MMD -g -O0 -DTBB_USE_DEBUG -DUSE_WINTHREAD -D_WIN32_WINNT=0x0501 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m32  -D__TBB_BUILD=1 -Wall  -Wno-uninitialized -Wno-parentheses    -I../../src -I../../src/rml/include -I../../include ../../src/old/concurrent_queue_v2.cpp
g++ -c -MMD -g -O0 -DTBB_USE_DEBUG -DUSE_WINTHREAD -D_WIN32_WINNT=0x0501 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m32  -D__TBB_BUILD=1 -Wall  -Wno-uninitialized -Wno-parentheses    -I../../src -I../../src/rml/include -I../../include ../../src/old/spin_rw_mutex_v2.cpp
g++ -c -MMD -g -O0 -DTBB_USE_DEBUG -DUSE_WINTHREAD -D_WIN32_WINNT=0x0501 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m32  -D__TBB_BUILD=1 -Wall  -Wno-uninitialized -Wno-parentheses    -I../../src -I../../src/rml/include -I../../include ../../src/old/task_v2.cpp
cmd /C "....buildgenerate_tbbvars.bat"
Generating local tbbvars.bat
Generating local tbbvars.sh
Generating local tbbvars.csh
g++ -E -x c++ ../../src/tbb/lin32-tbb-export.def -g -O0 -DTBB_USE_DEBUG -DUSE_WINTHREAD -D_WIN32_WINNT=0x0501 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m32  -D__TBB_BUILD=1 -Wall  -Wno-uninitialized -Wno-parentheses  -I../../src -I../../src/rml/include -I../../include > tbb.def
g++  -o tbb_debug.dll concurrent_hash_map.o concurrent_queue.o concurrent_vector.o dynamic_link.o itt_notify.o cache_aligned_allocator.o pipeline.o queuing_mutex.o queuing_rw_mutex.o reader_writer_lock.o spin_rw_mutex.o spin_mutex.o critical_section.o task.o tbb_misc.o tbb_misc_ex.o mutex.o recursive_mutex.o condition_variable.o tbb_thread.o concurrent_monitor.o private_server.o rml_tbb.o task_group_context.o governor.o market.o arena.o scheduler.o observer_proxy.o tbb_statistics.o tbb_main.o concurrent_vector_v2.o concurrent_queue_v2.o spin_rw_mutex_v2.o task_v2.o    -lpsapi -shared -Wl,--enable-auto-import -Wl,-export-all-symbols -m32  -Wl,--version-script,tbb.def
c:/mingw/bin/../lib/gcc/mingw32/4.5.2/../../../../mingw32/bin/ld.exe: task.o: warning: duplicate section `.rdata$_ZTIN3tbb4taskE[typeinfo for tbb::task]' has different size

c:/mingw/bin/../lib/gcc/mingw32/4.5.2/../../../../mingw32/bin/ld.exe: scheduler.o: warning: duplicate section `.rdata$_ZTIN3tbb4taskE[typeinfo for tbb::task]' has different size

mingw32-make[1]: Leaving directory `c:/Users/cpadwick/ipl2-workspace/tbb/tbb30_20110704oss/build/windows_ia32_gcc_mingw_debug'
C:/MinGW/bin/mingw32-make -C ".buildwindows_ia32_gcc_mingw_release"  -r -f ../../build/Makefile.tbb cfg=release tbb_root=../..
mingw32-make[1]: Entering directory `c:/Users/cpadwick/ipl2-workspace/tbb/tbb30_20110704oss/build/windows_ia32_gcc_mingw_release'
../../build/Makefile.tbb:39: CONFIG: cfg=release arch=ia32 compiler=gcc os=windows runtime=mingw
g++ -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0501 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m32  -D__TBB_BUILD=1 -Wall  -Wno-uninitialized -Wno-parentheses    -I../../src -I../../src/rml/include -I../../include ../../src/tbb/concurrent_hash_map.cpp
g++ -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0501 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m32  -D__TBB_BUILD=1 -Wall  -Wno-uninitialized -Wno-parentheses    -I../../src -I../../src/rml/include -I../../include ../../src/tbb/concurrent_queue.cpp
g++ -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0501 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m32  -D__TBB_BUILD=1 -Wall  -Wno-uninitialized -Wno-parentheses    -I../../src -I../../src/rml/include -I../../include ../../src/tbb/concurrent_vector.cpp
g++ -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0501 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m32  -D__TBB_BUILD=1 -Wall  -Wno-uninitialized -Wno-parentheses    -I../../src -I../../src/rml/include -I../../include ../../src/tbb/dynamic_link.cpp
g++ -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0501 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m32  -D__TBB_BUILD=1 -Wall  -Wno-uninitialized -Wno-parentheses    -I../../src -I../../src/rml/include -I../../include ../../src/tbb/itt_notify.cpp
g++ -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0501 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m32  -D__TBB_BUILD=1 -Wall  -Wno-uninitialized -Wno-parentheses    -I../../src -I../../src/rml/include -I../../include ../../src/tbb/cache_aligned_allocator.cpp
g++ -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0501 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m32  -D__TBB_BUILD=1 -Wall  -Wno-uninitialized -Wno-parentheses    -I../../src -I../../src/rml/include -I../../include ../../src/tbb/pipeline.cpp
g++ -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0501 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m32  -D__TBB_BUILD=1 -Wall  -Wno-uninitialized -Wno-parentheses    -I../../src -I../../src/rml/include -I../../include ../../src/tbb/queuing_mutex.cpp
g++ -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0501 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m32  -D__TBB_BUILD=1 -Wall  -Wno-uninitialized -Wno-parentheses    -I../../src -I../../src/rml/include -I../../include ../../src/tbb/queuing_rw_mutex.cpp
g++ -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0501 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m32  -D__TBB_BUILD=1 -Wall  -Wno-uninitialized -Wno-parentheses    -I../../src -I../../src/rml/include -I../../include ../../src/tbb/reader_writer_lock.cpp
g++ -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0501 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m32  -D__TBB_BUILD=1 -Wall  -Wno-uninitialized -Wno-parentheses    -I../../src -I../../src/rml/include -I../../include ../../src/tbb/spin_rw_mutex.cpp
g++ -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0501 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m32  -D__TBB_BUILD=1 -Wall  -Wno-uninitialized -Wno-parentheses    -I../../src -I../../src/rml/include -I../../include ../../src/tbb/spin_mutex.cpp
g++ -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0501 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m32  -D__TBB_BUILD=1 -Wall  -Wno-uninitialized -Wno-parentheses    -I../../src -I../../src/rml/include -I../../include ../../src/tbb/critical_section.cpp
g++ -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0501 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m32  -D__TBB_BUILD=1 -Wall  -Wno-uninitialized -Wno-parentheses    -I../../src -I../../src/rml/include -I../../include ../../src/tbb/task.cpp
cmd /C cscript /nologo /E:jscript ../../build/version_info_windows.js gcc ia32 "g++ -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0501 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m32  -D__TBB_BUILD=1 -Wall  -Wno-uninitialized -Wno-parentheses " > version_string.tmp
g++ -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0501 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m32  -D__TBB_BUILD=1 -Wall  -Wno-uninitialized -Wno-parentheses    -I. -I../../src -I../../src/rml/include -I../../include ../../src/tbb/tbb_misc.cpp
g++ -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0501 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m32  -D__TBB_BUILD=1 -Wall  -Wno-uninitialized -Wno-parentheses    -I../../src -I../../src/rml/include -I../../include ../../src/tbb/tbb_misc_ex.cpp
g++ -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0501 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m32  -D__TBB_BUILD=1 -Wall  -Wno-uninitialized -Wno-parentheses    -I../../src -I../../src/rml/include -I../../include ../../src/tbb/mutex.cpp
g++ -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0501 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m32  -D__TBB_BUILD=1 -Wall  -Wno-uninitialized -Wno-parentheses    -I../../src -I../../src/rml/include -I../../include ../../src/tbb/recursive_mutex.cpp
g++ -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0501 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m32  -D__TBB_BUILD=1 -Wall  -Wno-uninitialized -Wno-parentheses    -I../../src -I../../src/rml/include -I../../include ../../src/tbb/condition_variable.cpp
g++ -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0501 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m32  -D__TBB_BUILD=1 -Wall  -Wno-uninitialized -Wno-parentheses    -I../../src -I../../src/rml/include -I../../include ../../src/tbb/tbb_thread.cpp
g++ -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0501 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m32  -D__TBB_BUILD=1 -Wall  -Wno-uninitialized -Wno-parentheses    -I../../src -I../../src/rml/include -I../../include ../../src/tbb/concurrent_monitor.cpp
g++ -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0501 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m32  -D__TBB_BUILD=1 -Wall  -Wno-uninitialized -Wno-parentheses    -I../../src -I../../src/rml/include -I../../include ../../src/tbb/private_server.cpp
g++ -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0501 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m32  -D__TBB_BUILD=1 -Wall  -Wno-uninitialized -Wno-parentheses    -I../../src -I../../src/rml/include -I../../include ../../src/rml/client/rml_tbb.cpp
g++ -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0501 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m32  -D__TBB_BUILD=1 -Wall  -Wno-uninitialized -Wno-parentheses    -I../../src -I../../src/rml/include -I../../include ../../src/tbb/task_group_context.cpp
g++ -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0501 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m32  -D__TBB_BUILD=1 -Wall  -Wno-uninitialized -Wno-parentheses    -I../../src -I../../src/rml/include -I../../include ../../src/tbb/governor.cpp
g++ -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0501 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m32  -D__TBB_BUILD=1 -Wall  -Wno-uninitialized -Wno-parentheses    -I../../src -I../../src/rml/include -I../../include ../../src/tbb/market.cpp
g++ -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0501 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m32  -D__TBB_BUILD=1 -Wall  -Wno-uninitialized -Wno-parentheses    -I../../src -I../../src/rml/include -I../../include ../../src/tbb/arena.cpp
g++ -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0501 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m32  -D__TBB_BUILD=1 -Wall  -Wno-uninitialized -Wno-parentheses    -I../../src -I../../src/rml/include -I../../include ../../src/tbb/scheduler.cpp
g++ -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0501 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m32  -D__TBB_BUILD=1 -Wall  -Wno-uninitialized -Wno-parentheses    -I../../src -I../../src/rml/include -I../../include ../../src/tbb/observer_proxy.cpp
g++ -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0501 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m32  -D__TBB_BUILD=1 -Wall  -Wno-uninitialized -Wno-parentheses    -I../../src -I../../src/rml/include -I../../include ../../src/tbb/tbb_statistics.cpp
g++ -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0501 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m32  -D__TBB_BUILD=1 -Wall  -Wno-uninitialized -Wno-parentheses    -I../../src -I../../src/rml/include -I../../include ../../src/tbb/tbb_main.cpp
g++ -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0501 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m32  -D__TBB_BUILD=1 -Wall  -Wno-uninitialized -Wno-parentheses    -I../../src -I../../src/rml/include -I../../include ../../src/old/concurrent_vector_v2.cpp
g++ -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0501 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m32  -D__TBB_BUILD=1 -Wall  -Wno-uninitialized -Wno-parentheses    -I../../src -I../../src/rml/include -I../../include ../../src/old/concurrent_queue_v2.cpp
g++ -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0501 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m32  -D__TBB_BUILD=1 -Wall  -Wno-uninitialized -Wno-parentheses    -I../../src -I../../src/rml/include -I../../include ../../src/old/spin_rw_mutex_v2.cpp
g++ -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0501 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m32  -D__TBB_BUILD=1 -Wall  -Wno-uninitialized -Wno-parentheses    -I../../src -I../../src/rml/include -I../../include ../../src/old/task_v2.cpp
cmd /C "....buildgenerate_tbbvars.bat"
Generating local tbbvars.bat
Generating local tbbvars.sh
Generating local tbbvars.csh
g++ -E -x c++ ../../src/tbb/lin32-tbb-export.def -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0501 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m32  -D__TBB_BUILD=1 -Wall  -Wno-uninitialized -Wno-parentheses  -I../../src -I../../src/rml/include -I../../include > tbb.def
g++  -o tbb.dll concurrent_hash_map.o concurrent_queue.o concurrent_vector.o dynamic_link.o itt_notify.o cache_aligned_allocator.o pipeline.o queuing_mutex.o queuing_rw_mutex.o reader_writer_lock.o spin_rw_mutex.o spin_mutex.o critical_section.o task.o tbb_misc.o tbb_misc_ex.o mutex.o recursive_mutex.o condition_variable.o tbb_thread.o concurrent_monitor.o private_server.o rml_tbb.o task_group_context.o governor.o market.o arena.o scheduler.o observer_proxy.o tbb_statistics.o tbb_main.o concurrent_vector_v2.o concurrent_queue_v2.o spin_rw_mutex_v2.o task_v2.o    -lpsapi -shared -Wl,--enable-auto-import -Wl,-export-all-symbols -m32  -Wl,--version-script,tbb.def
c:/mingw/bin/../lib/gcc/mingw32/4.5.2/../../../../mingw32/bin/ld.exe: task.o: warning: duplicate section `.rdata$_ZTIN3tbb4taskE[typeinfo for tbb::task]' has different size

c:/mingw/bin/../lib/gcc/mingw32/4.5.2/../../../../mingw32/bin/ld.exe: scheduler.o: warning: duplicate section `.rdata$_ZTIN3tbb4taskE[typeinfo for tbb::task]' has different size

mingw32-make[1]: Leaving directory `c:/Users/cpadwick/ipl2-workspace/tbb/tbb30_20110704oss/build/windows_ia32_gcc_mingw_release'

Hi, I just wanted to post an update on this topic in case it helps someone else.

I had been using the version of the mingw installer labelled mingw-get-inst-20110802.exe . I backed up to the version of the installer labelled mingw-get-inst-20110530.exe and now I can link against tbb.dll just fine. Our best theory that someone on the mingw side monkeyed with the 20110802 version of the installer between the time that my colleague downloaded it and I downloaded it. Our proof is that the versions of GNU Bintools (ld) don't matcheven though we installed from files that have the same name.

Note that there is a new version of mingw available that works with gcc 4.6. In this version of gcc the "-V" option to the compiler is no longer supported. I don't believe this is a problem for TBB as it doesn't follow the usual auto-conf build paradigm, but other packages that do follow this paradigm, like xerces for example, won't get past the ./configure step with the latest 4.6.

Quoting Vladimir Polin (Intel)hello, Isnon-mingw version of tbb.dll around?

[SergeyK] Do you mean'tbb.lib' or 'tbb.a'?

it looks like ld picks up non-mingw version of tbb.dll beforemingw version of tbb.dll. I do not remember exactly whether $LIB/$LD_LIBRARY_PATH/$PATH or-L should go first to linker for mingw.

hope this helps.--Vladimir

Best regards,
Sergey

Quoting cpadwickHi, I was able to check the search path for ld with this command: $ ld --verbose | grep SEARCH_DIR | tr -s ' ;' \\012SEARCH_DIR("=/usr/local/lib")SEARCH_DIR("=/lib")SEARCH_DIR("=/usr/lib")There are definitely no other copies of tbb.dll in those locations....

I simply would like to repeat that you should look for a lib-file, not adll-file.

Best regards,
Sergey

Kommentar hinterlassen

Bitte anmelden, um einen Kommentar hinzuzufügen. Sie sind noch nicht Mitglied? Jetzt teilnehmen