Re: [Gc] Compiling a program on WINXP using winxp

Ivan Maidanski ivmai at mail.ru
Thu Apr 8 23:37:19 PDT 2010


Fri, 9 Apr 2010 10:08:47 +0500 Yasir Majeed <leoyasir at gmail.com>:

>  I compiled gc-7.0 in the following way on my winxp

Try to use gc-7.2alpha4.tar.gz. Should work for you without a warning. 

> 
> 1) open a console window
> 2) go to the directory of the gc
> 3) copy NT_STATIC_THREADS_MAKEFILE to MAKEFILE
> 4) type vcvars32.exe; it must be in the path
> 5) type nmake nodebug=1 CFG="gc - Win32 Release"
> 
> That worked fine for me. i have also got gc.lib file now. Then i wrote a
> simple program and compiled it using mingw using following command on winxp
> 
> > gcc test.c -o test gc.lib
> 
> it gives error like that
> 
> test.c: In function `main':
> test.c:5: warning: return type of 'main' is not `int'
> test.c:13:2: warning: no newline at end of file
> Warning: .drectve `/DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"uuid.lib"
> /DEFAULTLIB:"LI
> BCMT" /DEFAULTLIB:"OLDNAMES" ' unrecognized
> Warning: .drectve `/DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"uuid.lib"
> /DEFAULTLIB:"LI
> BCMT" /DEFAULTLIB:"OLDNAMES" ' unrecognized
> Warning: .drectve `/DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"uuid.lib"
> /DEFAULTLIB:"LI
> BCMT" /DEFAULTLIB:"OLDNAMES" ' unrecognized
> Warning: .drectve `/DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"uuid.lib"
> /DEFAULTLIB:"LI
> BCMT" /DEFAULTLIB:"OLDNAMES" ' unrecognized
> Warning: .drectve `/DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"uuid.lib"
> /DEFAULTLIB:"LI
> BCMT" /DEFAULTLIB:"OLDNAMES" ' unrecognized
> Warning: .drectve `/DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"uuid.lib"
> /DEFAULTLIB:"LI
> BCMT" /DEFAULTLIB:"OLDNAMES" ' unrecognized
> Warning: .drectve `/DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"uuid.lib"
> /DEFAULTLIB:"LI
> BCMT" /DEFAULTLIB:"OLDNAMES" ' unrecognized
> Warning: .drectve `/DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"uuid.lib"
> /DEFAULTLIB:"LI
> BCMT" /DEFAULTLIB:"OLDNAMES" ' unrecognized
> Warning: .drectve `/DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"uuid.lib"
> /DEFAULTLIB:"LI
> BCMT" /DEFAULTLIB:"OLDNAMES" ' unrecognized
> Warning: .drectve `/DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"uuid.lib"
> /DEFAULTLIB:"LI
> BCMT" /DEFAULTLIB:"OLDNAMES" ' unrecognized
> Warning: .drectve `/DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"uuid.lib"
> /DEFAULTLIB:"LI
> BCMT" /DEFAULTLIB:"OLDNAMES" ' unrecognized
> Warning: .drectve `/DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"uuid.lib"
> /DEFAULTLIB:"LI
> BCMT" /DEFAULTLIB:"OLDNAMES" ' unrecognized
> Warning: .drectve `/DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"uuid.lib"
> /DEFAULTLIB:"LI
> BCMT" /DEFAULTLIB:"OLDNAMES" ' unrecognized
> Warning: .drectve `/DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"uuid.lib"
> /DEFAULTLIB:"LI
> BCMT" /DEFAULTLIB:"OLDNAMES" ' unrecognized
> Warning: .drectve `/DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"uuid.lib"
> /DEFAULTLIB:"LI
> BCMT" /DEFAULTLIB:"OLDNAMES" ' unrecognized
> Warning: .drectve `/DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"uuid.lib"
> /DEFAULTLIB:"LI
> BCMT" /DEFAULTLIB:"OLDNAMES" ' unrecognized
> Warning: .drectve `/DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"uuid.lib"
> /DEFAULTLIB:"LI
> BCMT" /DEFAULTLIB:"OLDNAMES" ' unrecognized
> Warning: .drectve `/DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"uuid.lib"
> /DEFAULTLIB:"LI
> BCMT" /DEFAULTLIB:"OLDNAMES" ' unrecognized
> gc.lib(mark.obj):(.text+
> 0x13fb): undefined reference to `_except_handler4'
> gc.lib(mark.obj):(.text+0x140d): undefined reference to `__security_cookie'
> gc.lib(win32_threads.obj):(.text+0x3f2): undefined reference to `_tls_array'
> gc.lib(win32_threads.obj):(.text+0x3f7): undefined reference to `_tls_index'
> gc.lib(win32_threads.obj):(.text+0x5c7): undefined reference to
> `__security_cook
> ie'
> gc.lib(win32_threads.obj):(.text+0x6b5): undefined reference to
> `@__security_che
> ck_cookie at 4'
> gc.lib(win32_threads.obj):(.text+0x6e6): undefined reference to
> `@__security_che
> ck_cookie at 4'
> gc.lib(win32_threads.obj):(.text+0x80b): undefined reference to
> `_except_handler
> 4'
> gc.lib(win32_threads.obj):(.text+0x81d): undefined reference to
> `__security_cook
> ie'
> gc.lib(thread_local_alloc.obj):(.text+0xe7): undefined reference to
> `_tls_array'
> 
> gc.lib(thread_local_alloc.obj):(.text+0xec): undefined reference to
> `_tls_index'
> 
> gc.lib(thread_local_alloc.obj):(.text+0x157): undefined reference to
> `_tls_index
> '
> gc.lib(thread_local_alloc.obj):(.text+0x15e): undefined reference to
> `_tls_array
> '
> gc.lib(thread_local_alloc.obj):(.text+0x211): undefined reference to
> `_tls_index
> '
> gc.lib(thread_local_alloc.obj):(.text+0x218): undefined reference to
> `_tls_array
> '
> gc.lib(misc.obj):(.text+0x627): undefined reference to `__security_cookie'
> gc.lib(misc.obj):(.text+0x656): undefined reference to
> `@__security_check_cookie
> @4'
> gc.lib(misc.obj):(.text+0x6a2): undefined reference to
> `@__security_check_cookie
> @4'
> gc.lib(misc.obj):(.text+0x78b): undefined reference to
> `@__security_check_cookie
> @4'
> gc.lib(misc.obj):(.text+0x7a7): undefined reference to `__security_cookie'
> gc.lib(misc.obj):(.text+0x880): undefined reference to
> `@__security_check_cookie
> @4'
> gc.lib(misc.obj):(.text+0x897): undefined reference to `__security_cookie'
> gc.lib(misc.obj):(.text+0x960): undefined reference to
> `@__security_check_cookie
> @4'
> gc.lib(misc.obj):(.text+0x977): undefined reference to `__security_cookie'
> gc.lib(misc.obj):(.text+0xa40): undefined reference to
> `@__security_check_cookie
> @4'
> collect2: ld returned 1 exit status
> 
> *My questions are that how this error can be solved and secondly as i want
> to use gc library and i dont want that gc source code should be fully copied
> to my project. Instead gc lib should work for me. How do i achieve that.

Just build gc.lib and copy it to your project along with:
- the required header files in the "include" folder excluding "include/private" (typically only gc.h, gc_config_macros.h, gc_cpp.h, gc_version.h are required);
- doc/README file (which also acts as a License file).

> Kindly reply me. M wating for ur response.*
> 
> 
> -- 
> Yasir Majeed
> Ph.D scholar
> Center of Research in Networks and Telecommunication (CoReNeT)
> www.corenet.org.pk
> Mohammad Ali Jinnah University Islamabad, Pakistan



More information about the Gc mailing list