This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

forcing link against a dll on win32 cygwin


hi,

I have a dll and an executable. The dll contains quite a bit of API and
code which are usually used by other libraries, but, in this case, the
main executable is not interested in the API. The main executable just
wants to load the dll in memory and make sure that the dll's init and
fini entry points are executed.

So, there are a number of options: 
  - from the executable, do a dlopen at runtime to load the dll
  - call one of the many functions of the dll API to make sure that the
dll will be mapped in memory
  - rework the code to make the dll export an explicit initialization
function and call that function from every client

Clearly, what I am after is a solution which just adds more crap to my
build system without impacting the source code so, I wonder if it is
possible to force my linker to record a dependency between the main
binary and the dll even though there are no symbols imported and, if I
were to be able to record that dependency, if the resulting piece of
crap would work. I think that I am trying to do something evil but, I
can't make myself feel ashamed about it :/

Mathieu


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