Boost logo

Boost-Build :

Subject: [Boost-build] compiling ftgl with boost.jam-3.1.18 on windows / undefined reference to
From: mds_maillists_at_[hidden]
Date: 2010-09-03 06:20:22


Hi all,

some weeks ago I could compile the ftgl library with MingW/gcc 4.4.0 on windowsXP using the eclipse IDE.
Short
after this success I decided to do it also with bjam to automate the compilation.

Now I searched a lot of forums and
mailing lists but I couldn't found a solution for me.

First, my jamroot:

import os ;
local BOOST_ROOT = [ os.environ
BOOST_ROOT ] ;
local FREETYPE = [ os.environ FREETYPE ] ;

#
# define the library dependencies
#
  lib freetype6 : :
<name>freetype6 <search>$(FREETYPE)/bin ;
  lib glu32 : : <name>glu32 <search>c:/WINDOWS/system32 ;
  lib opengl32 : :
<name>opengl32 <search>c:/windows/system32 ;

#
# now compile the new library
#
  lib libftgl : src/FTGL.cpp glu32
opengl32 freetype6
              : <include>"./src"
                <include>$(FREETYPE)/include
                <include>$(FREETYPE)
/include/freetype2
              : <define>"WIN32"
                <define>"__cplusplus"
                <define>"_MINGW"
                <define>"
FTGL_LIBRARY"
                <link>"shared"
                <variant>debug <optimization>off ;

Than I get a lot of erors like "undefined
reference to ..." see below:

...found 47 targets...
...updating 2 targets...
gcc.link.dll bin\gcc-mingw-4.4.0
\debug\libftgl.lib
Creating library file: bin\gcc-mingw-4.4.0\debug\libftgl.libc:/mingw/bin/../lib/gcc/mingw32/4.4.0
/crtbegin.o:cygming-crtbegin.c:(.text+0xe): undefined reference to `GetModuleHandleA_at_4'
c:/mingw/bin/..
/lib/gcc/mingw32/4.4.0/crtbegin.o:cygming-crtbegin.c:(.text+0x23): undefined reference to `GetProcAddress_at_8'
c:
/mingw/bin/../lib/gcc/mingw32/4.4.0/crtbegin.o:cygming-crtbegin.c:(.text+0x51): undefined reference to
`GetModuleHandleA_at_4'
c:/mingw/bin/../lib/gcc/mingw32/4.4.0/crtbegin.o:cygming-crtbegin.c:(.text+0x66): undefined
reference to `GetProcAddress_at_8'
c:/mingw/bin/../lib/gcc/mingw32/4.4.0/crtbegin.o:cygming-crtbegin.c:(.text+0x9a):
undefined reference to `GetModuleHandleA_at_4'
c:/mingw/bin/../lib/gcc/mingw32/4.4.0/crtbegin.o:cygming-crtbegin.c:(.
text+0xaf): undefined reference to `GetProcAddress_at_8'
c:/mingw/bin/../lib/gcc/mingw32/4.4.0/libgcc.a(gthr-win32.o): In
function `_gthr_win32_recursive_mutex_unlock':
C:\MinGW\src\gccbf\mingw32\libgcc/../../../gcc-4.4.0/libgcc/..
/gcc/config/i386/gthr-win32.c:255: undefined reference to `InterlockedDecrement_at_4'
C:\MinGW\src\gccbf\mingw32\libgcc/..
/../../gcc-4.4.0/libgcc/../gcc/config/i386/gthr-win32.c:256: undefined reference to `ReleaseSemaphore_at_12'
c:
/mingw/bin/../lib/gcc/mingw32/4.4.0/libgcc.a(gthr-win32.o): In function `_gthr_win32_mutex_unlock':
C:
\MinGW\src\gccbf\mingw32\libgcc/../../../gcc-4.4.0/libgcc/../gcc/config/i386/gthr-win32.c:186: undefined reference to
`InterlockedDecrement_at_4'
C:\MinGW\src\gccbf\mingw32\libgcc/../../../gcc-4.4.0/libgcc/../gcc/config/i386/gthr-win32.c:
187: undefined reference to `ReleaseSemaphore_at_12'
c:/mingw/bin/../lib/gcc/mingw32/4.4.0/libgcc.a(gthr-win32.o): In
function `_gthr_win32_recursive_mutex_trylock':
C:\MinGW\src\gccbf\mingw32\libgcc/../../../gcc-4.4.0/libgcc/..
/gcc/config/i386/gthr-win32.c:233: undefined reference to `GetCurrentThreadId_at_0'
c:/mingw/bin/../lib/gcc/mingw32/4.4.0
/libgcc.a(gthr-win32.o): In function `_gthr_win32_recursive_mutex_lock':

and much more .. at the end, I can read this:

collect2: ld returned 1 exit status

    "g++" -L"C:\Program Files\freetype-2.3.5-1-bin\bin" -L"c:\WINDOWS\system32" -L"
c:\windows\system32" "-Wl,--out-implib,bin\gcc-mingw-4.4.0\debug\libftgl.lib" -o "bin\gcc-mingw-4.4.0\debug\libftgl.
dll" -shared -Wl,--start-group "bin\gcc-mingw-4.4.0\debug\FTGL.o" -Wl,-Bstatic -Wl,-Bdynamic -lopengl32 -lglu32 -
lfreetype6 -Wl,--end-group -g

...failed gcc.link.dll bin\gcc-mingw-4.4.0\debug\libftgl.lib bin\gcc-mingw-4.4.0
\debug\libftgl.dll...
...removing bin\gcc-mingw-4.4.0\debug\libftgl.lib
...failed updating 2 targets...

and the things
like "--start-group" or "-Wl,-Bstatic" and so on is not used in the eclipseIDE. So I think that one of this arguments
causes the problem.

My question is, how can I turn off this arguments? I couldn't found somewhere some usefull tips.

Thanks for any help

regards

Michael


Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk