Open microsoft-sampsa opened 1 year ago
Tried also in my CMakeLists.txt:
if(WIN32)
# set(CMAKE_MSVC_RUNTIME_LIBRARY MultiThreaded)
set(CMAKE_CXX_FLAGS_RELEASE "/MT") # for static libs
set(CMAKE_CXX_FLAGS_DEBUG "/MTd")
endif(WIN32)
to no avail.
A ref here
Looking at my CMakeCache.txt
it still says:
...
//Flags used by the CXX compiler during DEBUG builds.
CMAKE_CXX_FLAGS_DEBUG:STRING=/MDd /Zi /Ob0 /Od /RTC1
...
i.e. there's that /MDd
instead of /MTd
.. (stubborn cmake)
EDIT: I'm able to force CMake to use the correct
CMAKE_CXX_FLAGS_DEBUG:STRING=/MTd /Zi /Ob0 /Od /RTC1
but I still have exactly the same problem
We do not support static linking. The .lib is an import library for the DLL.
We do not support static linking. The .lib is an import library for the DLL.
Hello, could you please tell me what and where to change when building the .lib files to build statically, without .dll. If I can not do this, why? I will be grateful for any answer.
Describe the issue
Since Windoze doesn't have a proper shared lib versioning system (i.e. some standard place in /usr/lib/whatever where different version of .so files could live), I am forced to try to link onnxruntime statically into my executable (other possibility is to keep the correct onnxruntime.dll hanging around in the same directory as the exec, but it's the same thing almost).
I am following this github issue, although some of the directories seem to have changed.
So far:
build.py
works very smoothly. Thank you for your service, sir! (see the used build command below in the "Build script" section)There, the emphasis is on:
value 'MTd_StaticDebug' doesn't match value 'MDd_DynamicDebug'
Here is an excerpt from my
CMakeLists.txt
:Urgency
No response
Target platform
windows
Build script
Error / output
Visual Studio Version
17 2022
GCC / Compiler Version
n/a