Compiling issue on Ubuntu when i use python APIs

Do you have a question about makefiles, a compiler or IDE you are using and need to know how to set it up for wxWidgets or why it doesn't compile but other IDE's do ? Post your questions here.
Post Reply
Priya
Knows some wx things
Knows some wx things
Posts: 43
Joined: Fri Apr 07, 2017 8:38 am

Compiling issue on Ubuntu when i use python APIs

Post by Priya »

Hi

I using Linux Ubuntu 16.10 and IDE Code Blocks to build my wxWidgets application. I have already installed python 2.7 in the Ubuntu system. In Code Blocks build settings under search directories for compiler and linked i have set the python Path.

I am using some python API like Py_Initialize, PyImport_Import, PyModule_GetDict ect.

When i compile am getting compilation errors saying undefined reference to those APIs

Please let me know how i can solve this compilation error.

Ubuntu system has python in usr folder and i have downloaded 2.7.13 is that a problem.

How to link python correctly in CodeBlocks.

Thanks & Regards
Priya
User avatar
doublemax
Moderator
Moderator
Posts: 19116
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Compiling issue on Ubuntu when i use python APIs

Post by doublemax »

That sounds like you didn't link the python libraries to your project.
Use the source, Luke!
Priya
Knows some wx things
Knows some wx things
Posts: 43
Joined: Fri Apr 07, 2017 8:38 am

Re: Compiling issue on Ubuntu when i use python APIs

Post by Priya »

Hi,

Under linker settings i have added 'lpython2.7'

and i have given the path under search directories

Please let me know how i will link python in Code Blocks

Thanks & Regards,
Priya
User avatar
doublemax
Moderator
Moderator
Posts: 19116
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Compiling issue on Ubuntu when i use python APIs

Post by doublemax »

Just do be clear: Do you get compiler errors or linker errors?

If they are compiler errors, you didn't include the header file for these functions.
If they are linker errors, you didn't link to the correct lib(s).

As i don't work under Linux, i can't tell you exactly which headers or libaries you need, but that should be easy enough to Google.
Use the source, Luke!
Post Reply