[openbeos] Re: __declspec and static libraries

  • From: Bruno Albuquerque <bga@xxxxxxxxxxxxx>
  • To: openbeos@xxxxxxxxxxxxx
  • Date: Tue, 04 Dec 2007 12:37:58 -0200

Stefano D'Angelo wrote:

do __declspec(dllexport) and __declspec(dllimport) cause problems when
used to build/use a static library on Haiku? Should they be removed in
such case?
>>
AFAIK the __declspec stuff has no effect on BeOS and Haiku (at least with
gcc 2.95.3).

The BeBook doesn't seem to agree with you :-)
Look: http://www.beunited.org/bebook/The%20Kernel%20Kit/ImageConcepts.html

This is a left over from the PPC compiler. With ELF/GCC, all symbols are automatically exported by default.

And does anyone know if using autotools and libtool one should define
AC_LIBTOOL_WIN32_DLL on BeOS/Haiku too?
>>
I've no clue what this is, but it doesn't sound right.

Well, basically the __declspec stuff is the same you find on windows,
and the autoconf manual suggests using that macro.

Again, it was a left over from the mwcc compiler. You don need that with GCC on Haiku or BeOS.

I've done without it, but had to pass -no-undefined to libtool,
otherwise the shared library wouldn't build (inter-library
dependences).

Yes, that is expected. Under BeOS (and I guess haiku too) all symbols must be defined at linking time. It has nothing to do with the __declspec() stuff.

-Bruno


Other related posts: