1

I don't want to have the end use have to have the libraries installed, so, having the libraries packaged in my exec would be preferred.

this is the relevant line in the make file:

hPif : src/main.o src/fann_utils.o src/hashes.o src/Config.o g++ -o hPif src/main.o src/fann_utils.o src/hashes.o src/Config.o -static -lfann -lboost -L/usr/local/lib 

I'm trying to link fann and boost, and I read somewhere (http://www.adp-gmbh.ch/cpp/gcc/create_lib.html) that using the -static flag allows that.

What am I doing wrong?

1 Answer 1

2

The -static flag is correct, but you need to make sure your libraries are static libraries without dependencies. If they are built as shared (or have shared dependencies), gcc will not link them statically (and/or you will still have library dependencies).

You may need to rebuild your Boost libraries to achieve this.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.