- attached CMakeLists.txt.diff
MSVC and linking CLI against shared library
Issue #327
new
Linking the CLI against the shared libx265 library using MSVC/VS 2017 works if I edit the CMakeLists.txt file and then add the non-exported but required symbols to the .def files, which in my case are the following (do they differ on other comiler versions?):
#!
?x265_atoi@x265@@YAHPEBDAEA_N@Z
?x265_fopen@x265@@YAPEAU_iobuf@@PEBD0@Z
?x265_free@x265@@YAXPEAX@Z
?x265_malloc@x265@@YAPEAX_K@Z
?x265_mdate@x265@@YA_JXZ
?x265_picturePlaneSize@x265@@YAIHHHH@Z
?x265_report_simd@x265@@YAXPEAUx265_param@@@Z
?x265_ssim2dB@x265@@YANN@Z
?general_log@x265@@YAXPEBUx265_param@@PEBDH1ZZ
?general_log_file@x265@@YAXPEBUx265_param@@PEBDH1ZZ
?getParamAspectRatio@x265@@YAXPEAUx265_param@@AEAH1@Z
?setParamAspectRatio@x265@@YAXPEAUx265_param@@HH@Z
??1Thread@x265@@UEAA@XZ
??0Thread@x265@@QEAA@XZ
?start@Thread@x265@@QEAA_NXZ
?stop@Thread@x265@@QEAAXXZ
?g_maxCUDepth@x265@@3IA
Alternatively all symbols could be exported by default by adding set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
to the CMakeLists.txt file. In this case the .def file must be removed I think.
Anyway, I just wanted to let you know that it works, so forcing static linking on Windows targets may not be necessary.
Comments (4)
-
reporter -
reporter - marked as minor
-
reporter - attached CMakeLists.txt.diff
-
reporter - attached x265_dll_msvc.diff
Here's a different patch that involves renaming and exporting a few symbols.
- Log in to comment
this patch seems to do the trick