Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8112107
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T02:21:53+00:00 2026-06-06T02:21:53+00:00

I recently installed KDevelop 4 for C++ development on my Macbook Pro running Ubuntu

  • 0

I recently installed KDevelop 4 for C++ development on my Macbook Pro running Ubuntu 12.04 LTS.

I want to embed Python application in my C++ code. To do that, one needs to include the Python.h header file. So, I did that.

#include <iostream>
#include <Python.h>

int main(int argc, char **argv) {
    Py_Initialize();
    return 0;
}

However, on running, I received the following response from the IDE:

fatal error: Python.h: No such file or directory

I have python-dev package installed.

So, I thought it must be an issue with the header file not being included by KDevelop. Thus, I added the relevant folder to the include path and KDevelop immediately recognized that by removing the red underline beneath the second include statement in the code above.

But still, the problem remains. I get the same error. Would appreciate any help or inputs you guys can provide 🙂

(KDevelop is using CMake for my project.)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T02:21:56+00:00Added an answer on June 6, 2026 at 2:21 am

    In your CMakeLists.txt, try adding the following:

    find_package(PythonLibs REQUIRED)
    include_directories(${PYTHON_INCLUDE_DIRS})
    target_link_libraries(<your exe or lib> ${PYTHON_LIBRARIES})
    

    For details of the commands, run:

    cmake --help-module FindPythonLibs
    cmake --help-command find_package
    cmake --help-command include_directories
    cmake --help-command target_link_libraries
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I recently installed python 2.7.2 on my Mac running OSX 10.6.8. Previously, I had
I recently installed Ubuntu Jaunty and I'm encountering a problem when I try to
I recently installed W7 pro 64bits on my laptop, and then VS2008 pro with
I recently installed jruby on a machine that also has ruby installed on it.
I recently installed twython, a really sleek and awesome twitter API wrapper for Python.
I recently installed Visual Studio 2010 Pro. There might have been a link to
I recently installed xampp, followed the installation. MySQL/apache. (I have same website running on
I recently installed the Visual Studio 11 Beta alongside Visual Studio 2010. After that
I recently installed Checkstyle plugin for Eclipse and personally think that it is awesome.
I recently installed/updated eclipse environment. When I try to compile the code I'm getting

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.