C
C#2mo 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
danilwaffleOP2mo ago
wait let me check my library again
canton7
canton72mo ago
Does "raylib.lib" actually exist?
danilwaffle
danilwaffleOP2mo ago
great i used shared library instead of static whoops
canton7
canton72mo 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
danilwaffleOP2mo 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
danilwaffleOP2mo ago
i'm not sure how to add dependency to linker
canton7
canton72mo ago
I'm going to guess <NativeLibrary >?
danilwaffle
danilwaffleOP2mo ago
LinkerArg
danilwaffle
danilwaffleOP2mo ago
oh yeah works fine now
canton7
canton72mo ago
(I've never used raylib fwiw, just googling around)
danilwaffle
danilwaffleOP2mo ago
No description
danilwaffle
danilwaffleOP2mo ago
thank you
canton7
canton72mo 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