[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    RE: bksys questions
From:       <tnagyemail-ml () yahoo ! fr>
Date:       2005-09-23 14:17:52
Message-ID: 20050923141752.6460.qmail () web25709 ! mail ! ukl ! yahoo ! com
[Download RAW message or body]

Compile the static library with -fPIC -DPIC -
convenience libraries have been introduced in bksys
for kdelibs 4.


A much better solution is to get rid of the static
library; in ~/development/playground/trax/SConscript
remove the env.subdirs('soundcanvas') statement and
add the following code:

if 1:
    obj.source += " soundcanvas/graph.cpp"

just before:
obj.execute()

As explained in the documentation (incomplete as the
kdelibs conversion is a time-consuming), convenience
libraries are not mandatory.


Regards,
Thomas

--- Jonas Widarsson <jonas@widarsson.com> a écrit :

> (Att:Thomas Nagy, or anyone else familiar with that
> system.)
> 
> I am having trouble getting my static library to
> link.
> 
> I decided to place some of my sources that more
> tightly depend 
> on each other in a subdir "soundcanvas". The program
> 
> compiles and builds fine when I have all files in
> one directory. 
> But as I move one of them into soundcanvas I cannot
> get it to link.
> 
> Here's  ~/development/playground/trax/SConstruct:
> **************************************
> env = Environment( tools=['default', 'generic',
> 'kde'], toolpath=['./', './admin'])
> env.KDEuse("environ rpath")
> SetOption('duplicate', 'soft-copy')
> env.BuildDir('#build/src', '#src')
> env.subdirs('build/src')
> env.dist('bksys')
> **************************************
> 
> Here's  ~/development/playground/trax/SConscript:
> **************************************
> Import( 'env' )
> env.subdirs('soundcanvas')
> 
> obj=env.kobject('program')
> obj.target='trax'
> obj.source="""
> jackbuf.cpp
> jackclient.cpp
> main.cpp
> pref.cpp
> trax.cpp
> graphwidget.cpp
> kledswitch.cpp
> trackwidget.cpp
> traxview.cpp
> traxiface.skel
> """
> 
> obj.cxxflags='-DQT_THREAD_SUPPORT'
> obj.libs='./soundcanvas/libsoundcanvas.a qt-mt
> kdecore kdeui kdeprint jack DCOP '
> obj.execute()
> **************************************
> 
> And heres
>
~/development/playground/trax/src/soundcanvas/SConscript:
> **************************************
> Import( 'env' )
> 
> # A static library
> stlib=env.kobject('staticlib')
> stlib.target='libsoundcanvas'
> stlib.source="""
> graph.cpp
> """
> stlib.cxxflags='-DQT_THREAD_SUPPORT'
> stlib.libs='qt-mt'
> stlib.execute()
> **************************************
> 
> The error message is:
> **************************************
> jonas@jw ~/development/playground/trax $ scons
> scons: Reading SConscript files ...
> scons: done reading SConscript files.
> scons: Building targets ...
> g++ -Wl,--rpath=/usr/qt/3/lib
> -Wl,--rpath=/kde-inst/kde-svn-3.4/lib/kde3
> -Wl,--rpath=/kde-inst/kde-svn-3.4/lib
> build/src/soundcanvas/libsoundcanvas.a -o
> build/src/trax build/src/jackbuf.o
> build/src/jackclient.o build/src/main.o
> build/src/pref.o build/src/trax.o
> build/src/graphwidget.o build/src/kledswitch.o
> build/src/trackwidget.o build/src/traxview.o
> build/src/traxiface_skel.o
> -L/kde-inst/kde-svn-3.4/lib -L/usr/qt/3/lib -lqt-mt
> -lkdecore -lkdeui -lkdeprint -ljack -lDCOP
> build/src/trackwidget.o(.text+0x1ef): In function
> `TrackWidget::TrackWidget[not-in-charge](QWidget*,
> char const*, unsigned)':
> : undefined reference to
> `Graph::Graph[in-charge](QWidget*, char const*,
> unsigned)'
> build/src/trackwidget.o(.text+0x4bf): In function
> `TrackWidget::TrackWidget[in-charge](QWidget*, char
> const*, unsigned)':
> : undefined reference to
> `Graph::Graph[in-charge](QWidget*, char const*,
> unsigned)'
> collect2: ld returned 1 exit status
> scons: *** [build/src/trax] Error 1
> scons: building terminated because of errors.
> **************************************
> If I leave  ./soundcanvas/libsoundcanvas.a
> out of the obj.libs statement, the result is exactly
> the same.
> If I delete the scons cache and the libsoundcanvas.a
> file, it gets rebuilt.
> If I change obj.libs to point to some bogus file, it
> complains.
> 
> I guess the ./soundcanvas/libsoundcanvas.a doesn't
> contain the symbols it should ???
> 
> What am I doing wrong?
> 
> 
> 
> 
> 
> One other thing:
> 
> The bksys manual only mentions one single thing
> about how 
> to organize sources in a directory tree:
> 
> > Probably due to the lack of support of files in
> subdirectories, 
> > one had to create static libraries in every
> directory containing sources with 
> > automake. This is not the case with bksys so it is
> <emphasis>not necessary 
> > to generate static libraries</emphasis>. If you
> ever needed to create a static 
> > library (static libraries use more memory than
> shared ones ..), KDEstaticlib is 
> > there for that purpose. The resulting .a file is
> not installed automatically.
> 
> OK, what does that actually mean?
> I look at other examples, rosegarden being one, and
> by taking a quick look 
> they use static libraries for this it seems.
> Does that statement "not necessary to generade
> static libraries" mean I can and should make 
> one big file of all my dirtree sources or does it
> just mean that I should make dynamic libraries?
> 
> Thanks.
> -- 
> Jonas Widarsson
> 
> tel: +46 271 152 00 - tel: +46 271 121 42
> (hemma/home) - gsm: +46 70 539 64 79
> MSN: jonas@widarsson.com ICQ: 72016688 jabber:
> jonas@widarsson.com
>  
> >> Visit
> http://mail.kde.org/mailman/listinfo/kde-devel#unsub
> to unsubscribe <<
> 


/* Thomas Nagy */


	

	
		
___________________________________________________________________________ 
Appel audio GRATUIT partout dans le monde avec le nouveau Yahoo! Messenger 
Téléchargez cette version sur http://fr.messenger.yahoo.com
 
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic