I would like to make a simple database-like software. It will work like MySQL/PostgreSQL but it will be very, very simple and different. It should work on both Windows and Linux (just like MySQL/PostgreSQL do). I want to do that in C++.
Is there a compiler I can use to write one code, and then compile that code to both platforms? Of course these could be two different compilers, each compiling for one platform.
To answer one of the questions below - yes it's clear to me that I can't have one binary for both platforms. I want to use one code and get two different binaries as a result using probably 2 different compilers.
You can compile on windows using MinGW for Windows and gcc on Linux: MinGW is a minimalist implementation of gcc for windows. It's "the same compiler", however it's wont produce the same binary, because one is for windows, the other for linux.
It's better to write portable and standard code, so that you do not rely on any particular compiler. This way, it will compile under most platform and compilers. Boost, Qt, Ace are some example cross-platform libraries that you could use.