|
阅读:1891回复:4
[求助]请教VC环境下AO开发下的一个编译错误<P>大家好!</P> <P>我的程序是在vc环境下开发的,引入ArcObject组件库开发独立的EXE应用程序。在工程的StdAfx.h头文件中,加载了ArcObject组件库:</P> <P>#import "D:\ArcGIS\arcexe83\bin\esriCore.olb" raw_interfaces_only, raw_native_types, no_namespace, named_guids, exclude("OLE_COLOR", "OLE_HANDLE")</P> <P>另外在一个头文件GeneralFunctions.h中声明了这样的结构体:</P> <P>struct SRelTableInfo<BR>{<BR> vector<CString> vRelTableName;<BR> vector<CString> vRelFieldName;<BR> <BR> vector<CString> vFieldName;<BR> vector< esriFieldType > vFieldType;<BR> vector<bool> vFieldVisible;<BR> vector<CString> vFieldValue;<BR>};</P> <P>程序编译后会出现下面的错误消息:</P> <P>Stand.cpp<BR>f:\frmis\frmis\generalfunctions.h(45) : error C2065: 'esriFieldType' : undeclared identifier<BR>f:\frmis\frmis\generalfunctions.h(45) : error C2955: 'vector' : use of class template requires template argument list<BR>f:\frmis\include\stlport\stl\_vector.h(549) : see declaration of 'vector'<BR>f:\frmis\frmis\generalfunctions.h(45) : fatal error C1903: unable to recover from previous error(s); stopping compilation<BR>StandDrawable.cpp</P> <P>一直不知道是什么原因引起的,向大家请教,谢谢!</P> <P>这是我的qq:249909201 很高兴和大家交流。</P><img src="images/post/smile/dvbbs/em12.gif" /><img src="images/post/smile/dvbbs/em12.gif" /> |
|
|
1楼#
发布于:2007-11-23 16:32
<P>我是愿意回答你。</P>
<P>f:\frmis\frmis\generalfunctions.h(45) : error C2065: 'esriFieldType' : undeclared identifier 表示变量没有定义,解决办法引入头文件。</P> <P>f:\frmis\frmis\generalfunctions.h(45) : error C2955: 'vector' : use of class template requires template argument list 这个是用到了C++的库,需要头文件。</P> <P>其他错误大同小异。<BR></P> |
|
|
|
2楼#
发布于:2007-11-23 17:47
<P>#include "StdAfx.h"<BR>谢谢回答 我的头文件引入了啊 下面就是声明该结构体的头文件:</P>
<P>#include <vector><BR>#include "math.h"<BR>#include "F:\FRMIS\ForestData\StandInfo.h"<BR>#include "F:\FRMIS\ForestData\Region.h"<BR>#include "F:\FRMIS\ForestData\TreeInstanceInfo.h"</P> <P>using namespace std;</P> <P>struct SEditRow<BR>{<BR> long QOID; //OID of QueryDefInfo<BR> vector<CString> vFieldName;<BR> vector<CString> vFieldValue;<BR>};<BR>struct SEditTable<BR>{<BR> CString tableName;<BR> CString OIDFieldName;//<BR> <BR> vector<SEditRow> vEditRow;<BR>};<BR>//<BR>struct SField<BR>{<BR> CString strName;<BR> CString strValue;<BR>};<BR>struct SFields<BR>{<BR> CString strCurTableName;<BR> CString strAthTableName;<BR> SField sIDField;<BR> SField sCurRelaField;<BR> SField sAthRelaField;<BR> vector<SField> vsDispField; <BR>};</P> <P>struct SRelTableInfo<BR>{<BR> vector<CString> vRelTableName;<BR> vector<CString> vRelFieldName;<BR> <BR> vector<CString> vFieldName;<BR> vector< esriFieldType > vFieldType;<BR> vector<bool> vFieldVisible;<BR> vector<CString> vFieldValue;<BR>};</P> |
|
|
3楼#
发布于:2008-04-23 01:39
<P>鼓励一下 </P>
<P>AO体系太庞大了</P> |
|
|
4楼#
发布于:2008-04-24 08:16
<P>esriFieldType这个需要引入esriGeodatabase库,如下</P>
<P>#import "D:\ArcGIS\arcexe83\bin\esriGeodatabase.olb" raw_interfaces_only, raw_native_types, no_namespace, named_guids, exclude("OLE_COLOR", "OLE_HANDLE")</P> <P>这样就好了</P> |
|
|