在这里编程新手所以请耐心等待!

我正在调查使用Armadillo(与Lapack和Blas或OpenBlas)在一个自定义的C Qt GUI项目中做一些相当重的矩阵算术和操作,并且有一些问题,读取stackoverflow上的先前帖子还没有帮助 .

Build :

  • 使用从本网站获得的MingW 4.9.1的Qt 5.3.2的Windows x64版本(http://sourceforge.net/projects/qtx64/
  • QtCreator 3.3.0
  • 来自(http://arma.sourceforge.net/download.html)的Armadillo 4.600.3软件包以及提取的示例文件夹中包含的Lapack和Blas x64 dll和libs . - 上面提到的dll和lib是Armadillo包中提供的预编译的x64文件 . 我没有重新编译Lapack或Blas等 .

问题:

  • 当尝试运行包含的Armadillo示例的子集时,在尝试计算行列式时会抛出seg错误(B = det(A)) . 下面是我正在使用的.cpp和.pro文件 . 我还将包括QtCreator的"Compile Output"结果,它显示了在调试模式下编译的输出,g命令等 .
  • 下面引用的"include"文件夹包含armadillo文件和armadillo_bits子文件夹 .
  • "dependencies"文件夹包含Armadillo附带的Lapack和Blas的.dll和.lib x64文件 .
  • 我从读到这里得知拉普克应该在布拉斯之前传给克 . 应该是这种情况 .
  • "config.hpp" Armadillo文件具有以下行已启用(或未注释掉) . 所有其他条目都已注释掉:
#define ARMA_USE_LAPACK
#define ARMA_USE_BLAS
#define ARMA_BLAS_UNDERSCORE

main.cpp中

#include <iostream>
#include <armadillo>

using namespace std;
using namespace arma;

int main()
{
    cout << "Armadillo version: " << arma_version::as_string() << endl;

    mat A(2,3);  // directly specify the matrix size (elements are uninitialised)

    cout << "A.n_rows: " << A.n_rows << endl;  // .n_rows and .n_cols are read only
    cout << "A.n_cols: " << A.n_cols << endl;

    A(1,2) = 456.0;  // directly access an element (indexing starts at 0)
    A.print("A:");

    A.resize(2,2);
    A.fill(97.0);
    A.print("A:");

    mat B;
    B = det(A); // throws seg fault here

    return 0;
}

arma_test_21jan2015.pro

TEMPLATE = app
CONFIG += console
CONFIG -= app_bundle
CONFIG -= qt

INCLUDEPATH += "c:/qt/armadillo/include"
DEPENDPATH += "c:/qt/armadillo/dependencies"

LIBS += -L"c:/qt/armadillo/dependencies/" -llapack_win64_MT
LIBS += -L"c:/qt/armadillo/dependencies/" -lblas_win64_MT

SOURCES += main.cpp

include(deployment.pri)
qtcAddDeployment()

编译窗口输出

11:42:01: Running steps for project arma_test_21jan2015...
11:42:01: Configuration unchanged, skipping qmake step.
11:42:01: Starting: "C:\Qt\qt-5.3.2-x64-mingw491r1-seh\mingw64\bin\mingw32-make.exe" 
C:/Qt/qt-5.3.2-x64-mingw491r1-seh/mingw64/bin/mingw32-make -f Makefile.Debug
mingw32-make[1]: Entering directory 'C:/Qt/projects/arma_test_21jan2015'
g++ -c -pipe -fno-keep-inline-dllexport -g -frtti -Wall -Wextra -fexceptions -mthreads -DUNICODE -I. -I"..\..\..\qt\armadillo\include" -I"..\..\qt-5.3.2-x64-mingw491r1-seh\qt-5.3.2-x64-mingw491r1-seh\mkspecs\win32-g++" -o debug\main.o main.cpp
g++ -Wl,-subsystem,console -mthreads -o debug\arma_test_21jan2015.exe debug/main.o  -Lc:/qt/armadillo/dependencies/ -llapack_win64_MT -lblas_win64_MT 
mingw32-make[1]: Leaving directory 'C:/Qt/projects/arma_test_21jan2015'
11:42:04: The process "C:\Qt\qt-5.3.2-x64-mingw491r1-seh\mingw64\bin\mingw32-make.exe" exited normally.
11:42:04: Elapsed time: 00:03.

老实说,我不知道如何解决这个问题 . 也许这是我对此的新意,这使我错过了一些基本而明显的东西 . 我已经看到了一些将PRE_TARGETDEPS添加到QtCreator项目文件的引用,但我不确定是否指向.lib文件或其他内容 .

那里的任何人都可以看看这个并提供一些见解吗?
谢谢