Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. General question linking Fortran to C/C++ using MFC

General question linking Fortran to C/C++ using MFC

Scheduled Pinned Locked Moved C / C++ / MFC
c++learningjsonquestion
6 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    deltaseq0
    wrote on last edited by
    #1

    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

    Z 1 Reply Last reply
    0
    • D deltaseq0

      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

      Z Offline
      Z Offline
      Zac Howland
      wrote on last edited by
      #2

      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

      D 1 Reply Last reply
      0
      • Z Zac Howland

        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

        D Offline
        D Offline
        deltaseq0
        wrote on last edited by
        #3

        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?

        C Z 2 Replies Last reply
        0
        • D deltaseq0

          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?

          C Offline
          C Offline
          Chris Losinger
          wrote on last edited by
          #4

          deltaseq0 wrote:

          for one thing, MFC is copyrighted

          what does that have to do with anything? Cleek | Image Toolkits | Thumbnail maker

          1 Reply Last reply
          0
          • D deltaseq0

            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?

            Z Offline
            Z Offline
            Zac Howland
            wrote on last edited by
            #5

            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

            D 1 Reply Last reply
            0
            • Z Zac Howland

              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

              D Offline
              D Offline
              deltaseq0
              wrote on last edited by
              #6

              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.

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups