Tips/Resources for Large Scale Cross-Platform Software Projects

前端 未结 2 1504
孤城傲影
孤城傲影 2021-02-09 16:25

I\'m going to be starting a large scale software project involving a cross-platform GUI and heavy number crunching. I plan on writing most of the application back-end in C++ an

相关标签:
2条回答
  • 2021-02-09 17:25

    1) The structure can be the same, but if you're including files in subdirectories, make sure you use '/ and not \. The former will also work on windows.

    2) I'd check out cmake ( http://www.cmake.org/ ) for managing building across multiple platforms. This will take a lot of pain out of the process for you.

    3) Use STL and Boost as much as you can. These libraries have been designed with this very problem in mind. This will cover a huge portion of what you might need to do. You've already chosen the excellent Qt library, so your GUI is not an issue either. With these 3 combined, you're already most of the way there. That said, you might have to do something that is platform independent and not covered by any of these. For this I suggest you write a class that exposes a consistent interface across all platforms, and hide the nitty-gritty with preprocessor directives in the source file. It is imperative to expose a consistent interface.

    4) Use SVN. I don't know how to do it on other compilers, but it is trivial in Visual Studio to get the latest revision and insert it in to some file that then gets included in your project. You can use build events to do this. Sorry I can't elaborate on other platforms.

    In addition, if you have to head outside of STL, Boost, Qt etceteras, be mindful of the documentation of the API calls on all platforms. I have been bitten in the past by the behavior of a fseek() API call that wrote bytes to pad out to the destination on one implementation, but not the other. These can be a major cause of headache and another reason to try and stick to tried-and-tested libraries as mentioned above.

    0 讨论(0)
  • 2021-02-09 17:28

    Qt will match your reqs, IMO.. I will answer with correspondence to Qt.

    Regarding the structure of the files, you can have source files *.cpp and *.h in a folder, the remaining libraries and dependencies in some other folder. You can create *.ui files using Qt designer or you can code them directly as well. (In which the later will increase the compile time considerably) The generated files (like *.exe,*.obj, etc.,) can be put it in a separate folder so that your file system will look consistent. There are simple ways of doing all those said above in Qt. Check out QMake here..

    Regarding portability, you can port Qt applications across various platforms easily. Check out here..

    Regarding source control, I am used to SVN and we are fine with it. Just choose a one that satisfies your need.

    Since you are about to graduate, Qt has clearly some advantages when compared to others.

    1. From the links I provided to you, you could have understood that the documentation for Qt is extensive and you can work on it without much professional support.
    2. And also most importantly Qt is in LGPL and you can play for free... :)

    HTH..

    0 讨论(0)
提交回复
热议问题