Experts please: defining DllMain in static library

G

Guest

Hi,

Is it possible to define DllMain in a static library for use in dlls? The
reason is that I am defining a platform abstraction for being loaded as a
shared library and I figured the simplest way is to implement DllMain in a
static library, which then calls mydllmain.

I define this library (call it platform.lib) which has DllMain implemented
with what should be unresolved references to mydllmain. I then link it into a
bunch of dll's. Unfortunately, this doesn't work as the linker doesn't
include platform.lib's version of DllMain.

I have explored all the linker flags, but I am lost on this one. I have also
added DllMan to the EXPORTS section of the .def file in the hope that may
force the linker to look in my static library for the symbol.

Can someone please help? I don't see any clean way to do this without
passing around some object filenames (which is why archive libraries were
invented!)

Thanks!
 
G

Guest

Sean Connery said:
Hi,

Is it possible to define DllMain in a static library for use in dlls? The
reason is that I am defining a platform abstraction for being loaded as a
shared library and I figured the simplest way is to implement DllMain in a
static library, which then calls mydllmain.

Argh! /include:_DllMain@12
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top