Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to compile example #66

Open
TZVIh opened this issue Oct 2, 2017 · 3 comments
Open

how to compile example #66

TZVIh opened this issue Oct 2, 2017 · 3 comments

Comments

@TZVIh
Copy link

TZVIh commented Oct 2, 2017

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 TZVIh changed the title compile example how to compile example Oct 2, 2017
@hmwildermuth
Copy link
Collaborator

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

@TZVIh
Copy link
Author

TZVIh commented Oct 23, 2017

no,
examples/ReinforcementLearning.cpp

@pptaszni
Copy link

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".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants