vs2010编写c语言lnk2019,VS2010编译错误 LNK 2019 unresolved external symbol错误解决办法

1: #pragma once

2:

3: #include "..\..\third-part\plustache\context.hpp"

4: #include "..\..\third-part\jsoncpp\json.h"

5:

6: class DataConversion {

7: public:

8: DataConversion();

9: ~DataConversion();

10: static Context JsonToContext(char *printData);

11: private:

12: static PlustacheTypes::ObjectType ConvertObject(const Json::Value& json, Context* ctx);

13: static PlustacheTypes::CollectionType ConvertCollection(const Json::Value& json);

14: static void ConvertPrimative(const Json::Value& json, CString& value);

15: };

16: //上面代码是一个dll中的头文件,需要在其他工程中使用 Context JsonToContext(char *printData);这个函数,怎么调用都是连接错误,后来想到是dll函数导出的问题,于是修改成如下代码即可

17: #pragma once

18:

19: #ifdef PRINTERPLUGIN_EXPORTS

20: #define PRINTERPLUGIN_API __declspec(dllexport)

21: #else

22: #define PRINTERPLUGIN_API __declspec(dllimport)

23: #endif

24:

25: #include "..\..\third-part\plustache\context.hpp"

26: #include "..\..\third-part\jsoncpp\json.h"

27:

28: class DataConversion {

29: public:

30: DataConversion();

31: ~DataConversion();

32: PRINTERPLUGIN_API static Context JsonToContext(char *printData);

33: private:

34: static PlustacheTypes::ObjectType ConvertObject(const Json::Value& json, Context* ctx);

35: static PlustacheTypes::CollectionType ConvertCollection(const Json::Value& json);

36: static void ConvertPrimative(const Json::Value& json, CString& value);

37: };

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值