On 03/10/2015 22:57, Jeff Archer wrote:
I am trying to use Boost 1.59.0 with Visual Studio 2015
I believe I have built correctly the shared libraries as I have the following files in stage/lib 10/03/2015 04:48 PM 968,192 boost_regex-vc140-mt-1_59.dll 10/03/2015 04:48 PM 1,100,728 boost_regex-vc140-mt-1_59.lib 10/03/2015 03:59 PM 2,561,024 boost_regex-vc140-mt-gd-1_59.dll 10/03/2015 03:59 PM 1,103,914 boost_regex-vc140-mt-gd-1_59.lib
I am trying to build the credit_card_example from http://www.boost.org/doc/libs/1_59_0/libs/regex/example/snippets/credit_card...
I do have several static libraries in my stage/lib. Uncertain how they got there as I thought that I had only built the debug and release shared libraries. 10/03/2015 04:52 PM 395,432 libboost_chrono-vc140-mt-1_59.lib 10/03/2015 04:02 PM 2,223,204 libboost_chrono-vc140-mt-gd-1_59.lib 10/03/2015 04:48 PM 1,416 libboost_exception-vc140-mt-1_59.lib 10/03/2015 03:59 PM 29,648 libboost_exception-vc140-mt-gd-1_59.lib 10/03/2015 04:52 PM 88,934 libboost_system-vc140-mt-1_59.lib 10/03/2015 04:02 PM 660,700 libboost_system-vc140-mt-gd-1_59.lib 10/03/2015 04:52 PM 13,542,628 libboost_test_exec_monitor-vc140-mt-1_59.lib 10/03/2015 04:02 PM 42,599,796 libboost_test_exec_monitor-vc140-mt-gd-1_59.lib 10/03/2015 04:52 PM 177,682 libboost_timer-vc140-mt-1_59.lib 10/03/2015 04:02 PM 1,319,014 libboost_timer-vc140-mt-gd-1_59.lib
Compiling with BOOST_LIB_DIAGNOSTIC defined gives this output 1>------ Build started: Project: BoostRegexCreditCardExample, Configuration: Debug x64 ------ 1> BoostRegexCreditCardExample.cpp 1> Linking to lib file: libboost_regex-vc140-mt-gd-1_59.lib ========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
Building the project gives this error 1>------ Build started: Project: BoostRegexCreditCardExample, Configuration: Debug x64 ------ 1>LINK : fatal error LNK1104: cannot open file 'libboost_regex-vc140-mt-gd-1_59.lib' ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Precompiled headers is turned off.
I believe the shared libraries are built correctly because if I rename the import library to libboost_regex-vc140-mt-gd-1_59.lib the build succeeds and the boost_regex-vc140-mt-gd-1_59.dll module is shown as loaded by the debugger and the program produces the following output. C:\Dev.ja\BoostRegexCreditCardExample\x64\Debug>BoostRegexCreditCardExample.exe validate_card_format("0000111122223333") returned 0 validate_card_format("0000 1111 2222 3333") returned 1 validate_card_format("0000-1111-2222-3333") returned 1 validate_card_format("000-1111-2222-3333") returned 0 machine_readable_card_number("0000111122223333") returned 0000111122223333 machine_readable_card_number("0000 1111 2222 3333") returned 0000111122223333 machine_readable_card_number("0000-1111-2222-3333") returned 0000111122223333 machine_readable_card_number("000-1111-2222-3333") returned 000111122223333 human_readable_card_number("0000111122223333") returned 0000-1111-2222-3333 human_readable_card_number("0000 1111 2222 3333") returned 0000-1111-2222-3333 human_readable_card_number("0000-1111-2222-3333") returned 0000-1111-2222-3333 human_readable_card_number("000-1111-2222-3333") returned 000-1111-2222-3333
Therefore, I believe I have overlooked some detail in the setup of my project.
Please, can someone point out what I have failed to do correctly?
Define BOOST_ALL_DYN_LINK when building your project. HTH, John.