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. Platform independent library - Suggestions needed

Platform independent library - Suggestions needed

Scheduled Pinned Locked Moved C / C++ / MFC
c++questioncsharpasp-netwpf
17 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.
  • C Offline
    C Offline
    Christian Flutcher
    wrote on last edited by
    #1

    Hello, I am planning to develop an opensource application which has to work on all three popular platforms (Linx, MAC and Windows). The application will have a core engine which is same for all the platforms and the UI will be different for each platform. For windows, I plan to use WPF and for LINUX and MAC someother opensource UI framework. I need to make the core engine as platform independent, hence I plan to write it on C++. How do I start about it? I am fairly new to C++ (I know the basics). I know MFC is only for windows. Is it possible to develop a library which woks on all platforms using VC++? What are the other alternatives I have?

    R 1 Reply Last reply
    0
    • C Christian Flutcher

      Hello, I am planning to develop an opensource application which has to work on all three popular platforms (Linx, MAC and Windows). The application will have a core engine which is same for all the platforms and the UI will be different for each platform. For windows, I plan to use WPF and for LINUX and MAC someother opensource UI framework. I need to make the core engine as platform independent, hence I plan to write it on C++. How do I start about it? I am fairly new to C++ (I know the basics). I know MFC is only for windows. Is it possible to develop a library which woks on all platforms using VC++? What are the other alternatives I have?

      R Offline
      R Offline
      Rajesh R Subramanian
      wrote on last edited by
      #2

      Christian Flutcher wrote:

      For windows, I plan to use WPF and for LINUX and MAC someother opensource UI framework.

      Please have a look at the following links. All of them are completely cross-platform: Visual Component Framework[^] - This one is developed and maintained by one of our fellow CPians, namely Jim Crafton. WX Widgets[^] QT[^]

      Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche .·´¯`·->Rajesh<-·´¯`·. [Microsoft MVP - Visual C++]

      C 1 Reply Last reply
      0
      • R Rajesh R Subramanian

        Christian Flutcher wrote:

        For windows, I plan to use WPF and for LINUX and MAC someother opensource UI framework.

        Please have a look at the following links. All of them are completely cross-platform: Visual Component Framework[^] - This one is developed and maintained by one of our fellow CPians, namely Jim Crafton. WX Widgets[^] QT[^]

        Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche .·´¯`·->Rajesh<-·´¯`·. [Microsoft MVP - Visual C++]

        C Offline
        C Offline
        Christian Flutcher
        wrote on last edited by
        #3

        Rajesh R Subramanian wrote:

        Visual Component Framework[^] - This one is developed and maintained by one of our fellow CPians, namely Jim Crafton. WX Widgets[^] QT[^]

        Thanks for that :) You already suggested these when we had a lounge discussion on the same subject. Thanks anyway. For writting the core engine, which compiler should I use? I have to make it as a DLL. And is it possible to use the Visual Studio editor even if I am not using MFC/C++ CLI?

        R 1 Reply Last reply
        0
        • C Christian Flutcher

          Rajesh R Subramanian wrote:

          Visual Component Framework[^] - This one is developed and maintained by one of our fellow CPians, namely Jim Crafton. WX Widgets[^] QT[^]

          Thanks for that :) You already suggested these when we had a lounge discussion on the same subject. Thanks anyway. For writting the core engine, which compiler should I use? I have to make it as a DLL. And is it possible to use the Visual Studio editor even if I am not using MFC/C++ CLI?

          R Offline
          R Offline
          Rajesh R Subramanian
          wrote on last edited by
          #4

          Christian Flutcher wrote:

          For writting the core engine, which compiler should I use?

          On Windows, you may use Visual C++ (Yes, visual studio).

          Christian Flutcher wrote:

          And is it possible to use the Visual Studio editor even if I am not using MFC/C++ CLI?

          Usually, there should be a way to get those open source frameworks (like WxWidgets, QT, etc.,) to work on VS IDE itself. After all, VS is just an IDE. Consult with the corresponding websites of those frameworks. But some may have its own IDE and that should not be a problem though - the IDE should work on all platforms, which is better in fact. Not to mention that you will need to compile your application separately on the all of the target OS for generating the corresponding binaries of that OS. :)

          Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche .·´¯`·->Rajesh<-·´¯`·. [Microsoft MVP - Visual C++]

          C 1 Reply Last reply
          0
          • R Rajesh R Subramanian

            Christian Flutcher wrote:

            For writting the core engine, which compiler should I use?

            On Windows, you may use Visual C++ (Yes, visual studio).

            Christian Flutcher wrote:

            And is it possible to use the Visual Studio editor even if I am not using MFC/C++ CLI?

            Usually, there should be a way to get those open source frameworks (like WxWidgets, QT, etc.,) to work on VS IDE itself. After all, VS is just an IDE. Consult with the corresponding websites of those frameworks. But some may have its own IDE and that should not be a problem though - the IDE should work on all platforms, which is better in fact. Not to mention that you will need to compile your application separately on the all of the target OS for generating the corresponding binaries of that OS. :)

            Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche .·´¯`·->Rajesh<-·´¯`·. [Microsoft MVP - Visual C++]

            C Offline
            C Offline
            Christian Flutcher
            wrote on last edited by
            #5

            Rajesh R Subramanian wrote:

            On Windows, you may use Visual C++ (Yes, visual studio).

            I plan to use the borland compiler and use VS as editor. After completing it, I need to compile it for each platform, right? Do you know that compiler allows to create a DLL for that class in windows? Thanks for taking time to help me. Your replies were really helpful. Thanks again :)

            R 1 Reply Last reply
            0
            • C Christian Flutcher

              Rajesh R Subramanian wrote:

              On Windows, you may use Visual C++ (Yes, visual studio).

              I plan to use the borland compiler and use VS as editor. After completing it, I need to compile it for each platform, right? Do you know that compiler allows to create a DLL for that class in windows? Thanks for taking time to help me. Your replies were really helpful. Thanks again :)

              R Offline
              R Offline
              Rajesh R Subramanian
              wrote on last edited by
              #6

              Christian Flutcher wrote:

              I plan to use the borland compiler and use VS as editor.

              Is there a specific reason to it? If you are using the VS, then why not use the Visual C++ compiler itself?

              Christian Flutcher wrote:

              After completing it, I need to compile it for each platform, right?

              Yes, you will need to compile your code on each and every platform that you plan to deploy it on.

              Christian Flutcher wrote:

              Do you know that compiler allows to create a DLL for that class in windows?

              A DLL is also a mere PE File[^], and you will be able to create one with any compiler. If you need to know how to create a DLL and use it, I will suggest this series of 4 articles written by Hans Dietrich: http://www.codeproject.com/KB/DLL/XDllPt1.aspx[^] (Links to next parts of the series is on the article itself) Also, see this: Regular DLL tutorial for beginners[^] Write back if there's any trouble.

              Christian Flutcher wrote:

              Thanks for taking time to help me. Your replies were really helpful. Thanks again Smile

              My pleasure. :)

              Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche .·´¯`·->Rajesh<-·´¯`·. [Microsoft MVP - Visual C++]

              C 1 Reply Last reply
              0
              • R Rajesh R Subramanian

                Christian Flutcher wrote:

                I plan to use the borland compiler and use VS as editor.

                Is there a specific reason to it? If you are using the VS, then why not use the Visual C++ compiler itself?

                Christian Flutcher wrote:

                After completing it, I need to compile it for each platform, right?

                Yes, you will need to compile your code on each and every platform that you plan to deploy it on.

                Christian Flutcher wrote:

                Do you know that compiler allows to create a DLL for that class in windows?

                A DLL is also a mere PE File[^], and you will be able to create one with any compiler. If you need to know how to create a DLL and use it, I will suggest this series of 4 articles written by Hans Dietrich: http://www.codeproject.com/KB/DLL/XDllPt1.aspx[^] (Links to next parts of the series is on the article itself) Also, see this: Regular DLL tutorial for beginners[^] Write back if there's any trouble.

                Christian Flutcher wrote:

                Thanks for taking time to help me. Your replies were really helpful. Thanks again Smile

                My pleasure. :)

                Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche .·´¯`·->Rajesh<-·´¯`·. [Microsoft MVP - Visual C++]

                C Offline
                C Offline
                Christian Flutcher
                wrote on last edited by
                #7

                Rajesh R Subramanian wrote:

                Is there a specific reason to it? If you are using the VS, then why not use the Visual C++ compiler itself?

                Correct. But this class should compile with other compilers which are in LINUX and MAC. So I think, using VC++ compiler won't allow me to compile the same code on other platforms. Correct me if I am wrong.

                M R 2 Replies Last reply
                0
                • C Christian Flutcher

                  Rajesh R Subramanian wrote:

                  Is there a specific reason to it? If you are using the VS, then why not use the Visual C++ compiler itself?

                  Correct. But this class should compile with other compilers which are in LINUX and MAC. So I think, using VC++ compiler won't allow me to compile the same code on other platforms. Correct me if I am wrong.

                  M Offline
                  M Offline
                  markkuk
                  wrote on last edited by
                  #8

                  Using VC++ compiler on Windows has nothing to do with compiling on other platforms. If you write portable code, it will compile on any standard-conforming C++ compiler including VC++.

                  C 1 Reply Last reply
                  0
                  • M markkuk

                    Using VC++ compiler on Windows has nothing to do with compiling on other platforms. If you write portable code, it will compile on any standard-conforming C++ compiler including VC++.

                    C Offline
                    C Offline
                    Christian Flutcher
                    wrote on last edited by
                    #9

                    Okay. So I shoud not use any MFC classes. Use plain C++ classes for it, right?

                    R 1 Reply Last reply
                    0
                    • C Christian Flutcher

                      Rajesh R Subramanian wrote:

                      Is there a specific reason to it? If you are using the VS, then why not use the Visual C++ compiler itself?

                      Correct. But this class should compile with other compilers which are in LINUX and MAC. So I think, using VC++ compiler won't allow me to compile the same code on other platforms. Correct me if I am wrong.

                      R Offline
                      R Offline
                      Rajesh R Subramanian
                      wrote on last edited by
                      #10

                      Christian Flutcher wrote:

                      But this class should compile with other compilers which are in LINUX and MAC. So I think, using VC++ compiler won't allow me to compile the same code on other platforms.

                      Using the Visual C++ IDE necessarily not mean using the Windows API and Windows specific things like MFC, ATL, etc,. As another user pointed out, write plain and portable C++ code, which is standards-conformant and that should compile on any standard C++ compiler. Hope that helps. :)

                      Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche .·´¯`·->Rajesh<-·´¯`·. [Microsoft MVP - Visual C++]

                      C 2 Replies Last reply
                      0
                      • C Christian Flutcher

                        Okay. So I shoud not use any MFC classes. Use plain C++ classes for it, right?

                        R Offline
                        R Offline
                        Rajesh R Subramanian
                        wrote on last edited by
                        #11

                        Christian Flutcher wrote:

                        Okay. So I shoud not use any MFC classes. Use plain C++ classes for it, right?

                        Right. Using the VC++ IDE not necessarily mean using MFC or ActiveX, which are specific to Windows. I just typed that out to you on another reply and you've posted it at the same time. :)

                        Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche .·´¯`·->Rajesh<-·´¯`·. [Microsoft MVP - Visual C++]

                        1 Reply Last reply
                        0
                        • R Rajesh R Subramanian

                          Christian Flutcher wrote:

                          But this class should compile with other compilers which are in LINUX and MAC. So I think, using VC++ compiler won't allow me to compile the same code on other platforms.

                          Using the Visual C++ IDE necessarily not mean using the Windows API and Windows specific things like MFC, ATL, etc,. As another user pointed out, write plain and portable C++ code, which is standards-conformant and that should compile on any standard C++ compiler. Hope that helps. :)

                          Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche .·´¯`·->Rajesh<-·´¯`·. [Microsoft MVP - Visual C++]

                          C Offline
                          C Offline
                          Christian Flutcher
                          wrote on last edited by
                          #12

                          Rajesh R Subramanian wrote:

                          write plain and portable C++ code, which is standards-conformant and that should compile on any standard C++ compiler. Hope that helps

                          Indeed. I am cleared now. Thanks. BTW, all these C++ things are bit confusing compared to C#, isn't it?

                          R 1 Reply Last reply
                          0
                          • R Rajesh R Subramanian

                            Christian Flutcher wrote:

                            But this class should compile with other compilers which are in LINUX and MAC. So I think, using VC++ compiler won't allow me to compile the same code on other platforms.

                            Using the Visual C++ IDE necessarily not mean using the Windows API and Windows specific things like MFC, ATL, etc,. As another user pointed out, write plain and portable C++ code, which is standards-conformant and that should compile on any standard C++ compiler. Hope that helps. :)

                            Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche .·´¯`·->Rajesh<-·´¯`·. [Microsoft MVP - Visual C++]

                            C Offline
                            C Offline
                            Christian Flutcher
                            wrote on last edited by
                            #13

                            Last question, Is it possible to use reflection in standard C++? I need to invoke a class from it's name. It's trivial in C# .NET like Activator.CreateInstance will do, but what about C++?

                            R 1 Reply Last reply
                            0
                            • C Christian Flutcher

                              Rajesh R Subramanian wrote:

                              write plain and portable C++ code, which is standards-conformant and that should compile on any standard C++ compiler. Hope that helps

                              Indeed. I am cleared now. Thanks. BTW, all these C++ things are bit confusing compared to C#, isn't it?

                              R Offline
                              R Offline
                              Rajesh R Subramanian
                              wrote on last edited by
                              #14

                              Christian Flutcher wrote:

                              BTW, all these C++ things are bit confusing compared to C#, isn't it?

                              Definitely NO. The managed world is a much larger mess when compared. There is a new .NET framework for download, every couple of days. There is a new technology every fortnight. By the time you finish mastering a new feature related to C#, that becomes obsolete. But that's not the case with C++. It is an old-timer language and exists for a "different" purpose. By all means, we should not compare C++ and .NET. One is a language and another is a framework. They both serve for different purposes and as I've said several times, they cannot rival each other on what they were built to do. But to my fortune, .NET was built with C++. Or just to be rude, "My compiler compiled your compiler". :) C++ is just C++. Things like MFC, VCF, etc., are frameworks that are built with and built to work with C++, which might be confusing at the beginning. I suggest that you master the actual language itself first and then move on to technologies that were built with C++. I talked too much - but hey, that's your fault. :-D

                              Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche .·´¯`·->Rajesh<-·´¯`·. [Microsoft MVP - Visual C++]

                              C 1 Reply Last reply
                              0
                              • C Christian Flutcher

                                Last question, Is it possible to use reflection in standard C++? I need to invoke a class from it's name. It's trivial in C# .NET like Activator.CreateInstance will do, but what about C++?

                                R Offline
                                R Offline
                                Rajesh R Subramanian
                                wrote on last edited by
                                #15

                                Christian Flutcher wrote:

                                Is it possible to use reflection in standard C++?

                                With standard C++, NO. Reflection is something that is within the managed (.NET) world. I would also recommend that you start a new thread if you have a "totally new" question. That would kinda fetch replies from more people and give more visibility to your query. :)

                                Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche .·´¯`·->Rajesh<-·´¯`·. [Microsoft MVP - Visual C++]

                                C 1 Reply Last reply
                                0
                                • R Rajesh R Subramanian

                                  Christian Flutcher wrote:

                                  BTW, all these C++ things are bit confusing compared to C#, isn't it?

                                  Definitely NO. The managed world is a much larger mess when compared. There is a new .NET framework for download, every couple of days. There is a new technology every fortnight. By the time you finish mastering a new feature related to C#, that becomes obsolete. But that's not the case with C++. It is an old-timer language and exists for a "different" purpose. By all means, we should not compare C++ and .NET. One is a language and another is a framework. They both serve for different purposes and as I've said several times, they cannot rival each other on what they were built to do. But to my fortune, .NET was built with C++. Or just to be rude, "My compiler compiled your compiler". :) C++ is just C++. Things like MFC, VCF, etc., are frameworks that are built with and built to work with C++, which might be confusing at the beginning. I suggest that you master the actual language itself first and then move on to technologies that were built with C++. I talked too much - but hey, that's your fault. :-D

                                  Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche .·´¯`·->Rajesh<-·´¯`·. [Microsoft MVP - Visual C++]

                                  C Offline
                                  C Offline
                                  Christian Flutcher
                                  wrote on last edited by
                                  #16

                                  That's why I love C++ than anyother language and trying my best to learn it. People like you are a real inspiration.

                                  Rajesh R Subramanian wrote:

                                  I talked too much

                                  :) I loved that.

                                  1 Reply Last reply
                                  0
                                  • R Rajesh R Subramanian

                                    Christian Flutcher wrote:

                                    Is it possible to use reflection in standard C++?

                                    With standard C++, NO. Reflection is something that is within the managed (.NET) world. I would also recommend that you start a new thread if you have a "totally new" question. That would kinda fetch replies from more people and give more visibility to your query. :)

                                    Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche .·´¯`·->Rajesh<-·´¯`·. [Microsoft MVP - Visual C++]

                                    C Offline
                                    C Offline
                                    Christian Flutcher
                                    wrote on last edited by
                                    #17

                                    Okay. I should stop bothering you now. I will look into the reflection stuff later. Thanks for the help and have a great day.

                                    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