A list for the developers of CellML tools

Text archives Help


[cellml-dev] Using the CellML API with Qt Creator (solved) was Re: CellML 1.10rc2


Chronological Thread 
  • From: ak.miller at auckland.ac.nz (Andrew Miller)
  • Subject: [cellml-dev] Using the CellML API with Qt Creator (solved) was Re: CellML 1.10rc2
  • Date: Wed, 14 Sep 2011 12:50:41 +1200

On 13/09/11 08:07, Alan Garny wrote:
> Hi Andrew,
>
> I thought I would, using CMake, create a small CellML program
> <https://github.com/agarny/cellml-example-with-cmake> and try to get it
> to work on all three platforms.
>
...
>
> However, on Windows, things don?t work as expected, even though
> everything builds fine. Basically, whenever I run the program, I get the
> following message: ?The procedure entry point _ZNKSt9exception4whatEv
> could not be located in the dynamic link library libstdc++-6.dll?. That
> DLL is part of MinGW, so I thought I would check its entry points (using
> DLL Export Viewer
> <http://www.nirsoft.net/utils/dll_export_viewer.html>), but couldn?t
> find anything for ZNKSt9exception4whatEv.
>
> The only thing I can think of is that we use different versions of
> MinGW. Personally, I use the (patched) version (4.4) of MinGW that comes
> with Qt SDK 1.1.3 <http://qt.nokia.com/downloads>, and I wonder whether
> you wouldn?t be using the official version of MinGW
> <http://www.mingw.org/>??

Hi Alan,

I have now got Qt Creator / Qt SDK installed on a different virtual
machine, and I was able to reproduce the problem you report.

The cause of the problem is that the Qt version of MinGW is configured
to statically link against libstdc++-6, rather than to use the
libstdc++-6.dll, and it seems to come with a version of libstdc++-6.dll
that doesn't correspond to the same MinGW version that ships with Qt.

Normal Qt programs linked with MinGW from the Qt SDK 1.1.3 don't need
libstdc++-6.dll at all.

Therefore, the solution that will get things working for you the fastest
is to simply make sure libstdc++-6.dll from standard MinGW is in the
path ahead of the one that ships with Qt. This doesn't seem to cause any
problems for apps built with the Qt SDK (at least not with the one I
tested) because they all statically link libstdc++-6. To save you
downloading the entire MinGW installer, I just sent you the
libstdc++-6.dll file (standard disclaimer & license at
http://gcc.gnu.org/onlinedocs/gcc-4.5.3/gcc/Copying.html, contact me if
you want the source code for gcc and don't know how to get it yourself)
- if anyone else wants me to send it to them too, let me know.

For a longer term solution, we could simply ship libstdc++-6.dll with
MinGW builds (and probably the MSVC2010 distributable component with the
MSVC builds). An alternative would be to match what Nokia does and link
statically against libstdc++-6 - I believe the MinGW maintainers
recommend against that because it can mean there are two copies of
certain shared data, but I'm not sure if it will actually cause any real
problems in the libstdc++ case (and it is linked statically on other
platforms like Linux...).

Please let me know if the short term solution of just using the standard
MinGW DLL works for you (it did for me, with a small graphical Qt
program that creates a blank window as well as making a CellML API call).

Best wishes,
Andrew




Archive powered by MHonArc 2.6.18.

Top of page