Using Neatbeans to develop C + + on CentOS, calling Python, problems encountered and workarounds

Source: Internet
Author: User

I just touch on CentOS, using Neatbeans to develop C + + project, because of the project reason, need to call Python script in C + + project, in this process encountered some problems, are relatively basic, write this article to take notes.

Environment

Operating system: CentOS 6.6

Development tools: Neatbeans 8.0.2

The system has its own python, and the version is 2.6.


The first step: Create a new project, and add the corresponding code, the source code is as follows

Contains the Python header file, and in main, the initialization method is called.

Step two: When building, the following error is reported

Header file not found, so need to include the corresponding header file

Step three: Include the directory where the Python header file resides

Fourth step: Build, there will still be problems, as follows

Undefined reference to ' py_initialize ' means no dynamic link library found

Fifth step: include the corresponding dynamic library files separately


Sixth Step: Build success


Using Neatbeans to develop C + + on CentOS, calling Python, problems encountered and workarounds

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.