LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices


Reply
  Search this Thread
Old 07-24-2013, 09:04 AM   #1
rohaanembedded
Member
 
Registered: May 2013
Location: India
Distribution: Ubuntu 11.10
Posts: 178

Rep: Reputation: Disabled
Question issue linking .SO "g++: -lcyusb: linker input file unused because linking not done"


Dear sir,

I am trying to use my usb driver code in the RHEL5 but in case of linking of shared bojects i am getting one msg while i run my Makefile
Makefile:
Code:
all:
        g++ -c -fPIC        syn_Usb.c -o syn_Usb.o   -L ../../lib -l cyusb  
        g++ -shared -Wl,-soname,libsynusb.so -o ../syn_lib/libsynusb.so.1 syn_Usb.o -L ../../lib -l cyusb
        cd ../syn_lib; ln -sf libsynusb.so.1 libsynusb.so


clean:
        rm -f syn_Usb

help:
        @echo   'make           would compile all source programs in this directory
        @echo   'make clean     would remove all object code in this directory
when give make command its giving me output on terminal like,

Code:
g++ -c -fPIC        syn_Usb.c -o syn_Usb.o   -L ../../lib -l cyusb  
g++: -lcyusb: linker input file unused because linking not done
g++ -shared -Wl,-soname,libsynusb.so -o ../syn_lib/libsynusb.so.1 syn_Usb.o -L ../../lib -l cyusb
cd ../syn_lib; ln -sf libsynusb.so.1 libsynusb.so
its working smooth on the ubuntu.

Now its not giving me any kind of error as such but still linking is not done
let me know if any mistake i am doing here

Thanks & Regards
rohaan
 
Old 07-24-2013, 09:17 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,938

Rep: Reputation: 8017Reputation: 8017Reputation: 8017Reputation: 8017Reputation: 8017Reputation: 8017Reputation: 8017Reputation: 8017Reputation: 8017Reputation: 8017Reputation: 8017
Quote:
Originally Posted by rohaanembedded View Post
Dear sir,
I am trying to use my usb driver code in the RHEL5 but in case of linking of shared bojects i am getting one msg while i run my Makefile
Makefile:
Code:
all:
        g++ -c -fPIC        syn_Usb.c -o syn_Usb.o   -L ../../lib -l cyusb  
        g++ -shared -Wl,-soname,libsynusb.so -o ../syn_lib/libsynusb.so.1 syn_Usb.o -L ../../lib -l cyusb
        cd ../syn_lib; ln -sf libsynusb.so.1 libsynusb.so

clean:
        rm -f syn_Usb
help:
        @echo   'make           would compile all source programs in this directory
        @echo   'make clean     would remove all object code in this directory
when give make command its giving me output on terminal like,
Code:
g++ -c -fPIC        syn_Usb.c -o syn_Usb.o   -L ../../lib -l cyusb  
g++: -lcyusb: linker input file unused because linking not done
g++ -shared -Wl,-soname,libsynusb.so -o ../syn_lib/libsynusb.so.1 syn_Usb.o -L ../../lib -l cyusb
cd ../syn_lib; ln -sf libsynusb.so.1 libsynusb.so
its working smooth on the ubuntu.

Now its not giving me any kind of error as such but still linking is not done let me know if any mistake i am doing here
You have some sort of syntax error between the versions of things you're using on Ubuntu vs. RHEL. So, read the man pages on the g++/make commands on the two systems, and figure out what's different.

Also, since you're using RHEL, have you contacted Red Hat support?? You are PAYING for RHEL, right????
 
1 members found this post helpful.
Old 07-24-2013, 09:44 AM   #3
rohaanembedded
Member
 
Registered: May 2013
Location: India
Distribution: Ubuntu 11.10
Posts: 178

Original Poster
Rep: Reputation: Disabled
Unhappy

Dear sir,

i tried and went through the man pages but i didnt found that difference.and sorry sir i am not regsister user till date but i think i can use RHEL without registration as learner so it will be difficult to get the help from the RHEL support.

in man pages of g++ i found something like this, is it stoping the linking i am nnot sure please le t me know,

Code:
-c  Compile or assemble the source files, but do not link.  The linking stage simply is not done.  The ultimate output is in the form of an
           object file for each source file.

           By default, the object file name for a source file is made by replacing the suffix .c, .i, .s, etc., with .o.

           Unrecognized input files, not requiring compilation or assembly, are ignored.

any other information that can help to solve this issue please let me know,

really thanks for your time & rply.

Does any one had this kind of issue please help me.

Thanks & Regards
rohaan
 
Old 07-24-2013, 01:34 PM   #4
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,938

Rep: Reputation: 8017Reputation: 8017Reputation: 8017Reputation: 8017Reputation: 8017Reputation: 8017Reputation: 8017Reputation: 8017Reputation: 8017Reputation: 8017Reputation: 8017
Quote:
Originally Posted by rohaanembedded View Post
Dear sir,
i tried and went through the man pages but i didnt found that difference.and sorry sir i am not regsister user till date but i think i can use RHEL without registration as learner so it will be difficult to get the help from the RHEL support.
If you're just learning, then you should get CentOS, not RHEL. And, the latest RHEL is 6.4, so why are you using 5???
Quote:
in man pages of g++ i found something like this, is it stoping the linking i am nnot sure please le t me know,
Code:
-c  Compile or assemble the source files, but do not link.  The linking stage simply is not done.  The ultimate output is in the form of an
           object file for each source file.

           By default, the object file name for a source file is made by replacing the suffix .c, .i, .s, etc., with .o.

           Unrecognized input files, not requiring compilation or assembly, are ignored.
Right...so AGAIN, the differences between what you're using on Ubuntu (where it works), and what you're using on RHEL (where it doesn't), are the REASONS why it's not working. What version of Ubuntu? G++? Make? RHEL5 is a bit old at this point, so if you're using a current version of Ubuntu, then you're also using newer tools/libraries. Again, get the latest from Red Hat and try again, or read the man pages on the tools you're using, and walk through them one at a time, to see what options each support.
 
Old 07-26-2013, 12:36 AM   #5
rohaanembedded
Member
 
Registered: May 2013
Location: India
Distribution: Ubuntu 11.10
Posts: 178

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by TB0ne View Post
If you're just learning, then you should get CentOS, not RHEL. And, the latest RHEL is 6.4, so why are you using 5???

Right...so AGAIN, the differences between what you're using on Ubuntu (where it works), and what you're using on RHEL (where it doesn't), are the REASONS why it's not working. What version of Ubuntu? G++? Make? RHEL5 is a bit old at this point, so if you're using a current version of Ubuntu, then you're also using newer tools/libraries. Again, get the latest from Red Hat and try again, or read the man pages on the tools you're using, and walk through them one at a time, to see what options each support.
Thanks for giving new way to think on this,
i will go thrpugh all the ques u have suggested to me.
i will try find out the solution,

Regards
rohaan
 
Old 07-26-2013, 01:14 AM   #6
rohaanembedded
Member
 
Registered: May 2013
Location: India
Distribution: Ubuntu 11.10
Posts: 178

Original Poster
Rep: Reputation: Disabled
Smile

Thank you everyone,

firstly I am using g++ version 4.1.2-46,

i was doing the wrong thing of linking the lib while compling code, shown in the bold letters in below makefile

Code:
all:
        g++ -c -fPIC        syn_Usb.c -o syn_Usb.o   -L ../../lib -l cyusb  
        g++ -shared -Wl,-soname,libsynusb.so -o ../syn_lib/libsynusb.so.1 syn_Usb.o -L ../../lib -l cyusb
        cd ../syn_lib; ln -sf libsynusb.so.1 libsynusb.so

clean:
        rm -f syn_Usb
help:
        @echo   'make           would compile all source programs in this directory
        @echo   'make clean     would remove all object code in this directory

the lib has to be linked when the shared objects are actually getting created in the next line where i was linking it rightly so never created the problem but the after i give command it was showing that msg. "g++: -lcyusb: linker input file unused because linking not done"
so now i removed the bold part in my Makefile (according to my understanding), hopfully it wont cause any problem in future,
and it was never got noticed in ubuntu-11.10 machine 3.0.0-32-generic i686 with g++ version 4.6.1

Regards
rohaan
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Makefile error : linker input file unused because linking not done Tushar@31 Linux - Newbie 1 01-22-2013 12:42 AM
"Unresolved reference" errora while doing dynamic Linking of C++.so (shared object) micropanther Programming 10 04-19-2011 06:59 AM
LXer: InaTux, "Courteously complying to the GNU `linking guidelines`" LXer Syndicated Linux News 0 01-28-2009 08:01 PM
gnu arm issue in linking "__inline" methods RPDP Programming 10 09-30-2006 07:11 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat

All times are GMT -5. The time now is 11:46 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration