一个软件包中的一个example 我运行了下,编译能通过,但是link的时候出了一大堆错误,按网上说的改project-setting中的设置,没有效果:--------------------Configuration: wander - Win32 Debug--------------------
Linking...
wander.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __thiscall ArRobot::run(bool)" (__imp_?run@ArRobot@@QAEX_N@Z)
wander.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: bool __thiscall ArRobot::addAction(class ArAction *,int)" (__imp_?addAction@ArRobot@@QAE_NPAVArAction@@H@Z)
wander.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: bool __thiscall ArRobot::comInt(unsigned char,short)" (__imp_?comInt@ArRobot@@QAE_NEF@Z)
wander.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall ArRobot::~ArRobot(void)" (__imp_??1ArRobot@@QAE@XZ)
wander.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall ArSonarDevice::~ArSonarDevice(void)" (__imp_??1ArSonarDevice@@UAE@XZ)
wander.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall ArActionStallRecover::~ArActionStallRecover(void)" (__imp_??1ArActionStallRecover@@UAE@XZ)
wander.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall ArActionBumpers::~ArActionBumpers(void)" (__imp_??1ArActionBumpers@@UAE@XZ)
wander.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall ArActionAvoidFront::~ArActionAvoidFront(void)" (__imp_??1ArActionAvoidFront@@UAE@XZ)
wander.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall ArActionConstantVelocity::~ArActionConstantVelocity(void)" (__imp_??1ArActionConstantVelocity@@UAE@XZ)
wander.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall ArKeyHandler::~ArKeyHandler(void)" (__imp_??1ArKeyHandler@@QAE@XZ)
wander.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall ArSimpleConnector::~ArSimpleConnector(void)" (__imp_??1ArSimpleConnector@@QAE@XZ)
wander.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static void __cdecl Aria::shutdown(void)" (__imp_?shutdown@Aria@@SAXXZ)
wander.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: bool __thiscall ArSimpleConnector::connectRobot(class ArRobot *)" (__imp_?connectRobot@ArSimpleConnector@@QAE_NPAVArRobot@@@Z)
wander.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __thiscall ArRobot::addRangeDevice(class ArRangeDevice *)" (__imp_?addRangeDevice@ArRobot@@QAEXPAVArRangeDevice@@@Z)
wander.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __thiscall ArRobot::attachKeyHandler(class ArKeyHandler *,bool,bool)" (__imp_?attachKeyHandler@ArRobot@@QAEXPAVArKeyHandler@@_N1@Z)
wander.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static void __cdecl Aria::setKeyHandler(class ArKeyHandler *)" (__imp_?setKeyHandler@Aria@@SAXPAVArKeyHandler@@@Z)
wander.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __thiscall ArSimpleConnector::logOptions(void)const " (__imp_?logOptions@ArSimpleConnector@@QBEXXZ)
wander.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: bool __thiscall ArSimpleConnector::parseArgs(void)" (__imp_?parseArgs@ArSimpleConnector@@QAE_NXZ)
wander.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall ArSimpleConnector::ArSimpleConnector(int *,char * *)" (__imp_??0ArSimpleConnector@@QAE@PAHPAPAD@Z)
wander.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static void __cdecl Aria::init(enum Aria::SigHandleMethod,bool,bool)" (__imp_?init@Aria@@SAXW4SigHandleMethod@1@_N1@Z)
wander.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall ArKeyHandler::ArKeyHandler(bool,bool)" (__imp_??0ArKeyHandler@@QAE@_N0@Z)
wander.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall ArActionConstantVelocity::ArActionConstantVelocity(char const *,double)" (__imp_??0ArActionConstantVelocity@@QAE@PBDN@Z)
wander.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall ArActionAvoidFront::ArActionAvoidFront(char const *,double,double,double,bool)" (__imp_??0ArActionAvoidFront@@QAE@PBDNNN_N@Z)
wander.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall ArActionBumpers::ArActionBumpers(char const *,double,int,int,bool)" (__imp_??0ArActionBumpers@@QAE@PBDNHH_N@Z)
wander.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall ArActionStallRecover::ArActionStallRecover(char const *,double,int,double,double)" (__imp_??0ArActionStallRecover@@QAE@PBDNHNN@Z)
wander.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall ArSonarDevice::ArSonarDevice(unsigned int,unsigned int,char const *)" (__imp_??0ArSonarDevice@@QAE@IIPBD@Z)
wander.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall ArRobot::ArRobot(char const *,bool,bool,bool,bool)" (__imp_??0ArRobot@@QAE@PBD_N111@Z)
Debug/wander.exe : fatal error LNK1120: 27 unresolved externals
Error executing link.exe.wander.exe - 28 error(s), 0 warning(s)
Linking...
wander.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __thiscall ArRobot::run(bool)" (__imp_?run@ArRobot@@QAEX_N@Z)
wander.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: bool __thiscall ArRobot::addAction(class ArAction *,int)" (__imp_?addAction@ArRobot@@QAE_NPAVArAction@@H@Z)
wander.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: bool __thiscall ArRobot::comInt(unsigned char,short)" (__imp_?comInt@ArRobot@@QAE_NEF@Z)
wander.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall ArRobot::~ArRobot(void)" (__imp_??1ArRobot@@QAE@XZ)
wander.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall ArSonarDevice::~ArSonarDevice(void)" (__imp_??1ArSonarDevice@@UAE@XZ)
wander.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall ArActionStallRecover::~ArActionStallRecover(void)" (__imp_??1ArActionStallRecover@@UAE@XZ)
wander.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall ArActionBumpers::~ArActionBumpers(void)" (__imp_??1ArActionBumpers@@UAE@XZ)
wander.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall ArActionAvoidFront::~ArActionAvoidFront(void)" (__imp_??1ArActionAvoidFront@@UAE@XZ)
wander.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall ArActionConstantVelocity::~ArActionConstantVelocity(void)" (__imp_??1ArActionConstantVelocity@@UAE@XZ)
wander.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall ArKeyHandler::~ArKeyHandler(void)" (__imp_??1ArKeyHandler@@QAE@XZ)
wander.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall ArSimpleConnector::~ArSimpleConnector(void)" (__imp_??1ArSimpleConnector@@QAE@XZ)
wander.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static void __cdecl Aria::shutdown(void)" (__imp_?shutdown@Aria@@SAXXZ)
wander.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: bool __thiscall ArSimpleConnector::connectRobot(class ArRobot *)" (__imp_?connectRobot@ArSimpleConnector@@QAE_NPAVArRobot@@@Z)
wander.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __thiscall ArRobot::addRangeDevice(class ArRangeDevice *)" (__imp_?addRangeDevice@ArRobot@@QAEXPAVArRangeDevice@@@Z)
wander.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __thiscall ArRobot::attachKeyHandler(class ArKeyHandler *,bool,bool)" (__imp_?attachKeyHandler@ArRobot@@QAEXPAVArKeyHandler@@_N1@Z)
wander.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static void __cdecl Aria::setKeyHandler(class ArKeyHandler *)" (__imp_?setKeyHandler@Aria@@SAXPAVArKeyHandler@@@Z)
wander.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __thiscall ArSimpleConnector::logOptions(void)const " (__imp_?logOptions@ArSimpleConnector@@QBEXXZ)
wander.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: bool __thiscall ArSimpleConnector::parseArgs(void)" (__imp_?parseArgs@ArSimpleConnector@@QAE_NXZ)
wander.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall ArSimpleConnector::ArSimpleConnector(int *,char * *)" (__imp_??0ArSimpleConnector@@QAE@PAHPAPAD@Z)
wander.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static void __cdecl Aria::init(enum Aria::SigHandleMethod,bool,bool)" (__imp_?init@Aria@@SAXW4SigHandleMethod@1@_N1@Z)
wander.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall ArKeyHandler::ArKeyHandler(bool,bool)" (__imp_??0ArKeyHandler@@QAE@_N0@Z)
wander.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall ArActionConstantVelocity::ArActionConstantVelocity(char const *,double)" (__imp_??0ArActionConstantVelocity@@QAE@PBDN@Z)
wander.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall ArActionAvoidFront::ArActionAvoidFront(char const *,double,double,double,bool)" (__imp_??0ArActionAvoidFront@@QAE@PBDNNN_N@Z)
wander.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall ArActionBumpers::ArActionBumpers(char const *,double,int,int,bool)" (__imp_??0ArActionBumpers@@QAE@PBDNHH_N@Z)
wander.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall ArActionStallRecover::ArActionStallRecover(char const *,double,int,double,double)" (__imp_??0ArActionStallRecover@@QAE@PBDNHNN@Z)
wander.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall ArSonarDevice::ArSonarDevice(unsigned int,unsigned int,char const *)" (__imp_??0ArSonarDevice@@QAE@IIPBD@Z)
wander.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall ArRobot::ArRobot(char const *,bool,bool,bool,bool)" (__imp_??0ArRobot@@QAE@PBD_N111@Z)
Debug/wander.exe : fatal error LNK1120: 27 unresolved externals
Error executing link.exe.wander.exe - 28 error(s), 0 warning(s)
解决方案 »
- 基础知识求解:结构定义中:是什么意思?
- 0x7c812afb 处未处理的异常: Microsoft C++ 异常: 内存位置 0x0013c7cc 处的 mwException
- <<深入浅出MFC>>例子编译出错!
- 系统菜单的自绘问题
- 如何做到,删除,清空时都会有一个“确认”对话框
- 菜鸟提问VC+Access
- 怎样改变CEditView的背景颜色?
- VC访问ORACLE问题,高手,帮忙指点,万分感谢!!!!
- 各位大侠:应用程序中,想用多个文件代替数据库的表单,但想拥有数据库访问的灵活性和数据操作速度,
- 用SetSystemTime()更改系统时间的问题?
- :?:大家看看这个错误信息大概是指哪个地方的问题
- 高分请教:如何改变位图大小?
是什么我不清楚编译过了,证明头文件是有了,楼主需要把缺少的连接库文件加上才可以.
是不是.cpp没有加到工程里面?
以前我们用的系统是用pascal类似的oberon编的,现在换新平台了,要用c++
我们都不会,正在学,想先运行几个例子看看,但是连接不了。。平台的软件包我们买了,不知道是不是要都给他编译下? .dll 没看到,lib的文件夹我也加了
#pragma comment(lib,"lib文件路径")
这样链接时就不会出错了。
1 project->settings 选择link标签,在Object/library中将软件包中的lib文件加进去.(软件包中的lib与对应dll放到debug目录或vc的lib库中去).
2 #pragma comment(lib,"lib文件目录及名称"),看debug不存在找不到头文件的错误,不#include的了.
3 project->Add to project->Files;选择要导入的库文件,如*.lib,(这种方法最简便).