[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-devel
Subject: Re: Working with global functions in KDE4
From: alexandrm <alexandrm77 () gmail ! com>
Date: 2007-08-22 9:30:50
Message-ID: 12271165.post () talk ! nabble ! com
[Download RAW message or body]
Hi David,
Thank you very much for your help.
I added KDE_EXPORT in front of the function declarations
and this resolved my compilation problems.
Alexandr
David Faure-2 wrote:
>
> On Monday 20 August 2007, alexandrm wrote:
> >
> > Hi,
> >
> > I'm porting existing library from KDE3 to KDE4 (library1).
> > It has several global functions which are located in one of the header
> > files. For example, file1.h:
> >
> > #ifndef __INC_FILE1_H_
> > #define __INC_FILE1_H_
> >
> > bool globalFunction1();
> > int globalFunction2();
> > bool globalFunction3(const QString& _value);
> >
> > #endif
> >
> > File named file1.cpp contains implementation of the global functions.
> > I created CMakeLists.txt file and compiled my library(library1) without
> > any
> > errors.
> >
> > When I tried to compile library2 which is using library1 I got the
> > following
> > errors:
> >
> > undefined reference to 'globalFunction1'
> > undefined reference to 'globalFunction2'
>
> You might have to export those functions, we use hidden-visibility now
> with gcc versions that support it.
> Add KDE_EXPORT in front of the function declarations, or if you care about
> this code linking on Windows
> as well, use kde_generate_export_header (from kdesdk/scripts trunk) to
> create a macro that is specific to that library.
>
> --
> David Faure, faure@kde.org, sponsored by Trolltech to work on KDE,
> Konqueror (http://www.konqueror.org), and KOffice
> (http://www.koffice.org).
>
> > > Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to
> > > unsubscribe <<
>
>
--
View this message in context: \
http://www.nabble.com/Working-with-global-functions-in-KDE4-tf4298522.html#a12271165 \
Sent from the kde-devel mailing list archive at Nabble.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