我把目录说明一下:
-include
|_snmp_pp(各种头文件 .h)
|_cpp1.cpp(当前正要编译的文件)-src(各种头文件的实现)
头文件引入的代码如下
#include "snmp_pp\oid.h"
#include <iostream.h>
#include <stdio.h>
#include <string.h>编译可以通过,连接的时候出现11个错. 提示找不到实现代码里的东西.
我该怎么做呢? 才能让他们可以连接成功?
部分编译错误如下
Cpp1.obj : error LNK2001: unresolved external symbol "public: virtual __thiscall Oid::~Oid(void)" (??1Oid@@UAE@XZ)
Cpp1.obj : error LNK2001: unresolved external symbol "public: int __thiscall Oid::nCompare(unsigned long,class Oid const &)const " (?nCompare@Oid@@QBEHKABV1@@Z)
Cpp1.obj : error LNK2001: unresolved external symbol "int __cdecl operator==(class Oid const &,class Oid const &)" (??8@YAHABVOid@@0@Z)
Cpp1.obj : error LNK2001: unresolved external symbol "public: class Oid & __thiscall Oid::operator+=(char const *)" (??YOid@@QAEAAV0@PBD@Z)
Cpp1.obj : error LNK2001: unresolved external symbol "public: __thiscall Oid::Oid(void)" (??0Oid@@QAE@XZ)
-include
|_snmp_pp(各种头文件 .h)
|_cpp1.cpp(当前正要编译的文件)-src(各种头文件的实现)
头文件引入的代码如下
#include "snmp_pp\oid.h"
#include <iostream.h>
#include <stdio.h>
#include <string.h>编译可以通过,连接的时候出现11个错. 提示找不到实现代码里的东西.
我该怎么做呢? 才能让他们可以连接成功?
部分编译错误如下
Cpp1.obj : error LNK2001: unresolved external symbol "public: virtual __thiscall Oid::~Oid(void)" (??1Oid@@UAE@XZ)
Cpp1.obj : error LNK2001: unresolved external symbol "public: int __thiscall Oid::nCompare(unsigned long,class Oid const &)const " (?nCompare@Oid@@QBEHKABV1@@Z)
Cpp1.obj : error LNK2001: unresolved external symbol "int __cdecl operator==(class Oid const &,class Oid const &)" (??8@YAHABVOid@@0@Z)
Cpp1.obj : error LNK2001: unresolved external symbol "public: class Oid & __thiscall Oid::operator+=(char const *)" (??YOid@@QAEAAV0@PBD@Z)
Cpp1.obj : error LNK2001: unresolved external symbol "public: __thiscall Oid::Oid(void)" (??0Oid@@QAE@XZ)
光有h不行的,还要有lib。把lib文件放到和你写的文件同一目录下。然后在你的文件中加上:#pragma comment( lib, "你的lib文件" )就OK
http://www.agentpp.com/snmp++v3.2.20.tar.gz
我不知道怎么管理这些文件.