How to let g++ search for library directory /opt/local/lib/

Lawrence Velázquez larryv at
Sat Mar 16 11:29:45 PDT 2013

On Mar 16, 2013, at 1:03 PM, Peng Yu <pengyu.ut at> wrote:

> ~/linux/test/cpp/library/pcrecpp$ sudo port select gcc mp-gcc45
> Selecting 'mp-gcc45' for 'gcc' succeeded. 'mp-gcc45' is now active.
> ~/linux/test/cpp/library/pcrecpp$ g++ main.o  -lpcrecpp  -o main
> g++-mp-4.5: error trying to exec
> '/opt/local/bin/i686-apple-darwin11-llvm-g++-4.2': execvp: No such
> file or directory
> I get the above error. Does anybody know what is wrong?

The shell command hash table is in an inconsistent state because you've switched out "g++" from under it. Run "hash -r".


More information about the macports-users mailing list