如何在QT C ++中连接库alglib [英] how to connect the library alglib in QT C++

查看:270
本文介绍了如何在QT C ++中连接库alglib的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从官方网站链接. 当我尝试编译

I want to run the example from the official site link. When I am trying to compile

mlptrainer trn;
multilayerperceptron network;
mlpreport rep;
real_1d_array x = "[0]";
real_1d_array y = "[0,0]";
real_2d_array xy = "[[+1,0],[+2,0],[-1,1],[-2,1],[0,0],[0,1]]";
mlpcreatetrainercls(1, 2, trn);
mlpcreatec1(1, 5, 2, network);
mlpsetdataset(trn, xy, 6);
mlptrainnetwork(trn, network, 5, rep);

我看到很多看起来都是错误

I get an many errors they all look

C:\ Qt \ Tools \ QtCreator \ bin \ VK_DotaFeed \ neuralnet.cpp:-1:错误:对alglib :: mlpcreatetrainercls(int,int,alglib :: mlptrainer&)的未定义引用

C:\Qt\Tools\QtCreator\bin\VK_DotaFeed\neuralnet.cpp:-1: error: undefined reference to alglib::mlpcreatetrainercls(int, int, alglib::mlptrainer&)

C:\ Qt \ Tools \ QtCreator \ bin \ VK_DotaFeed \ neuralnet.cpp:-1:错误:对alglib :: real_1d_array ::〜real_1d_array()的未定义引用

C:\Qt\Tools\QtCreator\bin\VK_DotaFeed\neuralnet.cpp:-1: errors: undefined reference to alglib::real_1d_array::~real_1d_array()

我写了

using namespace alglib;
#include "dataanalysis.h"

发生什么错误?

推荐答案

在此处下载项目所需的库;

Download the library you need for your project here;

http://www.alglib.net/download.php

在上面引用的页面上阅读第4部分和第8部分的第一部分.

Read section 4 and the first part of section 8 on the page you reference above.

您的问题是该库尚未链接到应用程序. 您将必须在Qt项目的PRO文件中添加两行,以告诉Qt在哪里可以找到您下载的库以及该库的标题.他们看起来像这样;

Your problem is that the library has not been linked into the application. You will have to add two lines to the PRO file of your Qt project to tell Qt where to find the library that you downloaded and the headers for the library. They will look like this;

INCLUDEPATH + =/Users/sysadmin/programming/alglib/includes/???? LIBS + = -L/Users/sysadmin/programming/alglib/libs -l ?????

INCLUDEPATH += /Users/sysadmin/programming/alglib/includes/???? LIBS += -L/Users/sysadmin/programming/alglib/libs -l?????

您将在其中使用系统名称而不是我的名称,并替换???.库名称.

where you will use names for your system, not mine, and replace the ??? with the library names.

这篇关于如何在QT C ++中连接库alglib的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆