Re: [Gc] gcc-4.6 with gc-cvs = 'GC_CreateThread' was not declared in this scope

Ivan Maidanski ivmai at mail.ru
Fri Aug 13 21:23:37 PDT 2010


Hello, Dima!

1. GC_CreateThread proto has not been changed in v7.

2. compile win32-threads.cc with -E and examine the preprocessor output to see where GC_CreateThread is declared.

3. typically it's better to use _beginthreadex instead of CreateThread on Win32.

4. GC_NOT_DLL is now meaningful only for MS Visual Studio (not mingw).

Regards.

Fri, 13 Aug 2010 00:44:11 +0300 Dmitrijs Ledkovs <dmitrij.ledkov at ubuntu.com>:

> 
> I'm working on getting gcc-4.6 to work with cvs boehm-gc.
> 
> I'm using build/host=linux-gnu and target=i686-w64-mingw32.
> 
> Most of the things in the port were semi-obvious:
> (configury, GC_PTR -> void *, etc)
> 
> But now I'm stuck here:
> 
> libtool: compile:  /home/tdlk/src/mingw-w64/superv32/i686-w64-mingw32/gcc/./gcc/xgcc -shared-libgcc -B/home/tdlk/src/mingw-w64/superv32/i686-w64-mingw32/gcc/./gcc -nostdinc++ -L/home/tdlk/src/mingw-w64/superv32/i686-w64-mingw32/gcc/i686-w64-mingw32/libstdc++-v3/src -L/home/tdlk/src/mingw-w64/superv32/i686-w64-mingw32/gcc/i686-w64-mingw32/libstdc++-v3/src/.libs -L/home/tdlk/src/mingw-w64/superv32/i686-w64-mingw32/root/usr/i686-w64-mingw32/lib -L/home/tdlk/src/mingw-w64/superv32/i686-w64-mingw32/root/usr/mingw/lib -isystem /home/tdlk/src/mingw-w64/superv32/i686-w64-mingw32/root/usr/i686-w64-mingw32/include -isystem /home/tdlk/src/mingw-w64/superv32/i686-w64-mingw32/root/usr/mingw/include -B/home/tdlk/src/mingw-w64/superv32/i686-w64-mingw32/root/usr/i686-w64-mingw32/bin/ -B/home/tdlk/src/mingw-w64/superv32/i686-w64-mingw32/root/usr/i686-w64-mingw32/lib/ -isystem /home/tdlk/src/mingw-w64/superv32/i686-w64-mingw32/root/usr/i686-w64-mingw32/include -isystem /home/tdlk/src/mingw-!
w6!
> 4/superv32/i686-w64-mingw32/root/usr/i686-w64-mingw32/sys-include -DHAVE_CONFIG_H -I. -I/home/tdlk/src/mingw-w64/superv32/gcc/libjava -I./include -I./gcj -I/home/tdlk/src/mingw-w64/superv32/gcc/libjava -Iinclude -I/home/tdlk/src/mingw-w64/superv32/gcc/libjava/include -I/home/tdlk/src/mingw-w64/superv32/gcc/libjava/classpath/include -Iclasspath/include -I/home/tdlk/src/mingw-w64/superv32/gcc/libjava/classpath/native/fdlibm -I/home/tdlk/src/mingw-w64/superv32/gcc/libjava/../boehm-gc/include -I../boehm-gc/include -I/home/tdlk/src/mingw-w64/superv32/gcc/libjava/libltdl -I/home/tdlk/src/mingw-w64/superv32/gcc/libjava/libltdl -I/home/tdlk/src/mingw-w64/superv32/gcc/libjava/.././libjava/../gcc -I/home/tdlk/src/mingw-w64/superv32/gcc/libjava/../zlib -I/home/tdlk/src/mingw-w64/superv32/gcc/libjava/../libffi/include -I../libffi/include -fno-rtti -fnon-call-exceptions -mthreads -fdollars-in-identifiers -Wswitch-enum -D_FILE_OFFSET_BITS=64 -ffloat-store -fomit-frame-pointer -Usun -fno!
-o!
> mit-frame-pointer -Wextra -Wall -D_GNU_SOURCE -DPREFIX=\"/hom!
> e/tdlk/src/mingw-w64/superv32/i686-w64-mingw32/root/usr\" -DTOOLEXECLIBDIR=\"/home/tdlk/src/mingw-w64/superv32/i686-w64-mingw32/root/usr/lib/gcc/i686-w64-mingw32/4.6.0\" -DJAVA_HOME=\"/home/tdlk/src/mingw-w64/superv32/i686-w64-mingw32/root/usr\" -DBOOT_CLASS_PATH=\"/home/tdlk/src/mingw-w64/superv32/i686-w64-mingw32/root/usr/share/java/libgcj-4.6.0.jar\" -DJAVA_EXT_DIRS=\"/home/tdlk/src/mingw-w64/superv32/i686-w64-mingw32/root/usr/share/java/ext\" -DGCJ_ENDORSED_DIRS=\"/home/tdlk/src/mingw-w64/superv32/i686-w64-mingw32/root/usr/share/java/gcj-endorsed\" -DGCJ_VERSIONED_LIBDIR=\"/home/tdlk/src/mingw-w64/superv32/i686-w64-mingw32/root/usr/lib/../lib/gcj-4.6.0-12\" -DPATH_SEPARATOR=\":\" -DECJ_JAR_FILE=\"/usr/share/java/eclipse-ecj.jar\" -DLIBGCJ_DEFAULT_DATABASE=\"/home/tdlk/src/mingw-w64/superv32/i686-w64-mingw32/root/usr/lib/../lib/gcj-4.6.0-12/classmap.db\" -DLIBGCJ_DEFAULT_DATABASE_PATH_TAIL=\"gcj-4.6.0-12/classmap.db\" -g -O2 -DGC_NOT_DLL -Wl,--enable-runtime-pseudo-relo!
c,!
> --no-undefined -MT win32-threads.lo -MD -MP -MF .deps/win32-threads.Tpo -c /home/tdlk/src/mingw-w64/superv32/gcc/libjava/win32-threads.cc -o win32-threads.o
> /home/tdlk/src/mingw-w64/superv32/gcc/libjava/win32-threads.cc: In function 'void _Jv_ThreadStart(java::lang::Thread*, _Jv_Thread_t*, void (*)(java::lang::Thread*))':
> /home/tdlk/src/mingw-w64/superv32/gcc/libjava/win32-threads.cc:393:69: error: 'GC_CreateThread' was not declared in this scope
> make[4]: *** [win32-threads.lo] Error 1
> 
> The function in question is:
> 
> <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
> void
> _Jv_ThreadStart (java::lang::Thread *thread, _Jv_Thread_t *data, _Jv_ThreadStartFunc *meth)
> {
> ...
>   data->handle = GC_CreateThread(NULL, 0, really_start, info, 0, &id);
>   _Jv_ThreadSetPriority(data, thread->getPriority());
> }
> <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
> 
> I really cannot figure out what is causing "not declared in this scope"
> error. How did GC_CreateThread changed since 6.6..... or are there
> particular additional precautions I should make when targeting mingw32?
> 
> Please help =)
> 
> Regards,
> Dima.


More information about the Gc mailing list