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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T08:58:17+00:00 2026-05-17T08:58:17+00:00

I’m trying to build a C++ extension for python using swig. I’ve followed the

  • 0

I’m trying to build a C++ extension for python using swig. I’ve followed the instructions below and the others to a T and can’t seem to get my extension to load.

I ran across this article on the MinGW site under “How do I create Python extensions?”

http://www.mingw.org/wiki/FAQ

I also found these tutorials:

http://boodebr.org/main/python/build-windows-extensions
http://www.mail-archive.com/modwsgi@googlegroups.com/msg04655.html
http://oldwiki.mingw.org/index.php/Python%20extensions

I’m using Panda3d-1.7.0 to build against – panda on win32 is running python2.6.4 (MSC v.1500 compiled). I’m using MinGW gcc/g++ (GCC) 3.4.5 to compile.

I’ve noticed that when I run setup.py with the following command:

python setup.py build -cmingw32

gcc.exe runs first, then g++.exe to build the pyd. g++ is linking against: -lpython26 -lmsvcr90

she builds and links well enough (no errors) but, when I copy the _extension.pyd and extension.py files over into Panda3d-1.7.0\python\Lib\site-packages and run > python -c “import extension” from the command line, Python dumps the following:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Panda3D-1.7.0\python\Lib\site-packages\extension.py", line 25, in <module>
    _bullet = swig_import_helper()
  File "C:\Panda3D-1.7.0\python\Lib\site-packages\extension.py", line 21, in swig_import_helper
    _mod = imp.load_module('_extension', fp, pathname, description)
ImportError: DLL load failed: The specified module could not be found.

Any tips or pointers? Thanks!

ct

  • 1 1 Answer
  • 1 View
  • 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-05-17T08:58:18+00:00Added an answer on May 17, 2026 at 8:58 am

    Two things to verify:

    • Check the C runtime library DLL bound to your python and to your extension DLL with dependency walker to make sure that they are using the same CRT. This is a common source of trouble when building extensions for other languages. (I see it often with Lua, for instance) and can cause interesting and intermittent bugs that are particularly difficult to track down.

    • IIRC, the “official” Python releases for Windows have switched to Visual Studio Express from MinGW. This may make it nearly impossible to use MinGW to build a C++ extension that can be called from a Python compiled and linked with Visual Studio due to irreconcilable differences in the C++ ABI.

    Both of these add up to advice to make sure that the ABI you are assuming in your extension DLL matches the ABI assumed by the hosting application, and that you aren’t duplicating fundamental functional blocks such as the CRT that might contain or manage state that is difficult to correctly share between instances.

    Edit: The improved edit of the question speaks strongly to there being issues with mismatches between Microsoft’s C++ ABI and the GCC C++ ABI which are known to differ.

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

Sidebar

Related Questions

I'm new to using the Perl treebuilder module for HTML parsing and can't figure
We're building an app, our first using Rails 3, and we're having to build
Does anyone know how can I replace this 2 symbol below from the string
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I am trying to render a haml file in a javascript response like so:

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.