-1

I try to use C++-CLI in Visual Studio 2013 to create a GUI. My project use a C++ lib this lib use Boost Filesystem and Serialisation libraries, but I get the following linker error:

visual c++ error lnk1104 cannot open file 'boost_serialization-vc120-mt-gd-1_56.lib'

When I comment the include of serialisation header I get the same error for the filesystem lib.

When I comment both include lines I get no error with (so the the other boost libs work)

Naseef Chowdhury
  • 2,357
  • 3
  • 28
  • 52
  • I'm not sure what you're saying the problem is: that it shouldn't need that lib? Do you have that lib, and have you told Visual Studio where to find it? – Rup May 19 '15 at 08:41
  • "when i comment the both ligne i've no error with the others boost lib" — either there's a typo in there, or that means the problem went away already. – Potatoswatter May 19 '15 at 08:42
  • To be honest it looks like this is completely unrelated to C++-CLI /cc @PaulR – sehe May 19 '15 at 08:51
  • @sehe: sorry - I thought Managed C++ was CLI ? I'm not that familiar with the Microsoft world though - I'll delete the tag. – Paul R May 19 '15 at 08:52
  • @PaulR It is. But the error is unrelated to that, AFAICT (I just CC-ed you) – sehe May 19 '15 at 08:53
  • Oh I see - no problem either way - I am happy to defer to you on this as I don't have a lot of exposure to Windows etc. – Paul R May 19 '15 at 08:54
  • @Potatoswatte no typo there i've create un other c++/cli project and i've created un other lib with just the boost header(include) on the 10 included header only the filesystem and serialisation trow that error – gregory boero.teyssier May 19 '15 at 12:34
  • @NaseefUrRahman the problem is not solved, but i don't have much time to spend on that project – gregory boero.teyssier May 20 '15 at 11:51

1 Answers1

3

I think the problem is straightforward. Do you have provided input library boost_serialization-vc120-mt-gd-1_56.lib in the Linker->Input->Additional Dependencies option. You need to put your lib in there. Please make sure. You can get help from the following snap shot - enter image description here

The snap shot above will help you to find the option from Visual Studio. Just go to project properties then you will see something like this. Go to Linker->Input and provide the required libs in Additional Dependencies. Then you are done.

EDIT: As Sehe mentioned lib inputs are automatically handled by boost using #pragma lib. If you are using this, you just need to set the Library Directories. Library Directories can be set by going to Project Properties. If you go to Project Property you will find a tab named VC++ Directories and if you click on the tab you will find Library Directories option along with other directory options. The following figure may help you on this - enter image description here

You just need to put the library directory of the boost library there.

Naseef Chowdhury
  • 2,357
  • 3
  • 28
  • 52