Boost Auto-Linking

This is a discussion on Boost Auto-Linking within the C++ Programming forums, part of the General Programming Boards category; I am trying to build a library using boost auto-linking, and I am getting the error "Mixing a dll boost ...

  1. #1
    Registered User Tonto's Avatar
    Join Date
    Jun 2005
    Location
    New York
    Posts
    1,465

    Boost Auto-Linking

    I am trying to build a library using boost auto-linking, and I am getting the error

    "Mixing a dll boost library with a static runtime is a really bad idea"

    Error 2 fatal error C1189: #error : "Mixing a dll boost library with a static runtime is a really bad idea..." c:\bin\boost 1.34.1\boost\config\auto_link.hpp 287

    This is created from the auto link header stating

    #if (defined(_DLL) || defined(_RTLDLL)) && defined(BOOST_DYN_LINK)
    # define BOOST_LIB_PREFIX
    #elif defined(BOOST_DYN_LINK)
    # error "Mixing a dll boost library with a static runtime is a really bad idea..."
    #else
    # define BOOST_LIB_PREFIX "lib"
    #endif

    I don't know what to do, I know there are like single threaded and multi threaded rtls but um, I don't know how to change it (visual studio orcas) or like, what I'd really like is for the boost library to link into mine statically so I don't have to lug around boost_cocks-vc80-mt-gd-1_34_1.dll or whatever

    ╔╗╔╦══╦╗╔╦══╦╗
    ║╚╝║╔╗║╚╝║╔╗║║
    ║╔╗║╠╣║╔╗║╠╣╠╣
    ╚╝╚╩╝╚╩╝╚╩╝╚╩╝

    codez http://code.google.com/p/zxcvbn/

  2. #2
    The superhaterodyne twomers's Avatar
    Join Date
    Dec 2005
    Location
    Ireland
    Posts
    2,262
    Fix:
    Code:
    //# error "Mixing a dll boost library with a static runtime is a really bad idea..."

  3. #3
    Registered User Tonto's Avatar
    Join Date
    Jun 2005
    Location
    New York
    Posts
    1,465
    If I enable the multi-threaded dll runtime library, the error goes away. Commenting was just as effective too. I now just get the error

    fatal error LNK1104: cannot open file 'boost_log-vc80-mt-1_34_1.lib' iTunesPlugIn

    This is because my library doesn't seem to be getting built. My "bjam \boost\libs\xxx" created the hierarchy

    C:\Bin\Boost 1.34.1\bin.v2\libs\log\build\msvc-8.0express\debug\link-static which contains

    libboost_log-vc80-gd-1_34_1.lib
    libboost_log-vc80-gd-1_34_1.lib.rsp

    How can I adjust the auto-linking system to link to this library, or the bjam system to create the files the auto-linker is seeking

    ╔╗╔╦══╦╗╔╦══╦╗
    ║╚╝║╔╗║╚╝║╔╗║║
    ║╔╗║╠╣║╔╗║╠╣╠╣
    ╚╝╚╩╝╚╩╝╚╩╝╚╩╝

    codez http://code.google.com/p/zxcvbn/

  4. #4
    Registered User Tonto's Avatar
    Join Date
    Jun 2005
    Location
    New York
    Posts
    1,465
    I've found certain bjam options like -sBUILD=release but I don't know what I'd do for the msvc toolkit to enable this, as it does not seem to make any difference unless I'm using mingw

    ╔╗╔╦══╦╗╔╦══╦╗
    ║╚╝║╔╗║╚╝║╔╗║║
    ║╔╗║╠╣║╔╗║╠╣╠╣
    ╚╝╚╩╝╚╩╝╚╩╝╚╩╝

    codez http://code.google.com/p/zxcvbn/

  5. #5
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,893
    twomers: Suggesting to ignore an error that says something is a "really bad idea" is a really bad idea.

    Hmm ... do you have an include trace for the original error? I.e. do you know which boost header included auto_link.hpp in this case? Boost ought to auto-link statically by default, unless you have BOOST_ALL_DYN_LINK defined in your project options.

    Also, which logging library is this? There is none in Boost 1.34, so you must have added an external one. Perhaps that's the reason the files aren't built?
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  6. #6
    The superhaterodyne twomers's Avatar
    Join Date
    Dec 2005
    Location
    Ireland
    Posts
    2,262
    >> twomers: Suggesting to ignore an error that says something is a "really bad idea" is a really bad idea.
    No way! I was kidding, you know.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 2
    Last Post: 12-12-2007, 05:45 AM
  2. building boost iostreams
    By l2u in forum C++ Programming
    Replies: 3
    Last Post: 04-14-2007, 02:29 PM
  3. Integrating Boost with STLPort
    By Mario F. in forum Tech Board
    Replies: 1
    Last Post: 11-11-2006, 05:49 AM
  4. Problems linking with g++
    By Just in forum Linux Programming
    Replies: 11
    Last Post: 07-24-2006, 01:35 AM
  5. Code: An auto expanding array (or how to use gets() safely).
    By anonytmouse in forum Windows Programming
    Replies: 0
    Last Post: 08-10-2004, 12:13 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21