Luis Henrique Terbeck Pinto
2009-08-23 01:01:02 UTC
Hello,
i have included fann to my c++ library, but trying to compile some
samples from the FANN webpage some errors have been passed:
The program i am compiling can be see below:
#include "fann.h"
int main()
{
const float connection_rate = 1;
const float learning_rate = 0.7;
const unsigned int num_input = 2;
const unsigned int num_output = 1;
const unsigned int num_layers = 3;
const unsigned int num_neurons_hidden = 4;
const float desired_error = 0.0001;
const unsigned int max_iterations = 500000;
const unsigned int iterations_between_reports = 1000;
struct fann *ann = fann_create(connection_rate, learning_rate,
num_layers, num_input, num_neurons_hidden, num_output);
fann_train_on_file(ann, "xor.data", max_iterations,
iterations_between_reports, desired_error);
fann_save(ann, "xor_float.net");
fann_destroy(ann);
return 0;
}
and the terminal output:
***@debian:~/fann$ gcc fann.cpp -o fann
fann.cpp: In function ‘int main()’:
fann.cpp:14: warning: deprecated conversion from string constant to
‘char*’
/tmp/ccuBJ32n.o: In function `main':
fann.cpp:(.text+0x85): undefined reference to `fann_create'
fann.cpp:(.text+0xb5): undefined reference to `fann_train_on_file'
fann.cpp:(.text+0xc8): undefined reference to `fann_save'
fann.cpp:(.text+0xd3): undefined reference to `fann_destroy'
/tmp/ccuBJ32n.o:(.eh_frame+0x11): undefined reference to
`__gxx_personality_v0'
collect2: ld returned 1 exit status
If someone can help, it would be gratefull.
Regards,
LHP
i have included fann to my c++ library, but trying to compile some
samples from the FANN webpage some errors have been passed:
The program i am compiling can be see below:
#include "fann.h"
int main()
{
const float connection_rate = 1;
const float learning_rate = 0.7;
const unsigned int num_input = 2;
const unsigned int num_output = 1;
const unsigned int num_layers = 3;
const unsigned int num_neurons_hidden = 4;
const float desired_error = 0.0001;
const unsigned int max_iterations = 500000;
const unsigned int iterations_between_reports = 1000;
struct fann *ann = fann_create(connection_rate, learning_rate,
num_layers, num_input, num_neurons_hidden, num_output);
fann_train_on_file(ann, "xor.data", max_iterations,
iterations_between_reports, desired_error);
fann_save(ann, "xor_float.net");
fann_destroy(ann);
return 0;
}
and the terminal output:
***@debian:~/fann$ gcc fann.cpp -o fann
fann.cpp: In function ‘int main()’:
fann.cpp:14: warning: deprecated conversion from string constant to
‘char*’
/tmp/ccuBJ32n.o: In function `main':
fann.cpp:(.text+0x85): undefined reference to `fann_create'
fann.cpp:(.text+0xb5): undefined reference to `fann_train_on_file'
fann.cpp:(.text+0xc8): undefined reference to `fann_save'
fann.cpp:(.text+0xd3): undefined reference to `fann_destroy'
/tmp/ccuBJ32n.o:(.eh_frame+0x11): undefined reference to
`__gxx_personality_v0'
collect2: ld returned 1 exit status
If someone can help, it would be gratefull.
Regards,
LHP