[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-devel
Subject: Re: Makefile.am: moc-files get not linked in
From: Bjoern Kahl <Bjoern.Kahl () kiel ! netsurf ! de>
Date: 2000-04-19 20:18:20
[Download RAW message or body]
Hallo !
On 19-Apr-00 Stephan Kulow wrote:
> Bjoern Kahl wrote:
> >
> > Hallo !
> >
> > I want to compile some files into an executable and in addition put
> > some of the object-files in a shared lib too.
> > Using the Makefile.am below, all files gets compiled, the moc-files
> > gets generated and compiled to, but only linked in the lib, *not*
> > in
> > the executable. What do I wrong ?
> >
> > ----8<--- Makefile.am ---8<----
> > bin_PROGRAMS = KNetMgr
> > lib_LTLIBRARIES = libknetmgr.la
> >
> > # I need my own includefiles
> > INCLUDES = $(all_includes) -I../netmgrd/lib
> >
> > # the library search path.
> > KNetMgr_LDFLAGS = $(KDE_RPATH) $(all_libraries)
> > libknetmgr_la_LDFLAGS = $(KDE_RPATH) $(all_libraries)
> >
> > # the libraries to link against.
> > KNetMgr_LDADD = ../netmgrd/lib/libnetmgr.la $(LIB_KDEUI)
> > libknetmgr_la_LIBADD = ../netmgrd/lib/libnetmgr.la \
> > -version-info 1:0:0 -module
> >
> > # which sources should be compiled for KNetMgr
> > KNetMgr_SOURCES = KNetMgr.cpp KNetMgr_class.cpp KNetMgr_dlg.cpp
> > #libknetmgr_la_SOURCES = KNetMgr_class.cpp
> >
> > # some headers
> > noinst_HEADERS = KNetMgr_class.h KNetMgr_dlg.h
> >
> > # let automoc handle all of the meta source files (moc)
> > METASOURCES = AUTO
> > ---->8--- Makefile.am --->8----
> >
> > If I comment out all libknetmgr-related lines in the file above,
> > every thing works well.
> > If I use the file above, then I see the moc-files in the
> > linker-call makeing libknetmgr.la, but not in the linker-call
> > making KNetMgr.
> >
> Well, the reason is simple. Don't use "METASOURCES = AUTO" if you
> 1. have more than one program/library per Makefile
> 2. don't add #include "moc" statements to your sources
> Fixing one point of this will heal your problem. The other way is to
> add METASOURCES = KNetMgr_class.moc.cpp and add these to your
> _SOURCES
> too, but this adds a lot of problems
Hallo!
Thanks for the fast answer.
But, I dont have "#include "moc" statements. I only include the header,
no generated code.
If I dont use "METASOURCES = AUTO", but
"METASOURCES = KNetMgr_class.moc.cpp ...",
gets KNetMgr_class.moc.cpp et.al. still automaticaly generated
from the header-files ?
BTW: Where to find doku/tutorials about kde's autoconfig stuff?
I have read the infofile for autoconf/automake, but want to
know how things work in kde, what tags are defined etc.
(More precise: how to look for extra libs (hacked an own
configure.in.in, but not sure if its correct)?
How to install a lib/executable out of kde-install-tree (using
an configure-option) ?
Greetings, Bjoern
--
+-----------------------------------------------------------------------+
| Björn Kahl ++ Max-Planck-Str.26 ++ 24211 Preetz ++ (ISDN) 04342 76882 |
+-----------------------------------------------------------------------+
Weitergabe und/oder gewerbliche Nutzung meiner Adresse/TeleNr untersagt.
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic