bug-libtool
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

ltdl, -ansi compiler flag and windows host


From: Roumen Petrov
Subject: ltdl, -ansi compiler flag and windows host
Date: Sat, 14 Nov 2009 20:14:12 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.23) Gecko/20090907 SeaMonkey/1.1.18

Hi All,

The failed case if project with ltdl included. If the project is configured with "-ansi" flag set to CFLAGS the build of installable ltdl fail with:
=======================================================
libtool: link: XXX-gcc -shared ....-Xlinker .libs/libltdl.dll.a
.libs/libltdl.lax/loadlibrary.a/loadlibrary.o:loadlibrary.c:(.text+0x115): undefined reference to `_SetErrorMode' .libs/libltdl.lax/loadlibrary.a/loadlibrary.o:loadlibrary.c:(.text+0x122): undefined reference to `_SetErrorMode' .libs/libltdl.lax/loadlibrary.a/loadlibrary.o:loadlibrary.c:(.text+0x12a): undefined reference to `_LoadLibraryA' .libs/libltdl.lax/loadlibrary.a/loadlibrary.o:loadlibrary.c:(.text+0x134): undefined reference to `_SetErrorMode' .libs/libltdl.lax/loadlibrary.a/loadlibrary.o:loadlibrary.c:(.text+0x263): undefined reference to `_GetModuleFileNameA' .libs/libltdl.lax/loadlibrary.a/loadlibrary.o:loadlibrary.c:(.text+0x280): undefined reference to `_FreeLibrary' .libs/libltdl.lax/loadlibrary.a/loadlibrary.o:loadlibrary.c:(.text+0x2c5): undefined reference to `_GetProcAddress'
Creating library file: .libs/libltdl.dll.a
=======================================================

It seems to me problem is in lt__private.h:
====================================
#ifndef __attribute__
# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8) || __STRICT_ANSI__
#  define __attribute__(x)
# endif
#endif
====================================

When -ansi is set compiler define __STRICT_ANSI__.
__attribute__ is not defined and the code define it.
Next is problem for GCC on windows host as stdcall is defined and __attribute__((__stdcall__)) and result is the functions lost stdcall, dllexport and other decorations.

No idea how to fix and I don't know reasons for above expression. Why __STRICT_ANSI__ is part of expression ?

If the above code is removed(commented) the build succeed.

Regards,
Roumen




reply via email to

[Prev in Thread] Current Thread [Next in Thread]