如何在应用程序中添加include .dll / .lib? [英] How to add include .dll/.lib in application??

查看:78
本文介绍了如何在应用程序中添加include .dll / .lib?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hello Friends,

Hello Friends,

我创建了一个应用程序作为单独的项目和API作为单独的项目。我的应用程序包含API中定义的某些功能,API将调用驱动程序。我能够创建.dll的API,但是当我构建我的应用程序时,它会生成
,缺少相应的fxn定义的某些构建错误。所以,我需要一种机制,这样我可以包含相应的.dll包含fxs的定义,包含在应用程序中,以便我可以在构建
之后生成.exe应用程序......

I have created one application as a separate project and API as a separate project. My application contains certain function that is defined in API and that API will call driver. I am able to create .dll of API but when I build my application it generates certain building errors about the corresponding fxn definition is missing.. So, i need a mechanism in such a way the I can include corresponding .dll that contains the definition of the fxs, to include in application so that i can generated .exe after building the application ......

或者(首选项)

或者,有些事情就是我的应用程序成功构建,并且在运行期间将直接显示.dll

Or, Some thing like that my application build successfully and it will directly .dll during the time of running

我还包括.dll文件来源如下所示

I am also including .dll file in the sources as shown below

RELEASETYPE=LOCAL
_ISVINCPATH=$(_WINCEROOT)\public\common\sdk\inc;
_OEMINCPATH=$(_WINCEROOT)\public\common\oak\inc;$(_WINCEROOT)\public\common\sdk\inc;
TARGETNAME=GPIO
FILE_VIEW_ROOT_FOLDER= \
    ReadMe.txt \
    StdAfx.cpp \
    prelink.bat \
    postlink.bat \

FILE_VIEW_RESOURCE_FOLDER= \

FILE_VIEW_INCLUDES_FOLDER= \
    StdAfx.h \
    gpio.h \

SOURCES= \
    GPIO.cpp \

TARGETLIBS= \
    $(SG_OUTPUT_ROOT)\sdk\lib\$(_CPUINDPATH)\coredll.lib \

INCLUDES= \
	PHYTEC_GPIO_APP.dll \

PRECOMPILED_PCH=StdAfx.pch
PRECOMPILED_CXX=1
PRECOMPILED_OBJ=StdAfx.obj
PRECOMPILED_INCLUDE=StdAfx.h
TARGETTYPE=PROGRAM
POSTLINK_PASS_CMD=postlink.bat
PRELINK_PASS_CMD=prelink.bat
FILE_VIEW_PARAMETER_FOLDER= \
    GPIO.bib \
    GPIO.reg \
    GPIO.dat \
    GPIO.db \
    ProjSysgen.bat \




仍显示错误a s

应用程序中存在的所有函数的未解析外部符号,如下所示...

unresolved external symbol for all the function that is present in the application as shown below ...

hGPIO = Init_GPIOAPI(lcl_pinval);

及其相应的定义在API和API的.dll中已成功生成

and its corresponding definition is in API and the .dll of API is generated successfully

HANDLE Init_GPIOAPI(int frml_pinval)
{
		
	
		hDriver = CreateFile(TEXT("GIO1:"),GENERIC_READ|GENERIC_WRITE,
							FILE_SHARE_READ|FILE_SHARE_WRITE, 
							NULL, OPEN_EXISTING, 0, 0 );
		
		
		return hDriver;

}

推荐答案

您好Partap,

Hi Partap,

您可以准确地发布错误信息。

You can post exact error what you are getting.

包括make它喜欢,

INCLUDES =


(INCLUDES); \
---必需文件--- \
(INCLUDES); \ ---required files--- \

也为包含文件的上方提供特定路径,而不仅仅是dll名称。

give specific path also for above where your include files are present, not just dll name.

类似的东西,


(_ PLATFORMROOT)\ commmon \ src \ INC; \
(_PLATFORMROOT)\common\src\inc; \

并确保您链接到TARGETLIBS下的足够资料,

and make sure that you are linking to enough stuffs under TARGETLIBS,

再次检查。

Shan_k。


这篇关于如何在应用程序中添加include .dll / .lib?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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