[program_options] linking to specific library version requested?

Hi All, I use program_options happily. One minor annoyance is that the headers somewhere seems to specify which version of the library (the exact file name) they want to link with. I've tried setting "#define BOOST_PROGRAM_OPTIONS_NO_LIB ON" that I found by googling, but it made no difference. I always get "LINK : fatal error LNK1104: cannot open file 'libboost_program_options-vc100-mt-gd-1_44.lib'". Ideally, I'd like to link with libboost_program_options-vc100-mt-gd.lib so that when I upgrade boost I don't have to change the includes in my project files. More strangely, on one of the three computers I work with, next to the library corresponding to the newest boost version, it always requests to link to **-1_41.lib files as well, complete cleaning and rebuilding from scratch does not solve this. I have observed this with both MSVC2008 and MSVC2010. How can I configure program_options such that I can do the linking myself? Best and thanks! Dee

Diederick C. Niehorster wrote:
Hi All,
I use program_options happily. One minor annoyance is that the headers somewhere seems to specify which version of the library (the exact file name) they want to link with. I've tried setting "#define BOOST_PROGRAM_OPTIONS_NO_LIB ON" that I found by googling, but it made no difference.
I think you have somehow set that incorrectly. Setting BOOST_PROGRAM_OPTIONS_NO_LIB to 1 globally and then recompiling all modules that use program_option should disable auto-linking. If it still kicks in, it means you either have no set this define for some module, or have not rebuilt it. - Volodya

On Sat, Jun 12, 2010 at 10:09 PM, Vladimir Prus
Diederick C. Niehorster wrote:
Hi All,
I use program_options happily. One minor annoyance is that the headers somewhere seems to specify which version of the library (the exact file name) they want to link with. I've tried setting "#define BOOST_PROGRAM_OPTIONS_NO_LIB ON" that I found by googling, but it made no difference.
I think you have somehow set that incorrectly. Setting
BOOST_PROGRAM_OPTIONS_NO_LIB
to 1 globally and then recompiling all modules that use program_option should disable auto-linking. If it still kicks in, it means you either have no set this define for some module, or have not rebuilt it.
Hi Volodya, Thank you for your quick reply. Ah, you we're right. In a helpers library that I am linking in I defined a custom option parser for a datatype that I define in that file. I had to set the define there as well... That took some hunting, thanks for the info! Best, Dee
participants (2)
-
Diederick C. Niehorster
-
Vladimir Prus