C
C#3mo ago
danilwaffle

✅ building nativeaot project with static library still requires library to be copied

i have tried to build nativeaot project with:
<ItemGroup>
<DirectPInvoke Include="raylib"/>
<NativeLibrary Include="raylib.lib"/>
</ItemGroup>
<ItemGroup>
<DirectPInvoke Include="raylib"/>
<NativeLibrary Include="raylib.lib"/>
</ItemGroup>
and it still requires me to copy dll file, copying makes it work, but i need single executable without any dependency libraries laying around
No description
15 Replies
danilwaffle
danilwaffleOP3mo ago
wait let me check my library again
canton7
canton73mo ago
Does "raylib.lib" actually exist?
danilwaffle
danilwaffleOP3mo ago
great i used shared library instead of static whoops
canton7
canton73mo ago
It's weird that you're trying to both dynamically link and statically link to (presumably) a .dll and a .lib of the same dependency
danilwaffle
danilwaffleOP3mo ago
hmm now i get linking errors raylib.lib(rcore.obj) : error LNK2019: unresolved external symbol timeBeginPeriod referenced in function InitTimer [D:\Users\danil\RiderProjects\ConsoleApp34\ConsoleApp34\Console App34.csproj]
danilwaffle
danilwaffleOP3mo ago
i'm not sure how to add dependency to linker
canton7
canton73mo ago
I'm going to guess <NativeLibrary >?
danilwaffle
danilwaffleOP3mo ago
LinkerArg
danilwaffle
danilwaffleOP3mo ago
oh yeah works fine now
canton7
canton73mo ago
(I've never used raylib fwiw, just googling around)
danilwaffle
danilwaffleOP3mo ago
No description
danilwaffle
danilwaffleOP3mo ago
thank you
canton7
canton73mo ago
Sweet! Glad it's working $close Bleh, looks like the bot's down. Type /close if this is solved 🙂

Did you find this page helpful?