Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Compilation fails on Ubuntu 14.04 Trusty #4

Open
jonathanballs opened this issue Nov 30, 2014 · 2 comments
Open

Compilation fails on Ubuntu 14.04 Trusty #4

jonathanballs opened this issue Nov 30, 2014 · 2 comments

Comments

@jonathanballs
Copy link

I'm getting the following error when compiling with the dub command:

Building sample-dash-game ~develop configuration "application", build type debug.
Running pre-build commands...
cp: cannot create regular file ‘/usr/lib/libsoloud_x86.so’: Permission denied
Compiling using dmd...
Linking...
/usr/bin/ld: cannot find -lsoloud_x86
/usr/bin/ld: cannot find -levent
/usr/bin/ld: cannot find -levent_pthreads
collect2: error: ld returned 1 exit status
--- errorlevel 1
FAIL .dub/build/application-debug-linux.posix-x86_64-dmd_2066-F5BBF83448D35E0B46394B6730259178/ sample-dash-game executable
Error executing command run: dmd failed with exit code 1.

I get why this error appears (missing libraries which can be installed fairly easily) but I feel like this is an issue that should be dealt with by the compiler.

@link552
Copy link

link552 commented Dec 15, 2015

I am also having a very similar problem.

Dub compiles Dash properly until it gets to linking where it tries to link these libraries that don't exist. I'm building on OSX. Here is my output:

Linking...
dmd -of.dub/build/application-debug-posix.osx-x86_64-dmd_2069-31C44B660E0B59E23153D4309EFB09C3/sample-dash-game .dub/build/application-debug-posix.osx-x86_64-dmd_2069-31C44B660E0B59E23153D4309EFB09C3/sample-dash-game.o ../../../../.dub/packages/Dash/libdash.a ../../../../.dub/packages/colorize-1.0.5/libcolorize.a ../../../../.dub/packages/derelict-assimp3-1.0.1/lib/libDerelictASSIMP3.a ../../../../.dub/packages/derelict-fi-1.9.0/lib/libDerelictFI.a ../../../../.dub/packages/derelict-gl3-1.0.17/lib/libDerelictGL3.a ../../../../.dub/packages/dyaml-0.5.2/libdyaml.a ../../../../.dub/packages/gfm-2.3.26/libgfm_sdl2.a ../../../../.dub/packages/derelict-sdl2-1.9.7/lib/libDerelictSDL2.a ../../../../.dub/packages/derelict-util-2.0.4/lib/libDerelictUtil.a ../../../../.dub/packages/logger-0.3.3/liblogger.a ../../../../.dub/packages/gl3n-1.2.0/libgl3n.a ../../../../.dub/packages/msgpack-d-0.9.2/libmsgpack-d.a ../../../../.dub/packages/tharsis-prof-0.5.4/libtharsis-prof.a ../../../../.dub/packages/tinyendian-0.1.2/libtinyendian.a ../../../../.dub/packages/vibe-d-0.7.27-alpha.2/libvibe-d.a ../../../../.dub/packages/vibe-d-0.7.27-alpha.2/libvibe-d_mail.a ../../../../.dub/packages/vibe-d-0.7.27-alpha.2/libvibe-d_mongodb.a ../../../../.dub/packages/vibe-d-0.7.27-alpha.2/libvibe-d_redis.a ../../../../.dub/packages/vibe-d-0.7.27-alpha.2/libvibe-d_web.a ../../../../.dub/packages/vibe-d-0.7.27-alpha.2/libvibe-d_diet.a ../../../../.dub/packages/vibe-d-0.7.27-alpha.2/libvibe-d_http.a ../../../../.dub/packages/vibe-d-0.7.27-alpha.2/libvibe-d_core.a ../../../../.dub/packages/vibe-d-0.7.27-alpha.2/libvibe-d_data.a ../../../../.dub/packages/vibe-d-0.7.27-alpha.2/libvibe-d_utils.a -L-lsoloud_x86 -L-levent -L-levent_pthreads -L-lssl -L-lcrypto -g
ld: library not found for -lsoloud_x86
clang: error: linker command failed with exit code 1 (use -v to see invocation)
--- errorlevel 1
FAIL .dub/build/application-debug-posix.osx-x86_64-dmd_2069-31C44B660E0B59E23153D4309EFB09C3/ sample-dash-game executable
dmd failed with exit code 1.

@ColdenCullen
Copy link
Member

Hey, sorry it took me so long to respond to this, I totally forgot it existed :)

It looks like there's 2 issues here, the first being @bonniejools problem with -levent and -levent_pthreads, which should be solvable by installing libevent with apt-get install libevent-dev.

As for the -lsoloud_x86 issue, this is a larger problem. We never quite got libpaths to work correctly, so we just copy the lib to /usr/lib/, which is not ideal. The temporary solution is to either copy libsoloud_x86.so to somewhere in your libpath, or run sudo dub build at least once, to have it copy the file to /usr/lib/ for you.

Let me know if that fixes your issue!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants