[CMake] Creating libraries (DLL) in windows

Leopold Palomo Avellaneda leo at alaxarxa.net
Fri Aug 1 19:29:17 EDT 2008


A Dissabte 02 Agost 2008, Hendrik Sattler va escriure:
> Am Samstag, 2. August 2008 01:21:01 schrieb Leopold Palomo Avellaneda:
> > A Dissabte 02 Agost 2008, Hendrik Sattler va escriure:
> > > Am Samstag, 2. August 2008 00:41:11 schrieb Leopold Palomo Avellaneda:
> > > > I understand that you have to add:
> > > >
> > > >  class MYLIB_EXPORT MyClass
> > > >
> > > > for all the classes,
> > > > but also for the structs , and functions?
> > >
> > > If a class is exported,  its member functions also get exported. For
> > > non-member function, this must also be added. Structs and classes are
> > > roughly the same in C++ (different initialisation) but unless they
> > > include functions (not function pointers), the do not need to be
> > > exported (you don't link to it).
> > >
> > > BTW: With gcc >= 4 on linux, you may also want to use
> > > #define MYLIB_EXPORT __attribute__((visibility("default")))
> > > and compile with -fvisibility=hidden. That allows to not export symbols
> > > for internal classes and it's faster at runtime.
> >
> > faster in terms of?
>
> Time to link the library at application start.

because when the program loads, search in a list of less symbols, so it finds 
its faster making start is less time ....

good point, thanks.

Leo


-- 
--
Linux User 152692
PGP: 0xF944807E
Catalonia
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
URL: <http://www.cmake.org/pipermail/cmake/attachments/20080802/8457f8e9/attachment-0001.pgp>


More information about the CMake mailing list