|
Boost-Build : |
From: Rene Perlberg (Perle5000_at_[hidden])
Date: 2008-03-26 09:51:42
Hello everyone,
I'm trying to implement a logger into my project. This logger is precompiled as a shared library itself and furthermore uses a pthread shared library, also precompiled.
I'm trying to implement the logger in my Jamfiles as follows:
Jamroot:
project
: requirements <include>include <variant>debug:<define>NAT_DEBUG
: build-dir bin/
;
------
src/Jamfile:
use-project /loglibrary : ../3rd_party_libs/libraries/loglib ;
project
: usage-requirements <include>../include
;
lib libnatlib
: [ glob *.cpp ] /loglibrary//libloglib
: <target-os>windows:<find-shared-library>wsock32
<target-os>windows,<toolset>msvc:<def-file>libnatlib.def
:
:
;
-----
3rd_party_libs/libraries/loglib/Jamfile:
lib pthread
: # already exists, therefore no sources
: <target-os>windows,<toolset>msvc:<file>../pthread/msvc/pthreadVC.lib
<target-os>windows,<toolset>gcc:<file>../pthread/mingw/pthreadGC2.dll
:
: <target-os>windows:<include>../../includes/pthread/
;
lib libloglib
: pthread #marks dependency to pthread
: <target-os>linux:<name>loglib <search>linux/
<target-os>windows,<toolset>gcc:<name>loglib <search>windows/
<target-os>windows,<toolset>msvc:<file>windows/loglib.lib
:
: <library>pthread
<include>../../includes/LogLib/common/
<include>../../includes/LogLib/loglib/
<include>../../includes/LogLib/dll_interface/
;
Under linux, build is fine. Under windows, using msvc build also is fine. Problem is, when trying to compile with mingw gcc under windows I always get the following error message:
bjam gcc release cxxflags=-Wall
...found 72 targets...
...updating 2 targets...
gcc.link.dll ..\bin\src\gcc-mingw-3.4.5\release\libnatlib.lib
Creating library file: ..\bin\src\gcc-mingw-3.4.5\release\libnatlib.lib
..\bin\src\gcc-mingw-3.4.5\release\ConnCommon.o:ConnCommon.cpp:(.text+0x30e): undefined reference to `_imp__pthread_self'
collect2: ld returned 1 exit status
------
After trying some things, it seems to me, that using the rules <name> and <search> instead of <file> no error happens. But this leads to other problems, due to the fact that I don't really know how to write this at the moment. Anyway, I would like to know how this error can be avoided.
Thanks in advance,
René.
-- Psssst! Schon vom neuen GMX MultiMessenger gehört? Der kann`s mit allen: http://www.gmx.net/de/go/multimessenger
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