Results 1 to 1 of 1
ive built a load of .o files into a .a file with:
ar rcs my_library.a file1.o file2.o etc...
then, i compilied by actual app with:
g++ -c main.cpp
g++ -c ...
- 02-24-2007 #1Just Joined!
- Join Date
- Jan 2007
- Posts
- 7
please help me link my app with g++
ive built a load of .o files into a .a file with:
ar rcs my_library.a file1.o file2.o etc...
then, i compilied by actual app with:
g++ -c main.cpp
g++ -c Application.cpp
i look in my directory and i can see:
Application.o main.o my_library.a
all i want to do is link main.o and Application.o with my_library.a. so i type:
g++ -o TheEXE main.o Application.o -l my_library.a
but the compiler says:
/usr/bin/ld: cannot open -lmy_library.a: no such file or directory.
how can i instruct it to look in the current directory? or is another problem? i have tried the -L switch, like this:
g++ -o TheEXE main.o Application.o -L ./ -l my_library.a
and even hard coded the full path, like this:
g++ -o TheEXE main.o Application.o -L /home/myapp/ -l my_library.a
but i get the same error


Reply With Quote
