4/15/2023 0 Comments Cmake include directories![]() ![]() Ker /MANIFEST:EMBED -Xlinker /implib:Debug/testapp.lib -Xlinker /pdb:Debug/testapp.pdb -Xlinker /version:0.0 -L"/mnt/c/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/ : & /usr/bin/clang++ -target=x86_64-pc-windows-msvc -fuse-ld=lld-link -nostartfiles -nostdlib -O0 -D_DEBUG -D_DLL -D_MT -Xclang -dependent-lib=msvcrtd -g -Xclang -gcodeview -Xlinker /suīsystem:console -Wall -Wextra -fno-omit-frame-pointer -fno-sanitize-recover=all -fsanitize=address,undefined CMakeFiles/testapp.dir/Debug/src/ -o Debug/testapp.exe -Xlin ![]() However when I try to use -fsanitize=address,undefined it fails. B build_windows -G 'Ninja Multi-Config' -DCMAKE_TOOLCHAIN_FILE='cmake/toolchains_windows.cmake'Ĭmake -build build_windows -v -config Release Now it can compile hello world program! cmake -S. So I added this code to the cmake/toolchains_windows.cmake include_directories( I thought providing these paths to CMAKE_FIND_ROOT_PATH handles finding libs/headers but it didn't. Lld-link: error: could not open 'msvcrtd.lib': No such file or directory Lld-link: error: could not open 'oldnames.lib': No such file or directory Lld-link: error: could not open 'advapi32.lib': No such file or directory Lld-link: error: could not open 'comdlg32.lib': No such file or directory Lld-link: error: could not open 'uuid.lib': No such file or directory Lld-link: error: could not open 'oleaut32.lib': No such file or directory Lld-link: error: could not open 'ole32.lib': No such file or directory Lld-link: error: could not open 'shell32.lib': No such file or directory Lld-link: error: could not open 'winspool.lib': No such file or directory Lld-link: error: could not open 'gdi32.lib': No such file or directory Lld-link: error: could not open 'user32.lib': No such file or directory Lld-link: error: could not open 'kernel32.lib': No such file or directory ĬMake Error at /usr/share/cmake/Modules/CMakeTestCXXCompiler.cmake:63 (message): However this configuraion fails to find libraries. ![]() B build_windows -G 'Ninja Multi-Config' -DCMAKE_TOOLCHAIN_FILE='cmake/toolchains_windows.cmake' Set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)Ĭmake -S. Set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) # search headers and libraries in the target environment Set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) # search programs in the host environment # adjust the default behavior of the FIND_XXX() commands: "/mnt/c/Program Files (x86)/Windows Kits/10/Include/0.0/ucrt" "/mnt/c/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/3/include" "/mnt/c/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/3/lib/圆4" # where is the target environment located Set(CMAKE_CXX_COMPILER_TARGET x86_64-pc-windows-msvc) Set(CMAKE_C_COMPILER_TARGET x86_64-pc-windows-msvc) I'm tring to compile windows binary from WSL2 using clang and llvm using this cmake file:ĬMakeLists.txt cmake_minimum_required(VERSION 3.25)Īdd_executable($)Ĭmake/toolchians_windows.cmake # set target operating to windows ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |