General question linking Fortran to C/C++ using MFC
-
I’ve been working up the learning curve trying to link F77 functions and subroutines to C/C++ (Pentium, XP, VC++6). I got stuff to work using MinGW’s f77, gcc and g++ compilers in console mode. So now I’m trying to switch to a dialog GUI. I would like to use MFC. When I got to compiling the .rc file (using windres in MinGW), I started to run into problems. I see that MinGW supports WIN32 API but my suspicion is that it does not work with MFC. Not much on the subject on the net that I was able to find so I would appreciate any perils you(‘ll) can give up. Just a beginner so please reply in a Newbie dialect of English if you don’t mind. Thanks, Mike
-
I’ve been working up the learning curve trying to link F77 functions and subroutines to C/C++ (Pentium, XP, VC++6). I got stuff to work using MinGW’s f77, gcc and g++ compilers in console mode. So now I’m trying to switch to a dialog GUI. I would like to use MFC. When I got to compiling the .rc file (using windres in MinGW), I started to run into problems. I see that MinGW supports WIN32 API but my suspicion is that it does not work with MFC. Not much on the subject on the net that I was able to find so I would appreciate any perils you(‘ll) can give up. Just a beginner so please reply in a Newbie dialect of English if you don’t mind. Thanks, Mike
Do you have Visual Studio (or just Visual C++) installed? My guess is that you probably don't have the MFC headers and libraries (assuming you don't have them installed). If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week Zac
-
Do you have Visual Studio (or just Visual C++) installed? My guess is that you probably don't have the MFC headers and libraries (assuming you don't have them installed). If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week Zac
I have Visual Studio 6 SP6 installed and use the VC++6 IDE. I have made MFC apps that run using the VC++ compiler. It is when I try to compile a source (or resource)created using MFC with MinGW compilers that I get into trouble. I have just come across some snippets that indicate that I will not be able to compile MFC source with MinGW compilers since, for one thing, MFC is copyrighted. I'll try again with a Win32 Application project. If that fails, I'll look into some other IDE supporting Win32 API. OK?
-
I have Visual Studio 6 SP6 installed and use the VC++6 IDE. I have made MFC apps that run using the VC++ compiler. It is when I try to compile a source (or resource)created using MFC with MinGW compilers that I get into trouble. I have just come across some snippets that indicate that I will not be able to compile MFC source with MinGW compilers since, for one thing, MFC is copyrighted. I'll try again with a Win32 Application project. If that fails, I'll look into some other IDE supporting Win32 API. OK?
deltaseq0 wrote:
for one thing, MFC is copyrighted
what does that have to do with anything? Cleek | Image Toolkits | Thumbnail maker
-
I have Visual Studio 6 SP6 installed and use the VC++6 IDE. I have made MFC apps that run using the VC++ compiler. It is when I try to compile a source (or resource)created using MFC with MinGW compilers that I get into trouble. I have just come across some snippets that indicate that I will not be able to compile MFC source with MinGW compilers since, for one thing, MFC is copyrighted. I'll try again with a Win32 Application project. If that fails, I'll look into some other IDE supporting Win32 API. OK?
It isn't so much that it is copyrighted as it is that the source code isn't completely available and you are trying to complile on a different compiler. If you are already using VC, I'm not sure why you would want to go to MinGW ... In any case, all MFC really is, is a set of thin wrappers around Win32 API's and objects. That is, if you know what parts of MFC you would be using, you could fairly easily make your own wrapper classes that do the same thing. If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week Zac
-
It isn't so much that it is copyrighted as it is that the source code isn't completely available and you are trying to complile on a different compiler. If you are already using VC, I'm not sure why you would want to go to MinGW ... In any case, all MFC really is, is a set of thin wrappers around Win32 API's and objects. That is, if you know what parts of MFC you would be using, you could fairly easily make your own wrapper classes that do the same thing. If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week Zac
From some of the MinGW sites: “ The MinGW basic runtime system, which is basically the glue to the underlying operating system, is completely in the public domain. The runtime system includes MinGW headers (such as stdio.h), libraries (such as libmingw32.a) and import libraries for CRTDLL/MSVCRT. W32API, which consists of the headers and import libraries related to WIN32 API access, is released under copyright . The copyright agreement states no restrictions are placed on programs or object files compiled with the library. Mingw provides access to the Win32 API. Theoretically, if you own the MFC source code you could build MFC libraries for Mingw. No one's tried this so far. If anyone does successfully accomplish it, please say so and it will be added to this document… “ MinGW is the common denominator to link Fortran to C/C++. From what I’ve seen, Cygwin can be used on windows machines as well. For example: g77 -c test.f 2 g++ -o test test.cpp test.o g77 will compile and assemble the Fortran source file test.f into the object file test.o g++ will compile and assemble the C++ source test.cpp and link it to the Fortran object file test.o and create the test.exe executable. I haven’t come across how this can be done with VC++. To the contrary, not being able to do this sort of thing is one of the driving forces behind multi language compiler utilities such as MinGW.