Talk:Manipulating Atoms in C++

From OpenCog
Jump to: navigation, search

G++ Compile issues (Solved)

Note if getting a problem compiling the code like so:

adam@graphics:~$ g++ createatoms.cc -std=c++11 -o createatoms -latomspace -latombase
/usr/bin/ld: cannot find -latomspace
/usr/bin/ld: cannot find -latombase
collect2: error: ld returned 1 exit status
  • Note the g++ (or c++ or cpp) command doesn't have a param '-l'

Adam (talk) 09:35, 6 December 2016 (UTC)


  • Make sure you have installed atom space
  • Either :
  * make sure to add the library paths to gcc
  * link directly to the directory containing the libraries -L/usr/local/lib/opencog , making sure to do this before linking to the libraries like this:
adam@graphics:~$ g++ createatoms.cc -std=c++11 -o createatoms -L/usr/local/lib/opencog  -latomspace -latombase

(Thanks to Misgana) Adam (talk) 07:46, 7 December 2016 (UTC)

More Path Issues

If the ./createatoms didn't work.. i.e. if it produces this error

 ./createatoms: error while loading shared libraries: libatomspace.so: cannot open shared object file: No such file or directory

Then try these commands:

$ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib/opencog
$ sudo ldconfig

Note there is likely to be a better way to solve the path issues... will look into this later (Misgana, Adam) Adam (talk) 07:57, 7 December 2016 (UTC)