CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Threaded View

  1. #1
    John E is offline Elite Member Power Poster
    Join Date
    Apr 2001
    Location
    Manchester, England
    Posts
    4,867

    Exporting a typedef'd symbol

    A 3rd-party DLL I'm compiling contains the following class (in abbreviated form):-

    Code:
    class __declspec(dllexport) ChordProvider
    {
      public:
        ChordProvider () {}  // <--- This gets exported okay
    
        typedef std::map<std::string,Intervals> ChordNameToIntervals;
        static ChordNameToIntervals tet12_chords; // <--- tet12_chords doesn't get exported
    };
    The typedef'd symbol doesn't get exported for some reason. Is that fixable?

    [Edit...] I tried a few searches via Google / StackOverflow etc and the consensus seems to be that typedefs are compile time objects which should be accessible from outside the DLL without needing to get exported - but I must admit, that's not what I'm seeing here

    [Update...] Adding this line to the corresponding cpp file fixed the problem

    Code:
    __declspec(dllexport)  ChordProvider::ChordNameToIntervals ChordProvider::tet12_chords;
    Last edited by John E; April 14th, 2026 at 01:19 PM.
    "A problem well stated is a problem half solved.” - Charles F. Kettering

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured