How can I link an .o file using g++
I am trying to use g++ to compile a .cc file, and I need it to link a .o file.
So I tried:
$g++ -o client -I../ipc -L../messages.o client.cc
/usr/bin/ld: error:开发者_StackOverflow中文版 ../messages.o: can not read directory: Not a directory
And I have tried:
$g++ -o client -I../ipc -l../messages.o client.cc
/usr/bin/ld: error: cannot find -l../messages.pb.o
$$ ls -l ../messages.o
-rw-r--r-- 1 hap497 hap497 227936 2010-02-03 22:32 ../messages.o
Can you please tell me how to link in a .o file?
Thank you.
$g++ -o client -I../ipc client.cc ../messages.o
精彩评论