RejectedSoftware Forums

Sign up

vibe sample project does not compile on a MAC OS 10.10.4

When I try to build sample project "auth_basic" using dub. I get the following error:

Lingwens-MacBook-Pro:authbasic ganlingwen$ dub
Target vibe-d ~master is up to date. Use --force to rebuild.
Building auth-basic-example ~master configuration "application", build type debug.
Compiling using dmd...
Compiling diet template 'index.dt'...
Compiling diet template 'internal.dt'...
Linking...
ld: library not found for -levent
clang: error: linker command failed with exit code 1 (use -v to see invocation)
--- errorlevel 1
FAIL .dub/build/application-debug-posix.osx-x8664-dmd2068-1DA455B4551524CB63F10631A617DA7F/ auth-basic-example executable
Error executing command run:
dmd failed with exit code 1.
Lingwens-MacBook-Pro:authbasic ganlingwen$

I am running this code on MAC10.10.4, and have libevent-2.0.22 installed.
Why am I having trouble linking to libevent? I have searched the web, some posts say that I should install libevent-dev instead. However, using brew, I can only install libevent. Is this a known issue or is it just wrong on my laptop?

The installation procedure is as follows:

brew install dub
cd path/to/project
dub
Hitting errors here

Re: vibe sample project does not compile on a MAC OS 10.10.4

On Mon, 14 Sep 2015 01:27:14 GMT, Lingwen Gan wrote:

When I try to build sample project "auth_basic" using dub. I get the following error:

Lingwens-MacBook-Pro:authbasic ganlingwen$ dub
Target vibe-d ~master is up to date. Use --force to rebuild.
Building auth-basic-example ~master configuration "application", build type debug.
Compiling using dmd...
Compiling diet template 'index.dt'...
Compiling diet template 'internal.dt'...
Linking...
ld: library not found for -levent
clang: error: linker command failed with exit code 1 (use -v to see invocation)
--- errorlevel 1
FAIL .dub/build/application-debug-posix.osx-x8664-dmd2068-1DA455B4551524CB63F10631A617DA7F/ auth-basic-example executable
Error executing command run:
dmd failed with exit code 1.
Lingwens-MacBook-Pro:authbasic ganlingwen$

I am running this code on MAC10.10.4, and have libevent-2.0.22 installed.
Why am I having trouble linking to libevent? I have searched the web, some posts say that I should install libevent-dev instead. However, using brew, I can only install libevent. Is this a known issue or is it just wrong on my laptop?

libevent-dev sounds like Ubuntu/Debian.

I have no idea how brew installs this but you need to have libevent.a or libevent.dylib in a path that the linker searches. That would be either /usr/local/lib or /usr/lib.

Alternatively you need to add a flag to the linker telling it to search in a different directory, i.e. "-L/path/to/libevent-directory".

/Jacob Carlborg