Code Monkey home page Code Monkey logo

Comments (5)

Svalorzen avatar Svalorzen commented on July 22, 2024

All examples should compile by default when running CMake and make. You should find the compiled executables inside the examples folder inside your build folder.

If you do want to compile them manually, what you are missing is that in your command you do not link the examples with the AI-Toolbox compiled libraries. This means that at linking time all its functions will not be found; that's the reason of the undefined reference errors.

from ai-toolbox.

stamourb avatar stamourb commented on July 22, 2024

Okay great, thank you so much! I was able to run them from the build/examples folder.

from ai-toolbox.

stamourb avatar stamourb commented on July 22, 2024

I know this is an old issue, but I just wanted to reopen this topic because I'd like to extend from my previous question a bit based on your answer:

If I wanted to compile the tutorials manually (or if I create a new program that uses some files from AI-Toolbox), you mentioned I'd have to link the programs with the AI-Toolbox compiled libraries. I have been using the following command to try to link a new program (called mdp2.cpp) with the AI-Toolbox libraries, but it does not work:

g++ mdp2.cpp -L /home/ben/AI/AI-Toolbox-master/build -l AIToolboxMDP

When I run that command, I get this error (which is the same error I get when I try to compile it without linking anything):

In file included from mdp2.cpp:9:
AI/AI-Toolbox-master/include/AIToolbox/MDP/Algorithms/ValueIteration.hpp:4:10: fatal error: AIToolbox/Impl/Logging.hpp: No such file or directory
    4 | #include <AIToolbox/Impl/Logging.hpp>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.

I have also tried adding -I /home/ben/AI/AI-Toolbox-master/include/AIToolbox/Impl to my command, but it gives the same error. I assume I'm missing some steps or commands here, but I'm not sure what they are. I thought it might be because I'm not including a header file for the library in the program, but I couldn't find a header file for the library anywhere in the AI-Toolbox folders. I also looked in the AI-Toolbox README.md file but didn't see any instructions for how to link a program with the libraries. Any help you could give on this would be greatly appreciated!

from ai-toolbox.

Svalorzen avatar Svalorzen commented on July 22, 2024

Have you tried -I /home/ben/AI/AI-Toolbox/master/include/?

In general I don't have any more instructions that I already have because these problems are mostly C++ specific rather than library specific; otherwise I might as well have a full C++ tutorial written in somewhere ;)

In any case, if you could get a bit familiar with CMake, it'd probably be less work to setup a C++ project that includes mine via CMake rather than keep working with compilation commands directly. I do have a project, https://github.com/Svalorzen/AI-Toolbox-Experiments, which I generally use as a base to run experiments for my research. It's not very documented because it's more for my personal use, but if you feel like looking at the CMakefiles a bit it might be easier to either use it or setup a CMake project yourself.

from ai-toolbox.

stamourb avatar stamourb commented on July 22, 2024

Okay, thanks; I'll check them out. The libraries are still not linking properly, but I was able to get past the error I posted using g++ mdp2.cpp -L /home/ben/AI/AI-Toolbox-master/build -l AIToolboxMDP -I /home/ben/AI/AI-Toolbox-master/include -I /usr/include/eigen3.

from ai-toolbox.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.