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

When building SAIL as dynamic library with VCPKG it is built as a static library #214

Open
Murk42 opened this issue Aug 14, 2024 · 1 comment

Comments

@Murk42
Copy link

Murk42 commented Aug 14, 2024

I'm using Visual Studio with its VCPKG integration in manifest mode.
In the project properties "Configuration Properties/vcpkg/Use Static Libraries" is set to "No".
With this setup I get a linker error like:
error LNK2019: unresolved external symbol __imp_sail_init referenced in function "struct Blaze::TimingResult __cdecl Blaze::InitializeSail(void)" (?InitializeSail@Blaze@@YA?AUTimingResult@1@XZ)

With a quick google search I found out "__impl" prefix is added to a function when it is searched for from a DLL. But because it couldn't link I realized that SAIL was built as a static library.

For a quick fix I added SAIL_STATIC before my include and manually included SAIL .lib files in the project properties and everything compiled right.

The thing I don't understand is why are SAILL .dll files still generated, if the .lib file is a static library?

@HappySeaFox
Copy link
Owner

Hi! It might be a vcpkg feature as SAIL generates just the files you ask to generate. In dynamic mode it generates dll+small lib files, in static mode it generates just large lib files. Make sure you use the right vcpkg triplet as well (vcpkg install --triplet x64-windows-static for example). I've never used the vcpkg manifest mode so I may not be immediately ready to test it locally. It would be great if you create a small standalone project just to reproduce the issue and attach it here.

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