View previous topic :: View next topic |
Author |
Message |
Ryan
Joined: 25 Feb 2016 Posts: 110
|
Posted: Fri Apr 07, 2017 3:23 pm Post subject: Ideas on porting C++ component |
|
|
We have a 32 bit app comprising of Fortran and C++ (GUI) that is compiled and then linked into a single executable using FTN95, SCC and SLINK.
We are trying to create a 64 bit release but the SCC compiler is unusable in 64 bit mode due to many bugs (it crashes when it tries to compile and reports errors plus some ‘not implemented’ messages).
This means that we must use the Microsoft Visual C++ compiler to compile the C++ aspect and try to merge the binaries into an executable later on.
FTN95 generates both 32 and 64 bit object files, however the 64 bit variants are not standard COFF object files and the Microsoft linker cannot consume them. SLINK64 cannot create static libraries either.
I think this leaves us with two options;
1) Output static libraries from the C++ code to be consumed by SLINK/SLINK64.
2) Compile the Fortran code to DLLs and link the C++ code with MS tools.
Both will involve a fair bit of effort to rework. My questions are;
a) Am I missing something here?
b) Are there any updates to SCC / SLINK64 in the near future that mean I should wait instead of embarking upon a rewrite?
Thanks in advance,
Ryan |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7931 Location: Salford, UK
|
Posted: Fri Apr 07, 2017 4:31 pm Post subject: |
|
|
Ryan
My preferred approach would be to create a Microsoft C++ DLL exporting extern "C" functions. Then link this to a Fortran project that uses C_EXTERNAL for the imported functions. SLINK64 will be able to load the 64 bit C++ DLL. It will also work for the 32 bit case using SLINK. |
|
Back to top |
|
|
|