Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cant build libtorrent with Visual Studio 2015.Getting linking error. #181

Closed
parthibd opened this issue Sep 23, 2015 · 6 comments
Closed

Comments

@parthibd
Copy link

I am trying to build libtorrent but I am getting one link error.

Here are the steps I have followed.
1.Downloaded the latest version of libtorrent from GitHub
2.Build Boost 1.59 with the following command "b2 -j4 --toolset=msvc-14.0 address-model=32 --build-type=complete stage" with success
3.The root Boost folder is "C:\boost_1_59_0" with the built file in "stage"
4.Set BOOST_ROOT to the previous location.
5.Built OpenSSL with appropriate settings as mentioned in build doc.
6.Generate the VS2015 solution files with CMake with success.

But when I try to build the solution with Debug setting I am getting the following error.

"LNK1104 cannot open file 'libboost_date_time-vc140-mt-gd-1_59.lib'

Tried Setting the lib folder to "C:\boost_1_59_0\stage\lib" manually I got the following error

"LNK2019 unresolved external symbol _if_nametoindex@4 referenced in function __catch$?supports_ipv6@libtorrent@@YA_NXZ$0"

But here's the catch . I can build with bjam just fine.I need to get the project built inside VS because I need to generate some architectural diagram of libtorrent for my academic research purposes .

Anything I'm doing wrong ?

@arvidn
Copy link
Owner

arvidn commented Sep 24, 2015

I can't build either (on appveyor, but for a different reason, corecrt.h. patches welcome!)

if you defined BOOST_NO_LIB, you'll disable the auto-link feature boost uses (i.e. the source code won't dd linker dependencies on that library).

as for if_nametoindex, you should have a dependency on Iphlpapi.dll. it's there in the Jamfile. do you see it on the linker command line?

which version of libtorrent are you building?

@parthibd
Copy link
Author

I haven't defined BOOST_NO_LIB. I just generated the VS2015 project files
with the provided CMakeList file without any change. I don't see iphlpapi
dependency on the command line nor in the additional dependency tab in
vs2015 . Though its in the Jamfile.

The version I'm trying to build is the latest version of libtorrent master
branch. I believe it is 1.1.0. Right?

@parthibd
Copy link
Author

Update : I have solved the build issue and have a successful build. The problem was the dependency to iphlpapi was missing in the CMakeList. Also i had to manually add the path to the built boost library folder. The path to library file is c:\BOOST_ROOT\stage\lib. I don't have that much of CMake knowledge. Can you tell me how?

@arvidn
Copy link
Owner

arvidn commented Oct 4, 2015

neither do I. I use boost-build (which does have that dependency)

@correa
Copy link
Contributor

correa commented Dec 2, 2015

Just pushed a pull request #305 that fixes that.

I was having the same issues with both boost and if_nametoindex

@Falcosc
Copy link
Contributor

Falcosc commented Dec 26, 2016

can be closed

@arvidn arvidn closed this as completed Jan 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants