函数"Undefined symbol"错误
"Undefined symbol" errors on functions
我正在尝试让 https://github.com/Duthomhas/CSPRNG 的库工作。
这是我的代码:
#include <iostream>
#include <duthomhas/csprng.hpp>
int main(int argc, const char * argv[]) {
duthomhas::csprng rng;
return 0;
}
当我编译它时,我得到两个错误:"未定义的符号:_csprng_create"和"未定义的符号:_csprng_destroy"。这对我来说没有意义,因为包含在csprng.hpp中的csprng.h文件定义了函数csprng_create()和csprng_destroy()。那么为什么编译器不承认这些函数的存在呢?我该如何解决这个问题?
头文件不包含函数的实现,仅包含定义。包中有一个 cpp 文件,其中包含这些实现,我现在已包含,现在程序编译得很好。
相关文章:
- CppSQLite 抛出"LNK2019: unresolved external symbol"错误
- Visual Studio中的wxwidgets应用程序给出错误"LNK2019 unresolved external symbol"
- 从 C 可执行文件加载动态库时收到错误C++"undefined symbol"
- 在 C++ 中嵌入 V8 会导致与 libcpp 相关的"unrecognized external symbol"错误
- cpp 在主源文件中包括.cpp文件导致错误"duplicate symbol"
- 在 Python 3.6 中调用C++扩展时导入错误"undefined symbol: _ZNK9FastNoise8GetNoiseEff"
- 我的游戏引擎的 spdlog 日志记录出现奇怪的"unresolved external symbol"错误
- Visual Studio 2017 中的 MySQL 连接器/C++ 错误"Unresolved external symbol _get_driver_instance"
- C++ Python 模块导入错误: "undefined symbol: Py_InitModule3" ( Py_InitModule () )
- 函数"Undefined symbol"错误
- CMake 和 Visual Studio 出现"unresolved external symbol"错误
- Python C++ 生成生成值错误:"Symbol table not found"
- 由 Boost 单元测试框架 dll 导出的 std::basic_ostringstream 会导致"already defined symbol"错误
- C++错误"redefinition of 'string' as different kind of symbol"
- R dyn.load "Symbol not found"错误,即使C++代码构建良好
- 链接器为某些上下文中使用的集成静态常量成员提供错误"undefined symbol"
- 错误 : "error LNK2019: unresolved external symbol"
- 神秘的构建错误"symbol(s) not found for i386" - openFrameworks 像素操作
- 在类成员函数上执行__inline__时出现c++链接错误:symbol not found
- 如何调试错误"Symbol lookup error: undefined symbol"