Boost logo

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:

  : requirements <include>include <variant>debug:<define>NAT_DEBUG
  : build-dir bin/


use-project /loglibrary : ../3rd_party_libs/libraries/loglib ;

  : usage-requirements <include>../include

lib libnatlib
  : [ glob *.cpp ] /loglibrary//libloglib
  : <target-os>windows:<find-shared-library>wsock32


lib pthread
        : # already exists, therefore no sources
        : <target-os>windows,<toolset>msvc:<file>../pthread/msvc/pthreadVC.lib
        : <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/
    : <library>pthread

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... ..\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,

Psssst! Schon vom neuen GMX MultiMessenger gehört?
Der kann`s mit allen:

Boost-Build list run by bdawes at, david.abrahams at, gregod at, cpdaniel at, john at