快出来!!!
我是一个新手,刚做了一个最简单的程序,结果都没运行出来,真是郁闷啊!!在VC环境在编译出错提示为: fatal error C1004: unexpected end of file found
这是怎么回事啊???问题出在哪了??那些库文件我都包括进去了啊,请高手指教,谢谢
我的程序:<BR>#include<rxregsvc.h><BR>#include<aced.h><BR>#include<adslib.h><BR>#include "rxdlinkr.h"<BR>void initAPP();<BR>void unloadAPP();<BR>void HELLOARX();<BR><A href="file://执/" target="_blank" ></A><A href="file://执/" target="_blank" >执</A>行函数,在AUTOCAD中执行HELLOARX命令是被调用<BR>void HELLOARX()<BR>{<BR> acutPrintf("hello,object2000.");<BR>}<BR><A href="file://初/" target="_blank" ></A><A href="file://初/" target="_blank" >初</A>始化函数<BR>void initAPP()<BR>{<BR> acutPrintf("\n初始化函数\n");<BR> acedRegCmds->addCommand("HELLO_COMMANDS","HELLOARX","HELLOARX",<BR> ACRX_CMD_MODAL,HELLOARX);<BR>}<BR>void unloadAPP()<BR>{<BR> acutPrintf("\n卸载函数\n");<BR> acedRegCmds->removeGroup("HELLO_COMMANDS");<BR>}<BR>extern"C" AcRx::AppRetCode<BR>acrxEntryPoint(AcRx::AppMsgCode msg, void* appid)<BR>{<BR> switch (msg)<BR> { <BR> case AcRx::kInitAppMsg:<BR> acrxDynamicLinker->unlockApplication(appid);<BR> acrxDynamicLinker->registerAppMDIAware(appid);<BR> initAPP();<BR>break;<BR> case AcRx::kUnloadAppMsg:<BR> unloadAPP();<BR> break;<BR> return AcRx::kRetOK;<BR>}<BR> 提示为: fatal error C1004: unexpected end of file found
该提示往往是由于括号不匹配,你这里是末尾少了括号 } acrxEntryPoint(AcRx::AppMsgCode msg, void* appid)<BR>{<BR> switch (msg)<BR> { <BR> case AcRx::kInitAppMsg:<BR> acrxDynamicLinker->unlockApplication(appid);<BR> acrxDynamicLinker->registerAppMDIAware(appid);<BR> initAPP();<BR>break;<BR> case AcRx::kUnloadAppMsg:<BR> unloadAPP();<BR> break;
<FONT style="BACKGROUND-COLOR: #fcfc9d" color=#e61a94> } // Missing at here</FONT>
<BR> return AcRx::kRetOK;<BR>}<BR> 按照你的提示,修改后程序编译无误,可是新的问题出现了,在AUTOCAD中加载时出错,出现以下提示:<BR>Command: _appload<BR>acrxGetApiVersion not found in E:\xgh\VC工程\helloarx\helloarx.arx<BR>Make sure the app links with rxapi.lib and export the symbol.AcRxDynamicLinker <BR>failed to load 'E:\xgh\VC工程\helloarx\helloarx.arx'<BR>E:\ACAD2000\CAD\acad.exeUnable to load helloarx.arx file.<BR>请指教:) 方法之一:
(In MSVC++ 6.0)
Project -> Add To Project -> Files , select Rxapi.lib
File-> Save Workspace
Then, Compile again
OK! 本帖最后由 作者 于 2004-4-21 23:19:06 编辑 <br /><br /> Have you made settings as follow?
Project->Settings...
C/C++
Category: General
Preprocessor definitions:
<FONT color=#6060f4> ,ACRXAPP,RADPACK</FONT>
And Add lines in your <FONT color=#f82a7c>Helloarx.def</FONT> file:
<FONT color=#f81972>EXPORTS</FONT>
<FONT color=#f81972> acrxEntryPoint</FONT>
<FONT color=#f81972> _SetacrxPtp</FONT>
<FONT color=#f81972> acrxGetApiVersion</FONT>
=================
Sorry, I have to type English words, becase it is hard to type Chinese words
in my Computer. 按照楼上两位楼主说的,我都试过了,可还是不能在CAD中载入啊,还是出现了这种错误,还有别的原因吗?请指教 <IMG alt=发贴心情 src="skins/default/topicface/face1.gif" border=0> <B></B><BR>方法之一:
(In MSVC++ 6.0)
Project -> Add To Project -> Files ,
select <FONT color=#214aef> Rxapi.lib, Rxheap.lib, Acad.lib, Acdb15.lib, Acrx15.lib, Acutil15.lib</FONT>
File-> Save Workspace
Then, Compile again
OK! 问题解决拉,谢谢这位大哥
以后请多多指教
页:
[1]