关于dll载入的有关问题
关于dll载入的问题
用vs2008写了一个win32的dll,在调用它的项目中导入了.h .lib .dll.并且是在正确的路径下,dll中有导出的函数,并且也导入了头文件,和.lib
#include "Data.h"
#pragma comment(lib,"Data.lib")
其他都是VS默认的,都没有变化。
问,无法打开文件“Data.lib” 的错误怎样解决?
求大侠指教。
------解决方案--------------------
把lib文件拷到工程目录下即可。
或者在visual studio选项中,lib目录配置中,增加你lib文件所在的目录路径。
------解决方案--------------------
------解决方案--------------------
comment
#pragma comment( comment-type [, commentstring] )
Places a comment record into an object file or executable file. The comment-type is one of five predefined identifiers, described below, that specify the type of comment record. The optional commentstring is a string literal that provides additional information for some comment types. Because commentstring is a string literal, it obeys all the rules for string literals with respect to escape characters, embedded quotation marks ("), and concatenation.
lib
Places a library-search record in the object file. This comment type must be accompanied by a commentstring parameter containing the name (and possibly the path) of the library that you want the linker to search. Since the library name precedes the default library-search records in the object file, the linker searches for this library just as if you had named it on the command line. You can place multiple library-search records in the same source file; each record appears in the object file in the same order in which it is encountered in the source file.
------解决方案--------------------
问得好
------解决方案--------------------
用vs2008写了一个win32的dll,在调用它的项目中导入了.h .lib .dll.并且是在正确的路径下,dll中有导出的函数,并且也导入了头文件,和.lib
#include "Data.h"
#pragma comment(lib,"Data.lib")
其他都是VS默认的,都没有变化。
问,无法打开文件“Data.lib” 的错误怎样解决?
求大侠指教。
------解决方案--------------------
把lib文件拷到工程目录下即可。
或者在visual studio选项中,lib目录配置中,增加你lib文件所在的目录路径。
------解决方案--------------------
------解决方案--------------------
comment
#pragma comment( comment-type [, commentstring] )
Places a comment record into an object file or executable file. The comment-type is one of five predefined identifiers, described below, that specify the type of comment record. The optional commentstring is a string literal that provides additional information for some comment types. Because commentstring is a string literal, it obeys all the rules for string literals with respect to escape characters, embedded quotation marks ("), and concatenation.
lib
Places a library-search record in the object file. This comment type must be accompanied by a commentstring parameter containing the name (and possibly the path) of the library that you want the linker to search. Since the library name precedes the default library-search records in the object file, the linker searches for this library just as if you had named it on the command line. You can place multiple library-search records in the same source file; each record appears in the object file in the same order in which it is encountered in the source file.
------解决方案--------------------
问得好
------解决方案--------------------