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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T23:41:26+00:00 2026-05-16T23:41:26+00:00

Anyone have any experience using SWIG ? I am currently researching QuantLib and saw

  • 0

Anyone have any experience using SWIG? I am currently researching QuantLib and saw that C# code can be generated using SWIG. We are exploring options to create a combined library of financial functions using QuantLib and a proprietary closed source library (which will probably be made available as .Net dlls). The idea is to combine both of these to create a unified super library. I have seen the .Net port of QuantLib, but it seems that it is not actively maintained (and not entirely sure of how much was actually ported), so I am avoiding it.

Step 1 of this is to evaluate the difficulty in producing a library that can be used ‘anywhere’ i.e. MS office applications ( via VBA), console apps as well server-side (eg web apps). I assume that this involves COM Interop, but I have no clue where to start or if I am even on the right track.

I have no experience with C++; and COM is something (a buzzword to me at the moment) that I have glazed over. I am aware of the relevant MSDN articles related to this topic.

I am looking for help along the following lines:

  1. Are there alternatives to using QuantLib in C#?
  2. With respect to my development environment, what would I need?
  3. Does anyone know of a ready-to-use QuantLib C# library compiled via SWIG? (first prize = less work for me)

Any help appreciated?

Edit: I have accepted my answer as the correct one unless there is a better one provided.

  • 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-05-16T23:41:27+00:00Added an answer on May 16, 2026 at 11:41 pm

    So it would seem that the C# bindings for SWIG are available. One needs to browse the SVN repository or list of files on SouceForge to find them.

    The SWIG folder contains several subfolders, depending on your language of choice, in my case C# was the one that interested me. You will need to download SWIG first and it the executable to system PATH variable.

    Make sure to read the Readme.txt as it contains details about the QL_DIR environment variable that also needs to be created.

    This may be a limitation of VS Express – but the solution file contains both the C# project and C++ project, of which only either the C# or C++ portions can be opened at any time. My suggestion would be to created separate solution files for the C++ and the C# projects.

    Coming from a .Net background, lib files, obj files and the all the other jazz associated with c++ takes some time to getting use to.

    Steps taken to get a working C# library

    1. Download QuantLib and Boost as described here
    2. Download the tar ball of the QuantLib-SWIG folder from SourceForge. Edit: There is a download of the zip available on the home page. Its listed within the subfolders. Check the v1.0 folders under Bindings
    3. Run the swig.cmd file located in QuantLib-SWIG\CSharp folder (you need to download SWIG first() –> this generates the cs wrapper files for Quantlib.
    4. Build the c++ project NQuantLibc – note the dll created here needs to be always shipped with the NQuantlib C# built dll. It needs to be placed in a location that is readable by the DLLImport attribute. (See Dynamic-Link Library Search Order on MSDN for list of locations)
    5. Build the C# project NQuantLib

    With respect to my development environment, what would I need?

    It seems that the current version of QuantLib only builds with VS 2008. There have been some changes to VS 2010 which causes some issues with compilation. The C# project builds fine, however just remember to change the Target Framework from v4 to v3.5 to lower.

    Note: As the time of writing this there was an issue with the QL_HEX_VERSION number in the source files of the C++ SWIG project. After running the swig.cmd open the VS project, and change Line 344 of quantlib_wrap.cpp to

    #if QL_HEX_VERSION < 0x010001f0//0x010100f0
    

    I have emailed the project author, and awaiting feedback. Edit: Luigi, correctly informed me that this is any issue with the code in SVN (which I used). He suggested that the QuantLib-SWIG-1.0.zip bindings should be used.

    Quantlib also build on VC++ 2010 with the latest release.

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

Sidebar

Related Questions

anyone have any experience using this? if so, is it worth while?
Anyone have any experience using the Microsoft Configuration Management Application Block? This is an
anyone have any experience of using them together? How well does it work? or
Does anyone have any experience in using compression on their cached data? I understand
Anyone have any experience creating a modal dialog box using AJAX and ASP.NET MVC?
Does anyone have any experience with installing the Visual Studio Isolated Shell and using
Anyone have experience with using SWIG (the interface generator)? I have a C project
Does anyone have any experience using IIS and basic network based round robin'ing to
Does anyone have any experience using django-haystack with the whoosh backend? I'm looking to
Does anyone have any experience using PHP to send an sms via skype I

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.