-
Notifications
You must be signed in to change notification settings - Fork 322
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
Unable to link with Bazel using VC++2022 #2390
Comments
I tried the latest version, does not work. |
Interesting.. I see that abort.cc is in the "hwy" target, and that we have HWY_DLLEXPORT annotations on both the declaration and definition, which are the usual causes of this. We actually ask for a DLL build in the open source version: https://github.com/google/highway/blob/master/BUILD#L139C25-L139C42 hm, I suspect DLL builds are not worth the trouble for Highway, but it's probably worse to disable them now everywhere and cause confusion for projects already using them. |
Does this need a fix in highway or can I configure build in my project? My project is a library itself so I would rather link Highway statically. |
You should be able to get a static build by setting the CMake variable HWY_FORCE_STATIC_LIBS, see Line 460 in 62c0a79
|
I'm using Bazel... I will see if I can set that flag somehow in Bazel. |
I'm getting the same issue when installing highway using I tried adding the following to my CMakeLists.txt but it didn't work.
[build] sequence.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) void __vectorcall hwy::FreeAlignedBytes(void const *,void (__vectorcall*)(void *,void *),void *)" (__imp_?FreeAlignedBytes@hwy@@YQXPEBXP6QXPEAX1@Z1@Z) referenced in function "public: void __cdecl hwy::AlignedFreer::operator()<unsigned char>(unsigned char *)const " (??$?RE@AlignedFreer@hwy@@QEBAXPEAE@Z) |
I have a project setup with Bazel, it builds fine except for VC++. VC++ complains it can't find
hwy::Abort(char const *,int,char const *,...)
:Same project compiles/links fine with GCC and Clang on Mac and Linux.
I import Highway as a Bazel module:
Dependencies:
The text was updated successfully, but these errors were encountered: