This is the mail archive of the cygwin@sources.redhat.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

libtool


I went and tried libtool after the post that libtool supported dll
creation...

I have a problem with the dll creation from libtool 1.3.4 and 1.3.5. I know
this isn't the libtool list.. but this is a cygwin specific issue..

I have applied the dll_entry patch for cygwin 1.1.4 (which I am running).

The error reported from make is:
---
 test -f .libs/libglib-1-2-0-0-8.dll-ltdll.o || (cd .libs && gcc -c
libglib-1-2-
0-0-8.dll-ltdll.c)
libglib-1-2-0-0-8.dll-ltdll.c:23: conflicting types for `DllMain'
libglib-1-2-0-0-8.dll-ltdll.c:16: previous declaration of `DllMain'
libglib-1-2-0-0-8.dll-ltdll.c:23: conflicting types for `_cygwin_dll_entry'
libglib-1-2-0-0-8.dll-ltdll.c:23: previous declaration of
`_cygwin_dll_entry'
libglib-1-2-0-0-8.dll-ltdll.c:30: conflicting types for `DllMain'
libglib-1-2-0-0-8.dll-ltdll.c:23: previous declaration of `DllMain'
---

libglib-1-2-0-0-8.dll-ltdll.c is as follows
---
/* ltdll.c starts here */
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#undef WIN32_LEAN_AND_MEAN
#include <stdio.h>
#
#ifndef __CYGWIN__
#  ifdef __CYGWIN32__
#    define __CYGWIN__ __CYGWIN32__
#  endif
#endif

#ifdef __cplusplus
extern "C" {
#endif
BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
#ifdef __cplusplus
}
#endif

#ifdef __CYGWIN__
#include <cygwin/cygwin_dll.h>
DECLARE_CYGWIN_DLL( DllMain );
#endif

HINSTANCE __hDllInstance_base;
#
BOOL APIENTRY
DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
{
  __hDllInstance_base = hInst;
  return TRUE;
}
/* ltdll.c ends here */
---

if I change the *ltdll.c file to
--
/* ltdll.c starts here */
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#undef WIN32_LEAN_AND_MEAN
#include <stdio.h>
#
#ifndef __CYGWIN__
#  ifdef __CYGWIN32__
#    define __CYGWIN__ __CYGWIN32__
#  endif
#endif
#ifndef __CYGWIN__
#ifdef __cplusplus
extern "C" {
#endif
BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
#ifdef __cplusplus
}
#endif
#else
#ifdef __CYGWIN__
#include <cygwin/cygwin_dll.h>
//DECLARE_CYGWIN_DLL( DllMain );
#endif
#endif
HINSTANCE __hDllInstance_base;
#
int  WINAPI
DllMain (HANDLE h, DWORD reason, void *ptr)
{
  __hDllInstance_base = h;
  return TRUE;
}
/* ltdll.c ends here */
--

it compiles the dll, .la, .lai files ok.
but.. I get a reports of syntax error in the def file, and application
compiled to use the library get undefined references to the functions in
it - which I thought libtool was meant to handle...


I'll happily go bug the libtool lists if that's appropriate..
Rob


--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]