grame-cncm / libmusicxml

A C/C++ library to support the MusicXML format.
Mozilla Public License 2.0
156 stars 35 forks source link

xml2midi crashes when calling browser.browse() #3

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Attempt compiling the code attached below which closely resembles the 
xml2midi sample.
2. Provide the test file I have used (I have tried using other files though).

What is the expected output? What do you see instead?
Application crashing on browser.browse

What version of the product are you using? On what operating system?
Windows 7 32 Bit, libmusicxml-3.00-win32, QtCreator, MS VC Compiler

Please provide any additional information below.

-------
Thanks a lot for reading this! I´d really appreciate if you took the time to 
help me getting this work.

Original issue reported on code.google.com by daniel.m...@gmail.com on 16 Jul 2013 at 12:34

Attachments:

GoogleCodeExporter commented 9 years ago
The code works when compiled with VC2005 in release mode. I think you're facing 
a runtime boundary issue : you can't allocate memory (either explicitly with 
new or malloc, or implicitly) and then pass a pointer across a DLL boundary to 
be freed (see at http://msdn.microsoft.com/en-us/library/ms235460.aspx).
In your code, the problem occurs with std::string.
The rule is to use the same runtime library than libmusicxml.dll. You can look 
at the used runtime using depends.exe. Actually the library is compiled with 
VC2005 and depends on MSVCR80.DLL. 
That's not very convenient for development (I agree), it constraints you to use 
the dev environment that compiled the library and even in this case, crossing 
debug and non-debug runtime (MSVCR80.DLL and MSVCR80D.DLL) is not permitted.
You should get the source code and recompile the library using your VC compiler.
--
Dominique

Original comment by dfo...@gmail.com on 16 Jul 2013 at 9:20

GoogleCodeExporter commented 9 years ago
Thanks a lot Dominique!
Works like a charm now!
Including the hint about recompiling in the readme file or the wiki might
save somebody a lot of time.
Thanks again for the great library and the excellent support!

Your sincerely,
Daniel Novotny

Original comment by daniel.m...@gmail.com on 17 Jul 2013 at 12:58

GoogleCodeExporter commented 9 years ago
Done. The hint is in the readme file now.
Thanks for your feedback.
--
Dominique

Original comment by dfo...@gmail.com on 17 Jul 2013 at 1:40