Fatal Error LNK1104: cannot open file

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Fatal Error LNK1104: cannot open file

Boost - Users mailing list
I posted this issue originally on the boost list, largely to inform that I have been able to compile boost_1_71_0_b1_rc1 using VS 2019.
See that post here:

I moved this post here because I think my subsequent problem has to do with setting up Visual Studio 2019.

I have followed the Getting Started in Windows tutorial and was able to build the  simple program, aka the header only project, in VS.  It compiled and ran fine. I then built the project that links your program to the Boost Library described in the tutorial.  I received the following message when I compiled as x64.

1>LINK : fatal error LNK1104: cannot open file 'libboost_regex-vc142-mt-gd-x64-1_71.lib'

As you can see in my original email post referred to above, I built another simple program based upon a youtube video and on VS2017 and while it compiled in the youtube video, I received a the same linker error, LNK1104 message as well.

Since the file referred toin the LNK1104 error  has the prefix lib, it appears that VS is looking for a static library.  I built boost as shared from the Develop command line using the command.

.\bj2 link=shared .  

This method apparently worked in VS2017 but I can not replicate it in VS2019.

What am I missing?



_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|

Re: Fatal Error LNK1104: cannot open file

Boost - Users mailing list
On 30/07/2019 05:11, Cg K wrote:

> 1>LINK : fatal error LNK1104: cannot open file
> 'libboost_regex-vc142-mt-gd-x64-1_71.lib'
>
> As you can see in my original email post referred to above, I built
> another simple program based upon a youtube video and on VS2017 and
> while it compiled in the youtube video, I received a the same linker
> error, LNK1104 message as well.
>
> Since the file referred toin the LNK1104 error  has the prefix lib, it
> appears that VS is looking for a static library.  I built boost as
> shared from the Develop command line using the command.
>
> .\bj2 link=shared .

If you're only building the shared libraries, you need to define
BOOST_ALL_DYN_LINK when building your application (or any other of your
libraries that uses Boost).
_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|

Re: Fatal Error LNK1104: cannot open file

Boost - Users mailing list
Thank you!
#define BOOST_ALL_DYN_LINK
did the trick!



On Mon, Jul 29, 2019 at 7:59 PM Gavin Lambert via Boost-users <[hidden email]> wrote:
On 30/07/2019 05:11, Cg K wrote:
> 1>LINK : fatal error LNK1104: cannot open file
> 'libboost_regex-vc142-mt-gd-x64-1_71.lib'
>
> As you can see in my original email post referred to above, I built
> another simple program based upon a youtube video and on VS2017 and
> while it compiled in the youtube video, I received a the same linker
> error, LNK1104 message as well.
>
> Since the file referred toin the LNK1104 error  has the prefix lib, it
> appears that VS is looking for a static library.  I built boost as
> shared from the Develop command line using the command.
>
> .\bj2 link=shared .

If you're only building the shared libraries, you need to define
BOOST_ALL_DYN_LINK when building your application (or any other of your
libraries that uses Boost).
_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users

_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users