|
From: Stefan B. <sb...@sb...> - 2005-10-30 13:02:16
|
Brian Dessent wrote: > Stefan Bellon wrote: > > Ok, I see. However, this doesn't work if the foo.exe itself depends > > on the DLL. So, circular dependencies are impossible, correct? [snip] Thanks, this is _very_ valuable information. > > > 2) Look up the symbol at runtime. Read up on GetProcAddress() and > > > GetModuleHandle(). > > > > And how would I link the DLL itself using this second approach? > If you use GetProcAddress then you are doing run-time (sometimes > called dynamic) linking - the analogy to dlopen()/dlsym() on *nix. > This means that all calls to imported routines go through function > pointers and there are no symbols to resolve at link-time, because > the linker has no knowledge of what you're doing. Yes, I pretty much understand all of that. But in your example you assume the DLL "foo.dll" to exist. My question is: How do I _create_ this foo.dll? At present I cannot build the DLL because of undefined references back into the main program. So, even with this second approach originally mentioned I do have to create an import library for the main .exe in order to build that DLL at all. Right? -- Stefan Bellon |