Fido icon indicating copy to clipboard operation
Fido copied to clipboard

how to compile example

Open TZVIh opened this issue 8 years ago • 3 comments

hi, I want to compile the ReinforcementLearning.cpp. I am using ver 0.02 with ubuntu 16.04.

I use g++/gcc and I got error of " undefined reference to.." can you write some example how to compile it? thanks!

TZVIh avatar Oct 02 '17 12:10 TZVIh

There is no file named ReinforcementLearning.cpp. Do you mean tests/reinforcement.cpp?

hmwildermuth avatar Oct 13 '17 01:10 hmwildermuth

no, examples/ReinforcementLearning.cpp

TZVIh avatar Oct 23 '17 10:10 TZVIh

Hi,

I created small trivial CMakeLists.txt for anyone having problems compiling/linking the examples:

cmake_minimum_required(VERSION 3.10 FATAL_ERROR)

project(Fido CXX)

set(CMAKE_CXX_STANDARD 17)

set(SRCS
    src/Adadelta.cpp
    src/Backpropagation.cpp
    src/FidoControlSystem.cpp
    src/GeneticAlgo.cpp
    src/Interpolator.cpp
    src/Layer.cpp
    src/LSInterpolator.cpp
    src/NeuralNet.cpp
    src/Neuron.cpp
    src/Pruner.cpp
    src/QLearn.cpp
    src/SGDTrainer.cpp
    # src/Simulator/Emitter.cpp # commented out because of SFML dependency which I did not have
    # src/Simulator/Robby.cpp
    # src/Simulator/Simlink.cpp
    src/WireFitQLearn.cpp
)

add_library(Fido SHARED ${SRCS})
target_include_directories(Fido PUBLIC include)

add_executable(main src/main.cpp)
target_link_libraries(main Fido)

add_executable(Backpropagation examples/Backpropagation.cpp)
target_link_libraries(Backpropagation Fido)

add_executable(GeneticAlgo examples/GeneticAlgo.cpp)
target_link_libraries(GeneticAlgo Fido)

Only change #include "Fido/Fido.h" to #include "Fido.h".

pptaszni avatar Jul 25 '22 14:07 pptaszni