Loadlibrary fails to load dll

前端 未结 7 2070
梦谈多话
梦谈多话 2021-02-10 01:18
    *******************UseDll1.cpp*********************

        #include 

typedef int (*function1_ptr) ();

function1_ptr function1=NULL;

int APIENTR         


        
相关标签:
7条回答
  • 2021-02-10 01:52

    In my dll calling experience, I had same problem. I did everything for giving path rightly but my library can not be loaded. Firstly I thought my dll had error, but nothing solved my problem at start. I advice doing below step for friends who think their project written rightly but still having same problem:

    1. Go to your DLL project and assure that you selected Multi-threaded Debug instead of Multi-thread(Debug) DLL(don't use dll because it uses some function from dll instead of embedding them inside) as runtime library(specially for debug mode). You can see runtime library selection under Property>Configuration Property>C/C++>Code Generation.
    2. After our DLL file is ok, we must ensure that our project uses right platform. If our dll uses x64, our project have to use x64. You can control it from configuration manager and you can select right one from platform box.

    After building project with right configuration, it is working now.

    0 讨论(0)
提交回复
热议问题