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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T01:16:34+00:00 2026-06-09T01:16:34+00:00

I’ve been trying for weeks to get Microsoft Visual Studio 2010 to create a

  • 0

I’ve been trying for weeks to get Microsoft Visual Studio 2010 to create a DLL for me with SWIG. If you have already gone through this process, would you be so kind as to give a thoughtful step-by-step process explanation? I’ve looked everywhere online and have spent many many hours trying to do this; but all of the tutorials that I have found are outdated or badly explained.

I have succeeded in going through this process with cygwin; but as some of you know, a cygwin DLL is not very practical.

As a result, I have .i, .cpp, and .h files that I know can create a DLL together. I just need to know how to do this with Visual Studio C++ 2010. The language that I am targeting is Python.

  • 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-09T01:16:36+00:00Added an answer on June 9, 2026 at 1:16 am

    Step-by-step instructions. This assumes you have the source and are building a single DLL extension that links the source directly into it. I didn’t go back through it after creating a working project, so I may have missed something. Comment on this post if you get stuck on a step. If you have an existing DLL and want to create a Python extension DLL that wraps it, this steps are slightly different. If you need help with that comment on this post and I will extend it.

    Edit 8/19/2012: If starting with a C example, don’t use -c++ in step 13 and use .c instead of .cxx for the wrap file extension in steps 14 and 19.

    1. Start Visual Studio 2010
    2. File, New, Project from Existing Code…
    3. Select “Visual C++” project type and click Next.
    4. Enter project file location where the .cpp/.h/.i files are.
    5. For Project Name, choose the name used in %module statement in your .i file (case matters).
    6. Select project type “Dynamically linked library (DLL) project” and click Next.
    7. Add to Include search paths the path to the Python.h file, usually something like “C:\Python27\include” and click Next.
    8. Click Finish.
    9. Right-click the Project in Solution Explorer, Add, Existing Item…, and select your .i file.
    10. Right-click the .i file, Properties, and select Configuration “All Configurations”.
    11. Change Item Type to “Custom Build Tool” and click Apply.
    12. Select “Custom Build Tool” in Properties (it will appear after Apply above).
    13. Enter Command Line of “swig -c++ -python -outdir $(Outdir) %(Identity)” (this assumes SWIG is in your path and redirects the generated .py file to the Debug or Release directory as needed).
    14. In Outputs enter “%(Filename)_wrap.cxx;$(Outdir)%(Filename).py”.
    15. Click OK.
    16. Right-click the .i file, and select Compile.
    17. Right-click the project, Add, New Filter, name it “Generated Files”.
    18. Right-click “Generated Files”, click Properties, and set “SCC Files” to “False” (if you use source-control, this prevents VS2010 trying to check in the generated files in this filter).
    19. Right-click “Generated Files”, Add, Exiting Item and select the _wrap.cxx file that was generated by the compile.
    20. Right-click the project, Properties.
    21. Select Configuration “All Configurations”.
    22. Select Configuration Properties, Linker, General, Additional Library Directories and add the path to the python libraries, typically “C:\Python27\libs”.
    23. Select Configuration Properties, General and set TargetName to “_$(ProjectName)”.
    24. Set Target Extension to “.pyd”.
    25. Build the “Release” version of the project. You can’t build the Debug version unless you build a debug version of Python itself.
    26. Open a console, go to the Release directory of the project, run python, import your module, and call a function!
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a jquery bug and I've been looking for hours now, I can't
Basically, what I'm trying to create is a page of div tags, each has
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm trying to create an if statement in PHP that prevents a single post
I am trying to loop through a bunch of documents I have to put
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I am trying to understand how to use SyndicationItem to display feed which is
this is what i have right now Drawing an RSS feed into the php,

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.