using Levmar

Hi,

I would like to use the levenberg - Marquardt minimization routine in my c++ script. I am not sure how to link the liblevmar.a libraries to the script. How do you link static libraries to the program via the command line using g++ compiler?
-llevmar
thanks for the prompt reply.

inlcude -llevmar gives me an error.

/usr/bin/ld: cannot find -llevmar


I guess I have to specify the full path where the library is. where do you specify that?
http://stackoverflow.com/questions/10454263/command-to-compile-c-files-with-a-files

g++ -L<here comes the library path> -l<library name>

Or for a simple case (assuming all the files including the lib.a is in the working directory):

g++ -o name.exe usefullib.a files.cpp
Last edited on
Hi again,
after reading the suggested posts I came to know that I have to write a make file for my scripts. Now, for the levar I jus copied the default one and modified to accomodate my C script. it worked. The problem is that now I have to use levmar in a c++ script which has its own build file in bash. I think I have to combine them into one make file but in order to do that could anyone tell me what is this line stand for:
 
-R/library_path


This is for the headers (include):
 
-I/library_path


this for the libraries:
 
-L/library_path -Wl


What is the -R? and how can one include that in a make file?

Thanks
A makefile is in no way required, it is just a popular way to manage projects.
yes but I plan to use it many times and it is by far the best option compared to command line compilation. only the c++ script requires 3 line of code in command line without the levmar. Do you know what -R/library path is?
Seek 'rpath' from 'man ld'.
I found it
thanks
Topic archived. No new replies allowed.