zoukankan      html  css  js  c++  java
  • Builld with gloox

    今天遇到一个C++编译问题。

    我用Gloox编译成dll,然后再自己写个C++ console,2个项目在一个解决方案中(这使我一顿被蒙蔽),去调用它,build error如下:

    error LNK2001: unresolved external symbol "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const gloox::GLOOX_VERSION" (?GLOOX_VERSION@gloox@@3V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@B

    解决方法:

    参考http://camaya.net/glooxlist/dev/msg00125.html,

    关键在GLOOX_API这个宏的解释上,

    在C++ console的Project configuration properties\ c/c++ \Preprocesser\Preprcessor Definitions中加入GLOOX_IMPORTS 或 DLL_IMPORT 使extern 变量声明为 __declspec( dllimport );这样exe程序才认为这是个要从外部导入的变量。

    否则不会去外部(dll)中找,自然就说无法解析即找不到了。

    帮助别人就是提高自己

  • 相关阅读:
    js数组操作
    docker操作命令
    swoole使用案例
    swoole实现视频弹幕效果
    swoole的UDP服务
    swoole的TCP服务
    安装回环网卡&安装Linux前准备
    Linux之安装Linux详细步骤
    Spring Boot的面试题
    Shell 脚本面试问题大全
  • 原文地址:https://www.cnblogs.com/lugesot/p/1907219.html
Copyright © 2011-2022 走看看