[CMake] dll build error, possible bug

Alexander Neundorf a.neundorf-work at gmx.net
Tue Jan 18 16:45:16 EST 2011


On Wednesday 05 January 2011, andtsk at sibmail.com wrote:
> Dear all,
>
> I working on windows and use "Cmake 2.8" + "MinGw"
>
> I am try to build .dll from "pthreads-win32" sources
> (http://sourceware.org/pthreads-win32/)
>
>
> by writing CMakeLists.txt (attached) and putting them to src directory
> he creates makefile i run it, and after invoking of command:
>
> gcc    -shared -o libpthreadGC2.dll -Wl,--out-implib,libpthreadGC2.dll.a
> -Wl,--major-image-version,0,--minor-image-version,0 -Wl, at CMak
> eFiles\pthreadGC2.dir\objects1.rsp -lkernel32 -luser32 -lgdi32 -lwinspool
> -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32
>
> and i got many errors "...indefined reference..." (attached)
>
> But when i  run "mingw32-make clean GC" hes invoking command is:
>
> gcc -D__CLEANUP_C -O3 -finline-functions -shared -o pthreadGC2.dll attr.o
> barrier.o cancel.o cleanup.o condvar.o create.o dll.o errno.o exit.o
> fork.o global.o m
> isc.o mutex.o nonportable.o private.o rwlock.o sched.o semaphore.o
> signal.o spin.o sync.o tsd.o version.o
> ...
> and .dll builds

Maybe some other defines have to be set ?
I'd suggest you compare the compile and link commands you get from cmake with 
the ones which are used by pthreads-win32's native build or project files.

Alex


More information about the CMake mailing list