DLL不断获取“未找到dll".在Windows 7中 [英] DLL keeps on getting "dll not found" in Windows 7

查看:111
本文介绍了DLL不断获取“未找到dll".在Windows 7中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

出于某些原因,我在Windows 7中不断获取找不到dll".我正在使用Visual C ++ 2010 express和V5.0 Mysql connection/c api.我有一个以下的dll项目.编译的所有内容均带有适用于mysql的正确include/lib.但是,每当我尝试访问fntestdll函数时,都会显示找不到dll".我把它放在c:\ windows \ system32以及c:\ windows \ syswow64中,但似乎没有什么不同.我做错了什么?

Hello,

For some reason, I keep on getting "dll not found" in Windows 7. I am using Visual C++ 2010 express along with V5.0 Mysql connection/c api. I have a dll project with the following. Everything compiles find with the correct include/lib for mysql. However, whenever I try to access the fntestdll function, I get "dll not found". I have put it in c:\windows\system32 and also c:\windows\syswow64 but nothing seems to make a difference. What am I doing wrong?

/********************   testdll.cpp file************************/
#include "stdafx.h"
#include "testdll.h"
#include <stdio.h>
#include <stdlib.h>
#include <WinSock.h>
#include <iostream>
#include <c:/mysql/include/mysql.h>

using namespace std;
MYSQL *connection, mysql;

TESTDLL_API int fntestdll(void)
{
    mysql_init(&mysql);
    return 0;
}





/************************** Testdll.h file*****************************/
#define TESTDLL_API __declspec(dllexport)

TESTDLL_API int fntestdll(void);

推荐答案

我要尝试的第一件事是将mysql DLL与您自己的DLL放在同一目录中.然后,我将使用一个dll依赖遍历器 [
The first thing I''d try is placing the mysql DLL in the same directory as your own DLL. Then I would use a dll dependency walker[^] to check that your DLL can find other DLLs on which it depends.


您的dll是否在路径中?如果不是,那是您的问题.
Is your dll in the path? If not, that is your problem.


可能是因为库没有清单?
May be problem is that library has no manifest?


这篇关于DLL不断获取“未找到dll".在Windows 7中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆