0

I have an issue with compiling Boost using VC: error: LNK1104: cannot open file 'libboost_regex-vc100-mt-gd-1_53.lib'

The most interesting is that issue is observed only using VC10 compiler. MinGW builds successfully Boost regex.

Does anybody know how to fix it ?

PS: I cannot use b2, bjam and etc., because I have retrieved part of boost regex using bcp module, and I need to compile it using VC10 and CMake.

Denis Kotov
  • 857
  • 2
  • 10
  • 29
  • Boost never supported the build of CMake. – usr1234567 Dec 12 '16 at 14:00
  • @ usr1234567: Boost does not support build by CMake, but I have separated a regex by **bcp** module and compiled this module successfully by **MinGW**. – Denis Kotov Dec 12 '16 at 15:47
  • I don't understand. You have modified Boost, now it does not work, and we should help, without knowing your modifications? – usr1234567 Dec 12 '16 at 16:04
  • instead of rebuild boost by yourself, why not to take an [official prebuilt binaries](https://sourceforge.net/projects/boost/files/boost-binaries/1.53.0/)? – zaufi Dec 12 '16 at 19:35
  • @usr1234567: No, I have not modify Boost. I've just retrieved the part of Boost regex and integrated it in my project. For motre information see http://www.boost.org/doc/libs/1_62_0/tools/bcp/doc/html/index.html – Denis Kotov Dec 13 '16 at 06:13
  • @zaufi: Because I test my code on Windows, but after it should work on Linux system. And I do not want to depend on prebuilt binaries. I just want that little part of Boost be builded and it works with MinGW compiler, but when I try to use VC10 due to some dependency on flags and so on it tries to find 'libboost_regex-vc100-mt-gd-1_53.lib' – Denis Kotov Dec 13 '16 at 06:20
  • @ДенисКотов, I guess your target Linux distro have boost packages, so why to to use them? Just make a native package of your software and add dependency on required boost packages (`libboost-regex` I guess)... – zaufi Dec 13 '16 at 09:14
  • 1
    If you are using CMake just use boost finder it provides. It is quite flexible and cross-platform and would find boost installation everywhere. Also CPack could helps you to make a native package of your software. – zaufi Dec 13 '16 at 09:17
  • I have found solution something like this -DBOOST_ALL_NO_LIB, but it does not work. I do not understand why only VC10 compiler tries to find this library ('libboost_regex-vc100-mt-gd-1_53.lib') as at the same time MinGW compiles all properly. Maybe some special flags I need to set ? – Denis Kotov Dec 13 '16 at 10:27

1 Answers1

0

I have fixed an issue. Just added at the top level CMakeLists.txt file: add_definitions( -DBOOST_ALL_NO_LIB )

Thanks, all who participate in helping me.

Denis Kotov
  • 857
  • 2
  • 10
  • 29