0

I create a DLL project.

Visual Studio 2019 doesn't define the MACRO HAZEL_EXPORTS (<ProjectName>_EXPORTS ). So I can't export/import my symbols. Any Help?

Here is my code:

#pragma once


// test.h // Project name is Hazel
#ifdef HAZEL_EXPORTS
#define API __declspec(dllexport)
#else
#define API __declspec(dllimport)
#endif



namespace Hazel
{
    API void Print();

}

enter image description here

CristiFati
  • 38,250
  • 9
  • 50
  • 87
chrischtel
  • 11
  • 2
  • 6
  • 1
    You are need to define `HAZEL_EXPORTS` in the project setting when exporting (building the DLL) and not define it when importing (using the DLL). `Configuration Properties > C++ > Preprocessor > Preprocessor Definitions` – Richard Critten Jun 17 '21 at 12:07
  • Might want to check https://stackoverflow.com/questions/44124452/excel-vba-cant-find-dll-entry-point-from-a-dll-file/44177222#44177222 – CristiFati Jul 01 '21 at 10:43

0 Answers0