My C++ project uses CMake for creating makefiles for compilaton and external libraries from boost. My editor of choice is vim.
Running $ make
in the command line works but :make
in vim has problems at the linking stage and returns:
/usr/bin/ld: cannot find -lboost_system
However, I also use :make install
to place my project in $HOME/usr/stow/<prog>
where I test and use the program. Therefore I am looking for a solution to make the linking stage successful.
Further details:
It is in out-of-src build dir. Therefore I've configured makeprg
:set makeprg=make\ -C\ ../build/Release/
A more recent boost version is installed and made available on the system via the Environment Modules Project which I rely on in my project. The newer boost version can be loaded via
$ module load boost
I have added this line to my $HOME/.profile
, so that I don't have to call it each time I am compiling.
I have checked the question (G)VIM uses a different $PATH than my system discussing Environment variables as used in vim.
UPDATE: The problem occurred only in gvim started from the window manager(gnome2) and not (g)vim started from the commandline/bash.