✅ 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
danilwaffle3w ago
wait let me check my library again
canton7
canton73w ago
Does "raylib.lib" actually exist?
danilwaffle
danilwaffle3w ago
great i used shared library instead of static whoops
canton7
canton73w 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
danilwaffle3w 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
danilwaffle3w ago
i'm not sure how to add dependency to linker
canton7
canton73w ago
I'm going to guess <NativeLibrary >?
danilwaffle
danilwaffle3w ago
LinkerArg
danilwaffle
danilwaffle3w ago
oh yeah works fine now
canton7
canton73w ago
(I've never used raylib fwiw, just googling around)
danilwaffle
danilwaffle3w ago
No description
danilwaffle
danilwaffle3w ago
thank you
canton7
canton73w ago
Sweet! Glad it's working $close Bleh, looks like the bot's down. Type /close if this is solved 🙂
Want results from more Discord servers?
Add your server