|
From: Stefan B. <sb...@sb...> - 2005-10-29 09:37:39
|
Coming from the GNU/Linux side and now having to port my application across to Windows, I have two fundamental questions in understanding DLLs opposed to shared objects (.so) under GNU/Linux. 1) If I have global variables in a DLL (ie. the DLL is not stateless) and several applications make use of the DLL simultaneously, do they operate on the same data or has each application an own instance of the DLL's global data? I hope the latter is the case. 2) On GNU/Linux, I have one project where one shared object refers back to symbols of the main application. When linking that .so file with gcc -shared, that's no problem. When linking the main application, the library is given on the command line with the -L/-l switches and linking works. The undefined references from the .so are resolved using the main application. Now, when trying to build the same on Windows (using gcc -shared as well), the DLL doesn't even build but throws errors of "undefined references". I want those to get resolved when linking against the main application. Is such a set-up not possible on Windows? Can't symbols in a DLL refer back to the main application? (And yes, I know that I can have a register function and let the DLL know the functions of the main applications via callbacks, but that's not what I want.) -- Stefan Bellon |