- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I am trying to rewrite a code from (Open) Watcom Fortran 77 to Intel Visual Fortran (I use Microsoft Visual Studio 2008 as the IDE). After a few minor changes, I was able to compile all files - IVF can easily handle Fortran 77 code mixed with Fortran 95 syntax which I had to add.
However, the real problem comes with linking. There are two issues which I (as a newbie) am not able to resolve even after going through various forums and help files:
1. I have a DLL created written in C++ using Visual Studio .NET; it contains some functions to write into the system event log, so it is not using any allocations or I/O operations. It was very easy to just add this DLL to the Open Watcom Fortran (OWF) project and the linker handled it automatically using wlib meaning Watcom Library Manager. How do I link the DLL in IVF? Is there any easy way or any tutorial dealing with this? Adding the DLL to the Solution Explorer in Visual Studio is obviously not the right way. I should mention that I have the DLL in the same project directory as all the .for source files.
2. I have several OBJs which are quite old, I don't know where they are coming from and I don't have the corresponding source code anymore. They might have been created using Visual C++ 6.0 or Watcom Fortran 77. Once again, just adding the OBJ files to the OWF project was the only thing to be done for the linker to link them. Trying the same in IVF gives me an error "fatal error LNK1107: invalid or corrupt file: cannot read at ...". Is there anything I can try to link these OBJs? If not, I would have to rewrite all methods/functions included in them (after finding out what they are supposed to do).
Thank you in advance for any suggestions, ideas or advice.
I am trying to rewrite a code from (Open) Watcom Fortran 77 to Intel Visual Fortran (I use Microsoft Visual Studio 2008 as the IDE). After a few minor changes, I was able to compile all files - IVF can easily handle Fortran 77 code mixed with Fortran 95 syntax which I had to add.
However, the real problem comes with linking. There are two issues which I (as a newbie) am not able to resolve even after going through various forums and help files:
1. I have a DLL created written in C++ using Visual Studio .NET; it contains some functions to write into the system event log, so it is not using any allocations or I/O operations. It was very easy to just add this DLL to the Open Watcom Fortran (OWF) project and the linker handled it automatically using wlib meaning Watcom Library Manager. How do I link the DLL in IVF? Is there any easy way or any tutorial dealing with this? Adding the DLL to the Solution Explorer in Visual Studio is obviously not the right way. I should mention that I have the DLL in the same project directory as all the .for source files.
2. I have several OBJs which are quite old, I don't know where they are coming from and I don't have the corresponding source code anymore. They might have been created using Visual C++ 6.0 or Watcom Fortran 77. Once again, just adding the OBJ files to the OWF project was the only thing to be done for the linker to link them. Trying the same in IVF gives me an error "fatal error LNK1107: invalid or corrupt file: cannot read at ...". Is there anything I can try to link these OBJs? If not, I would have to rewrite all methods/functions included in them (after finding out what they are supposed to do).
Thank you in advance for any suggestions, ideas or advice.
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
1. Dynamically. Usually your exe loads the module (dll) because it invokes one of its exports.
2. I'd say you're out of luck if you don't have the source. Arbitrary .obj's can't be linked to anything other than to those of similar ilk. You'll have to rewrite them I'm afraid.
Gerry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you for your reply. Fortunately, I can replace some subroutines from OBJ files by what is available in IVF; I will have to write the rest from scratch.
As for the DLL problem, I realized that it is rather a problem of calling functions from the DLL than a problem of linking the DLL.
As for the DLL problem, I realized that it is rather a problem of calling functions from the DLL than a problem of linking the DLL.

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