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

Client linking issues with msys2 clang64 #847

Closed
tksuoran opened this issue Jul 26, 2024 · 1 comment
Closed

Client linking issues with msys2 clang64 #847

tksuoran opened this issue Jul 26, 2024 · 1 comment

Comments

@tksuoran
Copy link
Contributor

When building on Windows / msys2 clang64, I get linking errors in TracyClient:

...
[build] ld.lld: error: undefined symbol: __declspec(dllimport) WSAStartup
[build] >>> referenced by _deps/tracy-src/public/common/TracySocket.cpp:55
[build] >>>               libTracyClient.a(TracyClient.cpp.obj):(tracy::__wsinit::__wsinit())
...
[build] ld.lld: error: undefined symbol: __declspec(dllimport) SymSetOptions
[build] >>> referenced by _deps/tracy-src/public/client/TracyCallstack.cpp:158
[build] >>>               libTracyClient.a(TracyClient.cpp.obj):(tracy::InitCallstack())
...

It looks like the following in CMakeLists.txt only detects gcc, but it should probably also be used for Clang:

# Public dependency on some libraries required when using Mingw
if(WIN32 AND ${CMAKE_CXX_COMPILER_ID} MATCHES "GNU")
    target_link_libraries(TracyClient PUBLIC ws2_32 dbghelp)
endif()

I'd suggest the following:

if(WIN32 AND ${CMAKE_CXX_COMPILER_ID} MATCHES "GNU|Clang")
tksuoran added a commit to tksuoran/tracy that referenced this issue Jul 26, 2024
@wolfpld
Copy link
Owner

wolfpld commented Jul 26, 2024

Fixed by PR.

@wolfpld wolfpld closed this as completed Jul 26, 2024
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

2 participants