|
|
Paul Pluzhnikov <ppluzhnikov-nsp@xxxxxxxxxxx> writes:
> Gary Wessle <phddas@xxxxxxxxx> writes:
>
> > could you please tell me how can I add a given directory to the
> > standard search path for the compiler and also for the linker?
>
> You can't (well, not without recompiling gcc); but you don't need to.
> Just add it to your compile and link lines:
>
> gcc -I /usr/local/include/gsl -c foo.c
> gcc -o foo foo.o -L /usr/local/lib/gsl -lgsl
>
> [If libgsl is a shared library, you may also need to add
> -Wl,-rpath=/usr/local/lib/gsl]
>
> Cheers,
> --
> In order to understand recursion you must first understand recursion.
> Remove /-nsp/ for email.
thanks
after a whole day reading cpp docs, gcc docs, make docs and the gsl
lib docs I came very close but with 2 warnings that I need to fix. I
really don't know where to go from here,
the output is
****************************************************************
fred@debian:~/myPrograms/common$ make
makefile:14: warning: overriding commands for target `proj'
makefile:11: warning: ignoring old commands for target `proj'
g++ -L/usr/local/lib read_data.cpp read_data_test.cpp -lgsl -lgslcblas -lm
fred@debian:~/myPrograms/common$ ls
a.out makefile read_data.cpp read_data.h read_data_test.cpp semantic.cache
fred@debian:~/myPrograms/common$
****************************************************************
**************** makefile ****************
#-Wall "turns on all warnings"
#-c "donot run the linker"
#-o "output file"
#$@ "the target"
#$^ "list of all prerequisites"
SRC := $(wildcard *.cpp)
OBJ := $(wildcard *.o)
#### compiler section ####
proj: $(SRC)
$(CXX) -o $@ -Wall -I/usr/include -c $^
#### linker section ####
proj: $(OBJ)
$(CXX) -L/usr/local/lib $^ -lgsl -lgslcblas -lm
^^^
here
how can I reference all the .o files which are the output of the
compiler in the first step?
I "think" this is my only problem.
thanks
|
|