Need an example batch file to build Fortran and C++ in VisualStudio2013 while including libraries from VS2005 to run Microstation v8sel2.

{Please read completely before answering "just use VS2005".}  I have recently inherited a project which is mainly in Fortran77 (tens of thousands of lines), C++ (a few hundred lines), and Microstation to plot the results.  It worked well as long as the VisualStudio was 2005; it also worked for VS2008.  But, at the same time as I inherited it, because of Windows7-related Fortran errors which can only be corrected with the Intel Fortran compiler 2013 (which also incorporates with VS2013), I need to be able to have all these features work together.  Even though most responses to questions regarding using VisualStudio newer than 2005 consist of "just use Visual Studio 2005", I need to be able to do this.  In my particular case, the Fortran has nothing to do with the Microstation, other than creating a text plot file for input; Microstation is invoked by C++ calls.  Thus, I need to properly "make" all these by compiling Fortran with VS2013, compiling C++ with VS2013 (or with VS2005), and at link-time cause the Microstation portion to interact with only VS2005 libraries.  I have VS2005, as well, and thus all its linkable libraries.  So, can someone explain how to do this, or better yet, provide a working example?

Parents
  • Hi Danny,

    I agree with Jon's answer, just few more notes and ideas...

    If I understand it right, the real "fixed things" (conditions and requirements) are:

    • Fortran application creates a text plot file and this file has to be procesed by MicroStation. Fortran part is the core.
    • Fortran has to be, because of the described reasons, compiled using Visual Studio 2013.
    • You have to compile C++ code for MicroStation using Visual Studio 2005.
      I know many people use different versions, but it's a difference if "it will probably work" and "it will work for sure". Under some conditions you can mix dlls, but a solution is not general. There is a nice article with an explanation of the problem and possible solutions.

    In my opinion the rest is not so important and maybe easier to find another way how to control MicroStation (and to remove C++ code) than to rigidly require a solution to be able to compile the existing code in a new environment and using new Visual Studio tools.

    It's not clear what C++ code does, but it's probably something quite simple if you described it as "a few hundred lines". Can this part be replaced and some other technology used to control MicroStation? Maybe COM Automation, write separate small MDL/C++ application and communicate using some kind of pipe or something else?

    With regards,

      Jan

Reply
  • Hi Danny,

    I agree with Jon's answer, just few more notes and ideas...

    If I understand it right, the real "fixed things" (conditions and requirements) are:

    • Fortran application creates a text plot file and this file has to be procesed by MicroStation. Fortran part is the core.
    • Fortran has to be, because of the described reasons, compiled using Visual Studio 2013.
    • You have to compile C++ code for MicroStation using Visual Studio 2005.
      I know many people use different versions, but it's a difference if "it will probably work" and "it will work for sure". Under some conditions you can mix dlls, but a solution is not general. There is a nice article with an explanation of the problem and possible solutions.

    In my opinion the rest is not so important and maybe easier to find another way how to control MicroStation (and to remove C++ code) than to rigidly require a solution to be able to compile the existing code in a new environment and using new Visual Studio tools.

    It's not clear what C++ code does, but it's probably something quite simple if you described it as "a few hundred lines". Can this part be replaced and some other technology used to control MicroStation? Maybe COM Automation, write separate small MDL/C++ application and communicate using some kind of pipe or something else?

    With regards,

      Jan

Children
No Data