Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hi mates! I' m sure that my error it's a silly thing but these kind of errors are what usually drive us mad. So, the thing is that I can compile a file in my university but when I use exactly the same command in my computer, I get an errorr. The command and its output are:
[bash#] g++ LBPROT.cpp ./scope-src/libscope.a
/tmp/ccYYTJfA.o(.text+0x27): In function `getimagef(char*, image_data*)':
: reference to `getimage(data*, char*, char*)' non-defined
collect2: ld returned the output state 1
This is exactly the same error I get in my university when I omit the library file 'libscope.a' where 'getimagef' function is defined.
Well rch, firstly thanks for your help. However, it doesn't work even in my university. I get that error:
Using relative path:
bash-2.04$ g++ -l ./scope-src/libscope.a LBPROT.cpp
/usr/bin/ld: cannot find -l./scope-src/libscope.a
collect2: ld returned 1 exit status
Using absolute path:
bash-2.04$ g++ -l /u1/msc/cl13/private/Project/scope-src/libscope.a LBPROT.cpp
/usr/bin/ld: cannot find -l/u1/msc/cl13/private/Project/scope-src/libscope.a
collect2: ld returned 1 exit status
Any alternative suggestion?? It's very important to compile that in my computer, since I'm wasting a lot of time in my project with this stupid thing...
do you have the administrative previlage,
if you have maybe you could install the library
and then do ldconfig
The other way is to include the path using -L option
so do this
g++ -lscope -L<whereever the library is> -o <object file name> filename.cxx
Sorry mates, but it doesn't work yet. Just in case this might help you:
At home:
[bash$] g++ --version
g++ (GCC) 3.2.2 20030222 (Red Hat Linux 3.2.2-5)
In my university:
bash-2.04$ g++ --version
2.96
I did that:
bash-2.04$ g++ -lscope -L /u1/msc/cl13/private/Project/scope-src/ -o libscope.a LBPROT.cpp
/usr/bin/ld: cannot find -lscope
collect2: ld returned 1 exit status
and that:
bash-2.04$ g++ -lscope -L /u1/msc/cl13/private/Project/scope-src/ -o object.o LBPROT.cpp
/usr/bin/ld: cannot find -lscope
collect2: ld returned 1 exit status
Does anybody know why I can do 'g++ LBPROT.cpp ./scr-scope/libscope.a -o LPPROT' but I can do neither ''g++ LBPROT.cpp -L ./src-scope/ -l libscope.a -o LBPROT' nor 'g++ LBPROT.cpp -l./src-scope/libscope.a -o LBPROT'???
do
bash-2.04$ g++ -L/u1/msc/cl13/private/Project/scope-src/ -o anything LBPROT.cpp -lscope
or much easier
copy libscope.a to /usr/lib
(if you are allowed to do so)
do ldconfig
now do not use the -L option
I've tried to copy the libscope.a file in /usr/lib and then do 'ldconfig'. Afterwards, I did 'g++ -o anything LBPROT.cpp -lscope' and 'g++ LBPROT.cpp ./scope-src/libscope.a -o LBPROT' that both work in my university, but any of them work at all in my laptop!!
Is there anything else I can do if have run your pacience out??
First tell me whether you are in the uni or at home,coz it appears that you are in two places at once.Or is it that your home is quite near the uni.(Incidentally I also study
in a uni,but my home is around 30km away)
Second apparently something did not worked and something worked,I do not follow what command worked and what didn't?
All commands the work were in my university. The rest are divided between at home and university computes. I've already specified which didn't work in my univeristy... At home none worked...
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.