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 9139269
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T09:21:56+00:00 2026-06-17T09:21:56+00:00

I have a C++ application from Windows that I wish to port across to

  • 0

I have a C++ application from Windows that I wish to port across to run on a Red Hat Linux system. This application embeds a slightly modified version of Python 2.7.3 (I added the Py_SetPath command as it is essential for my use case) so I definitely need to compile the Python source.

My problem is that despite looking, I can’t actually find any guidance on how to get Python to emit the right files for me to link against and how to then get g++ to link my C++ code against it in such a way that I don’t need to have an installed copy of Python on every system I distribute this to.

So my questions are:

  • how do I compile Python so that it can be embedded into the C++ app on Linux?
  • what am I linking against for the C++ app to work?

Sorry for these basic questions, but having convinced my employer to let me try and move our systems over to Linux, I’m keen to make it go off as smoothly as possible and I’m worried avbout not making too much progress!

  • 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-17T09:21:57+00:00Added an answer on June 17, 2026 at 9:21 am

    You want to link to the python static library, which should get created by default and will be called libpython2.7.a

    If I recall correctly, as long as you don’t build Python with --enable-shared it doesn’t install the dynamic library, so you’ll only get the static lib and so simply linking your C++ application with -lpython2.7 -L/path/where/you/installed/python/lib should link to the static library.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Windows application that has 2 Forms . From one form I
i am porting my application from windows forms to WPF. I have found that
We have an application that we're porting to Mac OS from Windows. Once installed,
I currently have a single application that needs to be started from a windows
I wish to build a Windows application that will generally run in the background,
I have a python-based GTK application that loads several modules. It is run from
I have a Windows 8 Metro application created from the Grid Application template. I
I have idea to write errors from my application to the Windows Event Viewer
I have one .net windows application I'm trying to read .xml file from c#
I have an application on one domain that displays content from another application from

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.