- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have to parse xml files from FORTRAN. I have developed a C++ library that uses visual studio XML libraries.
If I call the subroutine that opens and reads the XML file from a C executable everything works fine. Now, if I do the same from a FORTRAN executable doesnt work. It gives a forrtl error. I dont really understand what happens. I would appreciate any help in this issue. I upload the solution with the C++ library and the two executable projects.
Thanks
Link Copied
6 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sorry, I have upload the zip file again. I will take a look to your sugestion. However, I will still like to know why the runtime error calling from fortran and not from c.
Thanks
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Having seen the code, I have a hunch that you get the crash because the static library uses CLR through #using , that Fortran (as well as myself) knows nothing about.
When I remove the references to namespace System and all that stuff (i.e. reducing the C++ code to bare bones without XML parser), the call is successfull (modulo the terminating you forgot to append to filename, modulo the passed string length you didn't handle, but never mind). Even when I turn the winfgl into a DLL, the behavior is the same.
Offhand, it seems that there's no way for Fortran to ultimately call CLR anything; perhaps someone else might shed some more light on the subject.
P.S. 0xe0434f4d is a CLR exception indeed.
When I remove the references to namespace System and all that stuff (i.e. reducing the C++ code to bare bones without XML parser), the call is successfull (modulo the terminating you forgot to append to filename, modulo the passed string length you didn't handle, but never mind). Even when I turn the winfgl into a DLL, the behavior is the same.
Offhand, it seems that there's no way for Fortran to ultimately call CLR anything; perhaps someone else might shed some more light on the subject.
P.S. 0xe0434f4d is a CLR exception indeed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for the link, good information.
It seems that I don't have too many options in this one.
Fernando
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
For what it's worth, Xerces is also a widely used and free XML parser, and it's written in "plain vanilla" C++ (as opposed to CLR), so there shouldn't be any CLR problems even if you interact with Fortran. I used it myself on few occasions, albeit only from a pure C++ environemnt.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Great tip. This make it for me. I willtry it.
Thanks,
Fernando
![](/skins/images/DC0E2679F7049B943291D1ED082A478E/responsive_peak/images/icon_anonymous_message.png)
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page