Windows链接Catch2失败 #3301
Answered
by
waruqi
Extra-Creativity
asked this question in
Q&A
Windows链接Catch2失败
#3301
-
xmake.lua add_requires("catch2")
add_packages("catch2")
target("main")
set_kind("binary")
add_links("Catch2Main", "Catch2")
add_files("a.cpp") 其中a.cpp为: #include <catch2/catch_test_macros.hpp>
TEST_CASE("This is a test name", "[this is test tag]")
{
CHECK(6 * 9 == 42);
} 工具链是VS2019的默认链,生成的时候提示 |
Beta Was this translation helpful? Give feedback.
Answered by
waruqi
Jan 17, 2023
Replies: 1 comment 8 replies
-
删了,直接 add_packages 就行了
main 定义在 static lib 里,windows 需要主程序设置 ldflags 显式指定 console subsystem 。。你自己 google 找下 flags 设置下。 |
Beta Was this translation helpful? Give feedback.
8 replies
Answer selected by
Extra-Creativity
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
删了,直接 add_packages 就行了
main 定义在 static lib 里,windows 需要主程序设置 ldflags 显式指定 console subsystem 。。你自己 google 找下 flags 设置下。