Linux - Software This 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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
|
|
|
07-24-2003, 05:25 AM
|
#1
|
Member
Registered: Jul 2003
Distribution: Arch Linux x64
Posts: 115
Rep:
|
Can you compile using g++? I need your help!!
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.
Any suggestion?
Thanks to all of you for your help!!
|
|
|
07-24-2003, 05:33 AM
|
#2
|
Member
Registered: Feb 2003
Location: Santa Clara,CA
Distribution: Mandriva
Posts: 909
Rep:
|
This is not the way to include a library,if you are doing it you have to add -l<library name>
read the manpage,first.
|
|
|
07-24-2003, 06:11 AM
|
#3
|
Member
Registered: Jul 2003
Distribution: Arch Linux x64
Posts: 115
Original Poster
Rep:
|
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...
Thanks to all for your help!!
|
|
|
07-24-2003, 06:23 AM
|
#4
|
Member
Registered: Feb 2003
Location: Santa Clara,CA
Distribution: Mandriva
Posts: 909
Rep:
|
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
|
|
|
07-24-2003, 06:23 AM
|
#5
|
Member
Registered: Sep 2002
Location: York, UK
Distribution: Debian Sid
Posts: 215
Rep:
|
If ld can't find it, it ain't there :-)
Double check the path you're using.
|
|
|
07-24-2003, 06:23 AM
|
#6
|
Member
Registered: Feb 2003
Location: Santa Clara,CA
Distribution: Mandriva
Posts: 909
Rep:
|
note that it is not libscope but only scope
|
|
|
07-24-2003, 06:46 AM
|
#7
|
Member
Registered: Jul 2003
Distribution: Arch Linux x64
Posts: 115
Original Poster
Rep:
|
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'???
Of course, none works at home...
Thanks!
|
|
|
07-24-2003, 06:56 AM
|
#8
|
Member
Registered: Feb 2003
Location: Santa Clara,CA
Distribution: Mandriva
Posts: 909
Rep:
|
this is wrong
Quote:
bash-2.04$ g++ -lscope -L /u1/msc/cl13/private/Project/scope-src/ -o libscope.a LBPROT.cpp
|
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
|
|
|
07-24-2003, 07:38 AM
|
#9
|
Member
Registered: Jul 2003
Distribution: Arch Linux x64
Posts: 115
Original Poster
Rep:
|
Amazing mate! It' works only in my university:
g++ -L./scope-src/ -o anything LBPROT.cpp -lscope
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??
Thanks!!
|
|
|
07-24-2003, 07:44 AM
|
#10
|
Member
Registered: Feb 2003
Location: Santa Clara,CA
Distribution: Mandriva
Posts: 909
Rep:
|
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?
|
|
|
07-24-2003, 07:47 AM
|
#11
|
Member
Registered: Jul 2003
Distribution: Arch Linux x64
Posts: 115
Original Poster
Rep:
|
Well, I'm at home but I can compile my project from home via SSH. That's what I'm doing since the beggining of this 'conversation'.
See you around mate!
|
|
|
07-24-2003, 08:31 AM
|
#12
|
Member
Registered: Feb 2003
Location: Santa Clara,CA
Distribution: Mandriva
Posts: 909
Rep:
|
well you could have said so,anyway i use ssh too within the uni only.
|
|
|
07-24-2003, 08:39 AM
|
#13
|
Member
Registered: Feb 2003
Location: Santa Clara,CA
Distribution: Mandriva
Posts: 909
Rep:
|
finally about the commands which worked and which did not work could you tell me what they were?
|
|
|
07-24-2003, 08:49 AM
|
#14
|
Member
Registered: Jul 2003
Distribution: Arch Linux x64
Posts: 115
Original Poster
Rep:
|
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...
Thanks mate! :d
|
|
|
07-24-2003, 09:40 AM
|
#15
|
Member
Registered: Feb 2003
Location: Santa Clara,CA
Distribution: Mandriva
Posts: 909
Rep:
|
Quote:
Is there anything else I can do if have run your pacience out??
|
My guess you are from Australia!
Anyway thanks!!
|
|
|
All times are GMT -5. The time now is 04:42 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|