DLL loads the method that sets the relative path

  • 2020-06-07 05:02:50
  • OfStack

When DLL is loaded, the relative path is set as follows:

1. Load dll method 1 :(./ represents the current directory,.. Contains the relative path of the header file (the current path is the source code path, the path ".. /.. / "Current project folder parent directory), link to relative path of lib file (current project folder".. \\ ", where you need to change the character \). If project 1 depends on Project 2 (right-click project 1, click Project Dependence, and check The box dependent On Project 2), project 1 will be automatically built when building project 1. And what project 2 builds will be in Debug for current project 1. Export dll file: available keyword _declspec(dllexport); Or def file definition.

Note: When exporting dll with _declspec(dllexport) character, each function and class is a module. When exporting, _declspec(dllexport) character (namely module export keyword) should be added before the function/class name.

conclusion


Related articles: