You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue was encountered while porting Ladybird to Windows. Ladybird discord discussions: onetwo.
If data item (global or class static variable) is imported, lld-link refuses to link it unless __declspec(dllimport) is specified. Functions (global and member functions) don't have this problem. See also: WINDOWS_EXPORT_ALL_SYMBOLS in CMake.
I don't know if it is a bug or a feature, I could not find a similar issue. Does lld-link intentionally behave like Visual Studio link.exe here? It would be great if it behaved like on Linux instead. This is just confusing.
Simplified reproduction:
mylib.h:
structA
{
staticint static_member; // errorvoidmember_function(); // OK
};
externint global; // errorvoidglobal_function(); // OK
mylib.cpp:
#include"mylib.h"int global;
int A::static_member;
voidglobal_function()
{
}
voidA::member_function()
{
}
lld-link: error: undefined symbol: int global
>>> referenced by myprog.o:(main)
lld-link: error: undefined symbol: public: static int A::static_member
>>> referenced by myprog.o:(main)
clang/lld-link version: 19.1.0.
This issue was encountered while porting Ladybird to Windows. Ladybird discord discussions: one two.
If data item (global or class static variable) is imported, lld-link refuses to link it unless
__declspec(dllimport)
is specified. Functions (global and member functions) don't have this problem. See also: WINDOWS_EXPORT_ALL_SYMBOLS in CMake.I don't know if it is a bug or a feature, I could not find a similar issue. Does lld-link intentionally behave like Visual Studio link.exe here? It would be great if it behaved like on Linux instead. This is just confusing.
Simplified reproduction:
mylib.h:
mylib.cpp:
myprog.cpp:
build.bat:
The last command fails with these errors:
The def/lib/dll export all 4 symbols:
The text was updated successfully, but these errors were encountered: