当前位置:网站首页>Failed to load DLL
Failed to load DLL
2022-07-26 01:06:00 【Miaowei】
Qt List of articles
List of articles
Preface
load dll Failure , Use Dependencies.exe see , Feeling is not related to lack dll
In the use of Qt Call others to write dll, Failed to load all the time . Use windeployqt.exe Command packaging always fails 
PS E:\osg\work\CARTDLL_demo_20220520\CallCartDll> D:\Qt\Qt5.12.9\5.12.9\msvc2017_64\bin\windeployqt.exe CallCartDll.exe
“CallCartDll.exe” does not exist.
PS E:\osg\work\CARTDLL_demo_20220520\CallCartDll> cd E:\osg\work\CARTDLL_demo_20220520\CallCartDll\debug
PS E:\osg\work\CARTDLL_demo_20220520\CallCartDll\debug> D:\Qt\Qt5.12.9\5.12.9\msvc2017_64\bin\windeployqt.exe CallCartDll.exe
E:\osg\work\CARTDLL_demo_20220520\CallCartDll\debug\CallCartDll.exe 64 bit, debug executable
E:\osg\work\CARTDLL_demo_20220520\CallCartDll\debug\CallCartDll.exe does not seem to be a Qt executable.
PS E:\osg\work\CARTDLL_demo_20220520\CallCartDll\debug>
Two 、 terms of settlement
1. install Anaconda3 edition -2021.05-Windows-x86_64
2. Set up Anaconda3 Environment variables of 
#include <QCoreApplication>
#include <iostream>
#include "windows.h"
using namespace std;
#pragma comment(lib,"CartDll.lib")
typedef double (*cartfun)(int *itype,int *katmod,int *ikaerosol,int *ikheight,float *iseah,float *ivis,float *irh,
float *wmintemp,float *wmaxtemp,float *avertrans,float *pathradiance, float *totalradiance);
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
HINSTANCE hlib=LoadLibrary(TEXT("CartDll.dll"));
if(!hlib)
{
cout<<"open dll error!"<<endl;
}
else
{
cout<<"open dll sucess!"<<endl;
}
cartfun cart1=(cartfun)GetProcAddress(hlib,"cart");
if(!cart1)
{
cout<<"load CART FUN add error!"<<endl;
}
else
{
cout<<"load CART FUN add sucess!"<<endl;
}
int iType = 3; // Calculation mode
int iKatmod = 22; // Atmospheric model
int iKaerosol = 1; // Aerosol type
int iKheight = 0; // Aerosol height model
float fSeah = 0.0; // Surface elevation
float fVis = 34.0; // visibility
float fRh = 65.0; // Relative humidity
float fWmintemp = 400.0; // Calculate the initial wave number
float fWmaxtemp = 40000.0; // Calculate the cut-off wave number
float fAvertrans;
float fTotalradiance;
float pathradiance;
cart1(&iType,&iKatmod,&iKaerosol,&iKheight,&fSeah,&fVis,&fRh,&fWmintemp,&fWmaxtemp,&fAvertrans,&pathradiance,&fTotalradiance);
cout<<" fAvertrans = "<<fAvertrans<<endl;
cout<<" fTotalradiance = "<<fTotalradiance<<endl;
cout<<" pathradiance = "<<pathradiance<<endl;
cout << "Hello World!" << endl;
std::system("pause");
return a.exec();
}
summary
It was written by others dll It's useful to python Dependent package , So we need to Anaconda3 Configure the path to the environment variable 
边栏推荐
- el-table滚动条设置
- It will be easier to implement MES system by doing well in these four stages
- [RTOS training camp] I2C and UART knowledge and preview arrangement + evening class questions
- Fundamentals of MATLAB shift operation
- REST-assured接口测试框架详解
- Using questpdf operation to generate PDF is faster and more efficient!
- pip install --upgrade can‘t find Rust compiler
- AI knows everything: build and deploy sign language recognition system from 0
- 嵌入式开发:技巧和窍门——设计强大的引导加载程序的7个技巧
- 1.30 upgrade bin file, add suffix and file length
猜你喜欢

Sqli-labs Less7

腾讯员工晒出薪资:真实985毕业薪资,大家看我还有救吗?网友:日薪?

android sqlite先分组后排序左连查询
![[CTF] crypto preliminary basic outline](/img/a9/bbaff7a23396dff4e486d5cd026b31.png)
[CTF] crypto preliminary basic outline

动态IP地址是什么?为什么大家会推荐用动态ip代理?

Inverse matrix block matrix

The difference and application of in and exists in SQL statement

ZK-Rollups工作原理

How to choose social e-commerce model in the early stage? Taishan crowdfunding

游戏思考17:寻路引擎recast和detour学习二:recast导航网格生成流程及局限性
随机推荐
The ultra comprehensive open source WinForm UI library meets all your desktop development needs!
[RTOS training camp] operation explanation, queue and ring buffer, queue - transmission data, queue - synchronization tasks and evening class questions
el-table滚动条设置
Spine_附件皮肤
MySQL pymysql operation
Gcdqueue encapsulation
聊聊研发团队中的“人”
【RTOS训练营】作业讲解、队列和环形缓冲区、队列——传输数据、队列——同步任务和晚课提问
游戏思考17:寻路引擎recast和detour学习二:recast导航网格生成流程及局限性
什么是信息化?什么是数字化?这两者有什么联系和区别?
《暗黑破坏神:不朽》手游如何多开搬砖及新手入门搬砖攻略
[RTOS training camp] I2C and UART knowledge and preview arrangement + evening class questions
El table scroll bar settings
matlab 移位操作基础
场景之分页查询设计
编程学习过程中有哪些快速提高编程技巧的方法?
用 QuestPDF操作生成PDF更快更高效!
如何mysql只要重复数据?
Jupyter changes the main interface and imports the dataset
jupyter更改默认浏览器的方法