[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
library inclusion problem
From: |
Pindare |
Subject: |
library inclusion problem |
Date: |
5 Jul 2006 02:13:25 -0700 |
User-agent: |
G2/0.2 |
Hello,
I wrote quite a few c++ programs a some years ago which I compiled
successfully with g++ at the time, but now I forgot how to make them
work, so your help would be greatly appreciated.
Here's my setup:
1. I have a directory called /home/pindare/mycode/
2. in it there's my file prog.cc
3. there's another directory called /home/pindare/othercode/
4. that one contains mycode.h mycode.cc mycode.o libmycode.a
5. now I want to compile prog.cc using libmycode.a
6. so in a shell I go to /home/pindare/mycode
7. then I type
g++ -I../home/pindare/othercode/ -L../home/pindare/othercode/ -o xprog
prog.cc -lmycode -lm
8. and I get the following message
/usr/bin/ld: cannot find -lmycode
collect2: ld returned 1 exit statuse
I haven't recompiled the mycode library for years and it did work at
the time, so I'm guessing it's a compiler issue. Now what exactly I
couldn't say, a path variable perhaps, if so how to make it work?
Maybe an important point: all this happens on a local network,
I mean a few years ago I used to compile and run this on a certain
linux PC but now I have another one. I tried to compile on another
bigger linux server and got the same kind of error message.
Regards,
---
PP
- library inclusion problem,
Pindare <=