LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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


Reply
  Search this Thread
Old 07-15-2011, 06:14 AM   #1
barunparichha
Member
 
Registered: Jun 2006
Location: Bangalore,india
Distribution: Linux(Redhat,fedora,suse,ubantu), Solaris (s8/s9/s10/nevada/open-solaris)
Posts: 303

Rep: Reputation: 32
Attaching lib.so while creating static lib


Hi,
I want to attch libCoherence.so while creating my new static lib, bcse my lib functions use libCoherence.so.

My Makefile :

Code:
CC=/opt/studio12/SUNWspro/bin/CC
CFLAGS=-errtags=yes -g -c
all: libCoherence.a

libCoherence.a: SessionInfo.o SessionAttrInfo.o NXC_SessionInfo.o  Coherence_TouchProcessor.o
        ar  -r libCoherence.a SessionInfo.o SessionAttrInfo.o NXC_SessionInfo.o  Coherence_TouchProcessor.o /export/home2/Coherence/coherence-cpp-32bit/lib/libcoherence.so

SessionInfo.o: $(SRCDIR)/SessionInfo.cpp
        $(CC) $(CFLAGS) -I../../include -I/export/home2/Coherence/coherence-cpp-32bit/include/ $(SRCDIR)/SessionInfo.cpp

SessionAttrInfo.o: $(SRCDIR)/SessionAttrInfo.cpp
        $(CC) $(CFLAGS) -I../../include -I/export/home2/Coherence/coherence-cpp-32bit/include/ $(SRCDIR)/SessionAttrInfo.cpp

NXC_SessionInfo.o: $(SRCDIR)/NXC_SessionInfo.cpp
        $(CC) $(CFLAGS) -I../../include -I/export/home2/Coherence/coherence-cpp-32bit/include/ $(SRCDIR)/NXC_SessionInfo.cpp

Coherence_TouchProcessor.o: $(SRCDIR)/Coherence_TouchProcessor.cpp
        $(CC) $(CFLAGS) -I../../include -I/export/home2/Coherence/coherence-cpp-32bit/include/ $(SRCDIR)/Coherence_TouchProcessor.cpp
But it shows error :

Code:
/opt/studio12/SUNWspro/bin/CC -errtags=yes -g -c -I../../include -I/export/home2/Coherence/coherence-cpp-32bit/include/ ../src/coherence-src/SessionInfo.cpp
/opt/studio12/SUNWspro/bin/CC -errtags=yes -g -c -I../../include -I/export/home2/Coherence/coherence-cpp-32bit/include/ ../src/coherence-src/SessionAttrInfo.cpp
/opt/studio12/SUNWspro/bin/CC -errtags=yes -g -c -I../../include -I/export/home2/Coherence/coherence-cpp-32bit/include/ ../src/coherence-src/NXC_SessionInfo.cpp
/opt/studio12/SUNWspro/bin/CC -errtags=yes -g -c -I../../include -I/export/home2/Coherence/coherence-cpp-32bit/include/ ../src/coherence-src/Coherence_TouchProcessor.cpp
ar  -r libCoherence.a SessionInfo.o SessionAttrInfo.o NXC_SessionInfo.o  Coherence_TouchProcessor.o /export/home2/Coherence/coherence-cpp-32bit/lib/libcoherence.so
ar: creating libCoherence.a
internal error: error_message(58)
gmake: *** [libCoherence.a] Error 100
But if I remove "/export/home2/Coherence/coherence-cpp-32bit/lib/libcoherence.so" from Makefile, build went fine.

I am not sure if we could add a lib.
Please check.
Thanks.
 
Old 07-16-2011, 03:50 PM   #2
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Quote:
Q: I am not sure if we could add a (shared .so directly into a static .a) lib.
A: No, you can't
 
  


Reply



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
CMake Static Lib Dtag Programming 5 02-08-2012 12:15 AM
Static Lib subramani Programming 1 04-25-2011 12:11 AM
CMake Static Lib Dtag Programming 0 05-22-2009 11:13 AM
Making a static lib from objects + static libs kovacsp Programming 2 12-19-2007 12:53 PM
How do I create a static lib with g++? BrianK Programming 1 05-27-2005 07:30 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:22 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