链接错误与第三方库在Qt Creator
Linking error with 3rd party library in Qt Creator
我需要解码pcm数据到opus格式。因此,我想将opus源代码包含到我的项目中,但我无法链接这些文件。我从这里下载了源文件opus-1.1.tar.gz
。在Qt Creator中,我将所有文件添加到我的pro
-file:
INCLUDEPATH +=
$$PWD/opus/opus/celt
$$PWD/opus/opus/celt/arm
$$PWD/opus/opus/celt/tests
$$PWD/opus/opus/celt/x86
$$PWD/opus/opus/silk
$$PWD/opus/opus/silk/arm
$$PWD/opus/opus/silk/fixed
$$PWD/opus/opus/silk/float
$$PWD/opus/opus/include
$$PWD/opus/opus/win32
// and here would come an abnormous listing of all c- and h-files of opus:
SOURCES += ...
HEADERS += ...
在编译时,我从stack_alloc.h
得到一个警告。#if (!defined (VAR_ARRAYS) && !defined (USE_ALLOCA) && !defined (NONTHREADSAFE_PSEUDOSTACK))
#error "Opus requires one of VAR_ARRAYS, USE_ALLOCA, or NONTHREADSAFE_PSEUDOSTACK be defined to select the temporary allocation mode."
#endif
例如,USE_ALLOCA
在opus/win32
中定义为config.h
。从我所看到的,文件config.h
只包含如下:
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
但是在源代码附带的所有文件中,我都找不到#define HAVE_CONFIG_H
。此外,在文件config.h
中有一个#include "version.h"
。该文件也没有随源代码一起交付。我真的不知道怎么用Opus-lib。这并不难,但我根本没有找到一个运行的最小示例。
我正在使用Windows 8, mingw和c++,但库是c.
您可以将-D VAR_ARRAYS
添加到编译命令中或在头文件中定义:
#define VAR_ARRAYS 1
使用emscripten (WebAssembly)构建时,我必须添加以下两个标志:
$ emcc -D VAR_ARRAYS -D OPUS_BUILD ...
相关文章:
- 无法使用Qt Creator在Windows中构建yaml-cpp
- 在Qt Creator中,如何在连接到正在运行的进程后查看控制台输出
- 如何在QT Creator上将QWidget声明为继承类的对象
- 在 QTextEdit 中使用指针或在 Qt-Creator 上使用 connect()
- Qt creator 4.11,在应用程序输出面板中创建一个链接
- 使用 Cmake 在 Qt Creator 中显示头文件
- 如何在 CMakeLists.txt Qt Creator 中包含头文件?
- 为什么Qt Creator的应用程序输出不能从spdlog记录器打印
- 使用Qt Creator在调试模式下编译一段代码
- Qt Creator 在执行步骤 "make" 时出现编译错误,-fno-stack-limit
- Qt creator语言 - fno-elide-constructors 不起作用
- 如何将Valgrind与Qt Creator一起使用来调试远程应用程序?
- QT Creator将SQLite复制为空数据库
- 如何在QT Creator中手动运行CMake和Run
- 在Qt Creator中应用代码更改的快捷方式是什么?
- Qt Creator在linux mint 64位中找不到CMAKE_CXX_COMPILER编译器
- 为什么 qt-creator 在我用小写字母命名小部件类后无法构建?
- Qt Creator项目打破:"找不到建筑x86_64符号"
- 您将如何在现有的QT Creator GUI项目中实现ROS发布者和订阅者?
- 将OpenBLAS与Qt Creator项目链接