Mailing List Archive

libgcrypt, libgpg-error shared/dynamic libs under MinGW
Using MinGW and MSYS 1.0.10...

I'm trying to build libgpg-error, libgcrypt, and ultimately, libgnutls
as shared/dynamic libs under MinGW. It seems that if you want to
build a shared lib under MinGW, then it cannot have any undefined
symbols. So, I think if I could build libgpg-error as both static and
shared under MinGW, I'd be able to apply the solution to libgcrypt and
gnutls, too.

I've tried to compile libgpg-error-1.1 under MinGW and it says that it
can't create a shared lib with undefined symbols, and looking closer
it seems that the undefined symbol in question is "DllMainCRTStartup".
I've tried including various MinGW standard libs and none of them
seem to satisfy the linker.

Is there something I'm missing about building under MinGW? Does
anyone have any advice on how to build a libgpg-error and libgcrypt
without missing symbols under MinGW?

Thanks for any info, you'll be my best friend and everything.

jh
Re: libgcrypt, libgpg-error shared/dynamic libs under MinGW [ In reply to ]
On Wed, 3 Aug 2005 21:08:35 -0400, Jim Horvath said:

> Is there something I'm missing about building under MinGW? Does
> anyone have any advice on how to build a libgpg-error and libgcrypt
> without missing symbols under MinGW?

I have only build static libs for now. Will work on DLLs next week.


Shalom-Salam,

Werner
Re: libgcrypt, libgpg-error shared/dynamic libs under MinGW [ In reply to ]
Fantastic, thank you for your work!

On a related topic, do you know if gnutls 1.2.x can be built under MinGW yet?

jim




On 8/4/05, Werner Koch <wk@gnupg.org> wrote:
> On Wed, 3 Aug 2005 21:08:35 -0400, Jim Horvath said:
>
> > Is there something I'm missing about building under MinGW? Does
> > anyone have any advice on how to build a libgpg-error and libgcrypt
> > without missing symbols under MinGW?
>
> I have only build static libs for now. Will work on DLLs next week.
>
>
> Shalom-Salam,
>
> Werner
>
>
Re: libgcrypt, libgpg-error shared/dynamic libs under MinGW [ In reply to ]
On Thu, 4 Aug 2005 18:43:07 -0400, Jim Horvath said:

> Fantastic, thank you for your work!
> On a related topic, do you know if gnutls 1.2.x can be built under MinGW yet?

Sorry, I don't know.


Salam-Shalom,

Werner
RE: libgcrypt, libgpg-error shared/dynamic libs under MinGW [ In reply to ]
Jim,

Remember that in Windows there is no concept of a dynamic code library.
Dll's have an entry point that must be present. This is the same error as
"missing main" in a program, only for the dll entry point DllMain. See
this for an explanation:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sdkintro/sdkintro/calling_the_c_run_time_library_from_a_dll.asp

And this for a detailed description of the callback:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/dllmain.asp

For libgcrypt, this will just be a blank function, so you'll probably just
want to put a block like this somewhere convenient:

#ifdef WIN32
BOOL WINAPI DllMain( HINSTANCE hinstDLL,
DWORD fdwReason,
LPVOID lpReserved )
{
}
#endif

-Terrence Cole
www.trainedmonkeystudios.org

p.s. I'll see what would be involved in supporting the native VC6 compiler
at some point.