2

How do I make a good project structure that allows me to work on Linux as well as Windows with Visual Studio?

So far I've only been using my Linux machine when working on my project and I used this, A Simple C++ Project Structure.

For each application, the folders are:

* bin: The output executables go here, both for the app and for any tests and spikes.
* build: This folder contains all object files, and is removed on a clean.
* doc: Any notes, like ...
* include: All project header files. ...
* lib: Any libs that get compiled by the project, third party ...
* spike: I often write smaller classes or files to test technologies or ideas, and keep them around for future reference. They go here,...
* src: The application and only the application’s source files.
* test: All test code files. ...

However, I can't do that anymore, because I want to be able to work on it on both my Linux and Windows machines.

  • 6
    I don't think you need to change your project structure in order to be able to build on linux and winodws. You need cross-platform build tools. One such tool that I am familiar with is qmake. cmake is another tool. – R Sahu Jun 12 '17 at 4:51
  • Agreed with @RSahu - the structure will ne more or less the same, only with two build directories (one for Linux/Makefiles and one for Visual Studio). I strongly advise to move to CMake as it will make it really simple to manage the two builds in one place (keeps things DRY) – Tibo Jun 16 '17 at 7:07
  • @RSahu -- Your comment would make a good answer. – Jasper Jun 17 '17 at 17:51
  • @Tibu -- Your comment would make a good answer. – Jasper Jun 17 '17 at 17:51
2

I don't think you need to change your project structure in order to be able to build on linux and winodws. You need a cross-platform build tool. One such tool that I am familiar with and use on an almost daily basis is qmake. cmake is another tool that I have read about but never used.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.