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

need help building windows xp #5334

Closed
bemaru opened this issue Dec 8, 2020 · 13 comments
Closed

need help building windows xp #5334

bemaru opened this issue Dec 8, 2020 · 13 comments

Comments

@bemaru
Copy link

bemaru commented Dec 8, 2020

I want to use libtorrent on windows xp. I was trying to build and an error occurred
Can libtorrent run on windows xp? I need help if possible.

Below is my situation.

  • libtorrent tag : v1.2.10
  • compile environment : windows 10, visual studio 2017
  • compiler and compiler version: MSVC 2017
  • platform toolset : Visual Studio 2017 - Windows XP (v141_xp)
  1. cmake
    cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_STANDARD=14 -G "Visual Studio 15 2017" .. -DBoost_USE_STATIC_LIBS=ON -A Win32 -B "Win32" -Dstatic_runtime=ON -Dbuild_tests=ON -Dbuild_examples=ON

  2. build client_test.exe in libtorrent.sln
    changed platform toolset : Visual Studio 2017 - Windows XP (v141_xp)
    referenced the openssl, boost dependency

  3. build was successful and it worked fine in windows 10

  4. However, I confirmed that it does not work in window xp,
    and I modified the preprocessor of torrent-rasterbar.
    I changed _WIN32_WINNT from 0x0600 to 0x0501.
    As a result, a build error occurred.

error C3861 'CancelMibChangeNotify2' identifier not found torrent-rasterbar D:\git\torrent\libtorrent_v1.2.10_xp\src\ip_notifier.cpp 368

error C3861 'NotifyUnicastIpAddressChange' identifier not found torrent-rasterbar D:\git\torrent\libtorrent_v1.2.10_xp\src\ip_notifier.cpp 368

error C2061 syntax error: identifier 'MIB_UNICASTIPADDRESS_ROW' torrent-rasterbar D:\git\torrent\libtorrent_v1.2.10_xp\src\ip_notifier.cpp 396

cf. my preprocessor of torrent-rasterbar
WIN32
_WINDOWS
NDEBUG
TORRENT_BUILDING_SHARED
BOOST_ASIO_ENABLE_CANCELIO
TORRENT_BUILDING_LIBRARY
_FILE_OFFSET_BITS=64
BOOST_EXCEPTION_DISABLE
BOOST_ASIO_HAS_STD_CHRONO
WIN32_LEAN_AND_MEAN
BOOST_ALL_NO_LIB
_SCL_SECURE_NO_DEPRECATE
_CRT_SECURE_NO_DEPRECATE
TORRENT_USE_OPENSSL
TORRENT_USE_LIBCRYPTO
TORRENT_EXPORT_EXTRA
_WIN32_WINNT=0x0501
CMAKE_INTDIR="Release"
torrent_rasterbar_EXPORTS

Additionally, the b2 build seems to be the same.
b2 toolset=msvc-14.1 cxxstd=14 variant=release link=static runtime-link=static debug-symbols=on windows-version=xp

...
compile-c-c++ bin\msvc-14.1\release\cxxstd-14-iso\debug-symbols-on\link-static\runtime-link-static\threading-multi\windows-version-xp\src\ip_notifier.obj
ip_notifier.cpp
src\ip_notifier.cpp(396): error C2061: syntax error: identifier 'MIB_UNICASTIPADDRESS_ROW'
src\ip_notifier.cpp(353): error C3861: 'NotifyUnicastIpAddressChange': identifier not found
src\ip_notifier.cpp(368): error C3861: 'CancelMibChangeNotify2': identifier not found
...
...skipped <pbin\msvc-14.1\release\cxxstd-14-iso\debug-symbols-on\link-static\runtime-link-static\threading-multi\windows-version-xp>libtorrent.lib for lack of <pbin\msvc-14.1\release\cxxstd-14-iso\debug-symbols-on\link-static\runtime-link-static\threading-multi\windows-version-xp>src\ip_notifier.obj...
...failed updating 2 targets...
...skipped 1 target...
...updated 167 targets...

@Avatat
Copy link

Avatat commented Dec 8, 2020

Why you are still on Windows XP? We shouldn't support it.

@bemaru
Copy link
Author

bemaru commented Dec 8, 2020

@Avatat
Is it official that it does not support windows xp? Is there any documentation on the OS range supported by libtorrent?
If libtorrent doesn't support windows xp, windows xp related stuff like <windows-version>xp in jamfile should be removed. These can be confusing.

@arvidn
Copy link
Owner

arvidn commented Dec 8, 2020

iirc, The work-arounds to build on XP were removed at some point in 1.2.x. I believe Vista is the oldest supported windows now.

@bemaru
Copy link
Author

bemaru commented Dec 8, 2020

@arvidn
Thanks for your help! Version 1.1.14 works well on xp.
I have to look at the differences from the latest version.

@gtumanyan
Copy link

gtumanyan commented Mar 26, 2021

@bemaru so finally, what is the latest version that supports XP?

@arvidn
Copy link
Owner

arvidn commented Mar 28, 2021

I expect you could build RC_1_2 for XP with just a small amounts of fixes to feature detections

@gtumanyan
Copy link

I do not understand how to modify WINAPI address_change_cb to support Windows XP.

@bemaru
Copy link
Author

bemaru commented Mar 31, 2021

@gtumanyan libtorrent-1_2_3 tag is the latest version that xp support maybe.

@gtumanyan
Copy link

I expect you could build RC_1_2 for XP with just a small amounts of fixes to feature detections

I've just managed to run client_test.exe 1.2.3 with a few modifications on windows XP.
May I PR a modified 1_2_3 as the latest XP-compatible branch?

@arvidn
Copy link
Owner

arvidn commented Apr 14, 2021

please do!

@gtumanyan
Copy link

Could you give me the right to create the branch or should I fork libtorrent-1_2_3 first?

@arvidn
Copy link
Owner

arvidn commented May 16, 2021

fork the repo, create your feature branch, then PR it against this repo on github.

@gtumanyan
Copy link

gtumanyan commented May 17, 2021

PR created but github wants it to be merged into the existing branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants