C++实用程序::转换在静态链接库中不起作用
C++ utility::conversions is not working in Static Linked Library
我有一个 c++ MFC 应用程序。 一切都对我有用,直到我排除了我使用的一些标头并将它们设置在一个单独的静态链接库项目中。 现在,一切都编译正常,但是在运行时,当我尝试使用 cpprest sdk 的 utility::conversions 库时,我收到错误"UTF-8 字符串字符永远不能以 10xxxxxx 开头",对于这个库中的每个函数,我得到一个不同的错误,一切都变成了"无法读取内存"。 但是当我使用 std::to_string(( 时,它工作得很好(位于不同的库中 - 不是 cpprest(。 我做错了什么?
pch.h 文件位于库中,而 MFC 应用将其包含在 pch 中.cpp并将预编译标头配置为"创建"。
// Method in the static library triggered by the MFC app
std::string TradeRecord::toJson(std::string channel)
{
string_t _channel= utility::conversions::to_string_t(channel);
return "";
}
问题是使用链接到我的项目的 cpprest 库的发布 dll 版本,一旦我链接了调试 dll 版本,一切正常。 因此,库版本可能存在问题。
相关文章:
- 你能检查一下为什么在这个代码中从链接列表中删除项目不起作用吗
- C++实用程序::转换在静态链接库中不起作用
- 针对静态库的 G++ 链接不起作用
- 强制链接静态库与 cmake 不起作用
- 链接列表中的所有节点都相同,似乎插入不起作用
- 模板外部链接不起作用
- Opencv 链接 CMAKE 不起作用 Ubuntu 16.04 Docker
- 双链接列表添加元素不起作用,不知何故它总是保持为空
- 与LLVM LLD链接不起作用[MACOS]
- 为什么此代码用于单个链接列表不起作用
- 预制链接链接到共享库不起作用
- 在声明节点创建链接列表时,为什么静态内存分配不起作用
- 返回值上的 C++ 方法链接不起作用
- Boost Logger静态链接:不起作用
- cocos2d android编译时链接不起作用
- 为什么这个链表不起作用?
- c++中的动态链接不起作用
- 链表不起作用(c++)
- g++:静态链接不起作用
- 生成文件链接不起作用(尽管没有错误消息)