Leonardo Weiss Chaves wrote: > I am still not able to compile any kind of pthreads with cegcc/mingw32ce. > > I did some smaller modifications to the source of mingw32e and to > pthread-w32-2.8.0, and it almost compiles. But at the end I get lots of > undefined references. This is strange, since the compiler flag "-DWINCE" > should take care of this, for instance by using the errno hack you mentioned. > > I commented the following lines out on mingw32Ce files: > errno.h 12,13,14,109 > signal.h 12 > process.h 99,102 >
You shouldn't do this. That include_next is there to make it as if the files didn't exist. Either provide your own versions of these files in the include path (-I), so the include_next picks them up, or don't include them in the first place: #ifndef _WIN32_WCE #include <errno.h> #endif or, #ifdef HAVE_ERRNO_H #include <errno.h> #endif or similar. > arm-wince-mingw32ce-g++ -DWINCE -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 misc.o mutex.o nonportable.o private.o > rwlock.o sched.o semaphore.o signal.o spin.o sync.o tsd.o version.o I don't see any libs being linked in here? Where is the -lws2 ? > condvar.o:condvar.c:(.text+0x184): undefined reference to `errno' > condvar.o:condvar.c:(.text+0x25c): undefined reference to `errno' > condvar.o:condvar.c:(.text+0x400): undefined reference to `errno' > condvar.o:condvar.c:(.text+0x5a0): undefined reference to `errno' > condvar.o:condvar.c:(.text+0x6f0): undefined reference to `errno' > condvar.o:condvar.c:(.text+0x848): more undefined references to `errno' follow > create.o:create.c:(.text+0x108): undefined reference to `_beginthread' > exit.o:exit.c:(.text+0x2c): undefined reference to `_endthread' > misc.o:misc.c:(.text+0x224): undefined reference to `ptw32_mcs_lock_acquire' > misc.o:misc.c:(.text+0x244): undefined reference to `ptw32_mcs_lock_release' > misc.o:misc.c:(.text+0x274): undefined reference to `ptw32_mcs_lock_release' > mutex.o:mutex.c:(.text+0x3c8): undefined reference to `ptw32_relmillisecs' > mutex.o:mutex.c:(.text+0x550): undefined reference to `ptw32_relmillisecs' > private.o:private.c:(.text+0xe4): undefined reference to `errno' > private.o:private.c:(.text+0x2b8): undefined reference to `_endthread' > private.o:private.c:(.text+0x4d4): undefined reference to `_endthread' > sched.o:sched.c:(.text+0x1c): undefined reference to `errno' > sched.o:sched.c:(.text+0x3c): undefined reference to `errno' > sched.o:sched.c:(.text+0xb4): undefined reference to `errno' > sched.o:sched.c:(.text+0x130): undefined reference to `errno' > semaphore.o:semaphore.c:(.text+0x14): undefined reference to `errno' > semaphore.o:semaphore.c:(.text+0x2c): more undefined references to `errno' > follow > semaphore.o:semaphore.c:(.text+0x32c): undefined reference to > `ptw32_relmillisecs' > semaphore.o:semaphore.c:(.text+0x3ec): undefined reference to `errno' > semaphore.o:semaphore.c:(.text+0x550): undefined reference to `errno' > semaphore.o:semaphore.c:(.text+0x61c): undefined reference to `errno' > semaphore.o:semaphore.c:(.text+0x6d4): undefined reference to `errno' Looks like you are missing some .o's in the link command line. Try to find where the 'int errno' is defined as opposed to just declared (extern int errno). Same for _beginthread/_endthread, they should be defined somewhere in the pthreads WinCE port, as WinCE doesn't provide those. > tsd.o:tsd.c:(.text+0x18): undefined reference to `WSAGetLastError' > tsd.o:tsd.c:(.text+0x38): undefined reference to `WSASetLastError' These come from ws2.dll, but you don't have it in the command line... (-lws2) Cheers, Pedro Alves ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Cegcc-devel mailing list Cegcc-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/cegcc-devel