#want to run debug build with dynamic linking

11 messages · Page 1 of 1 (latest)

jagged temple
#

i want to build a debug build with dynamic linking, and then run it using something else (NOT cargo run)
but this doesn't work because it builds bevy_dylib.dll but the program is trying to find bevy_dylib-somehash123.dll (as in pic)

any way to fix this so it can be run just by launching the .exe?
Windows, bevy 0.15

wind scaffold
#

There are two directories you will need to add to your LD_LIBRARY_PATH env var for it to find bevy and std dylibs. How you configure this depends on your IDE but check out [this vscode example](#engine-dev message)

jagged temple
#

hold on this example is for Linux, also how is IDE relevant if im just launching the .exe from file explorer with double click?

wind scaffold
#

Ah, it's generally just way easier to configure this in an IDE. If you're not running it through an IDE, you will need to add those dirs to your system PATH, or add that env var with them, or setup a shell script that adds those paths and then launches your exe, or copy them all together into a common dir

#

It's generally the same paths regardless of OS - /target/debug/deps in your project and cargo's lib dir for your target

jagged temple
#

"cargo's lib dir for your target" is what?

wind scaffold
#

Something like %userprofile%/.rustup/toolchains/{toolchain}/lib

#

Might be a couple dirs deeper on Windows IIRC, wherever the std dylib can be found

jagged temple
#

i added
D:\bevy-game\target\x86_64-pc-windows-msvc\debug\deps
and
C:\Users\Username\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\lib
to Path

it still shows these two errors on launch

#

oops it' should be debug/deps not x86_64-pc-windows-msvc\debug\deps

#

oh now it works