0

I am trying to use matplotlib-cpp according to this guide: Installing matplotlib-cpp, but I am trying it on Ubuntu so It's a little bit different.

In "Search directories", I have included these two to "Compiler":

/usr/local/include/python2.7 
/usr/lib/python2.7/dist-packages/numpy/core/include/numpy

And for "Linker" I have included:

/usr/lib/python2.7

In "Linker settings" section, I have added:

/usr/local/lib/libpython2.7.a

I am getting 28 errors. Here are some of them:

/usr/src/Python-2.7.16/Python/dynload_shlib.c|94|undefined reference to `dlsym'|
/usr/src/Python-2.7.16/Python/thread_pthread.h|225|undefined reference to `pthread_create'|
/usr/src/Python-2.7.16/Python/thread_pthread.h|301|undefined reference to `sem_init'|
/usr/src/Python-2.7.16/./Modules/posixmodule.c|4022|undefined reference to `forkpty'|

What is missing?

6
  • Have you added -pthread to both compiler and linker flags/options? Oct 11, 2019 at 14:59
  • @steeldriver, how should I do it?
    – Khalid
    Oct 11, 2019 at 15:25
  • Please see multithreading in codeblocks Oct 11, 2019 at 15:29
  • Sounds like you need to add libdl to the list of libraries as well - in gcc that would be as simple as adding -ldl to the command line, unfortunately I don't use code::blocks so you will need to figure that part out yourself Oct 11, 2019 at 15:36
  • I accidentally deleted the comment, but thanks. I will search for that
    – Khalid
    Oct 11, 2019 at 15:42

0

You must log in to answer this question.

Browse other questions tagged .