Re: how to export global variable in C dll?



On Apr 10, 11:27 am, "Alex Blekhman" <tkfx.REM...@xxxxxxxxx> wrote:
"Cyrfer" wrote:
Your reply was very helpful.

You're welcome. :)

Well, I thought I was done, but not completely.

My DLL's implementation has problems now that I tried to make a 2nd
implementation file in the DLL "touch" the global variables. Now the
DLL will not link. The problem is probably because I am not using
'extern', which also causes my DLL not to link. I'm really confused
about what is happening. I have made a simple MSVC 2005 project which
shows the problem. You can find the short code sample here:

http://cyrf.com/temp/test_linking.zip

Would someone show that it is possible to export global variables?
Thanks!
.



Relevant Pages

  • Re: Exportable class functions as stand alone functions to .DLL or .SO
    ... > 1) An existing application loads a DLL or SO and is looking for a ... > created a global function. ... > create a DLL or SO ...
    (comp.lang.cpp)
  • Re: Queries about DLL Exports
    ... global variables for use it. ... dll with out redefining?Macros are for use at compile-time, so #define them within your project. ... shared memory concept in dll? ... makes header file for Exporting things from dll in other project.Look up __declspec dllexport and dllimport. ...
    (microsoft.public.vc.language)
  • Re: convert an MFC application to MFC DLL
    ... This suggests that there are too many global variables. ... All the header files which contain extern ... Once the variables are in the DLL, they cannot be accessed by the main program. ... The whole notion that there is a "single" main.cpp which contains the declarations of the ...
    (microsoft.public.vc.mfc)
  • Re: Using TLSAlloc to read data into a DLL
    ... DLL_PROCESS_ATTACH, as you indicate. ... etc. to be able to do this - that global variables are not ...     Igor Tandetnik ...
    (microsoft.public.vc.language)
  • Re: Queries about DLL Exports
    ... global variables for use it. ... global variable from dll? ... shared memory concept in dll? ... makes header file for Exporting things from dll in other project. ...
    (microsoft.public.vc.language)