1

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: error: undefined reference to alglib::mlpcreatetrainercls(int, int, alglib::mlptrainer&)

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

I wrote

using namespace alglib;
#include "dataanalysis.h"

In what an error?

Community
  • 1
  • 1
Pegos
  • 163
  • 1
  • 2
  • 12

1 Answers1

0

Download the library you need for your project here;

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

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

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?????

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

john elemans
  • 2,578
  • 2
  • 15
  • 26