User forums > Using Code::Blocks

Same project under Linux and Windows?

(1/2) > >>

Sephiroth:
I am about to start a cross-platform project which will include a library for functionality and a GUI front-end, likely in Qt. I want the application to work on Linux (I use Plasma) and Windows 7 and up. Instead of having two copies of the project, I was considering placing the project on a Google Drive and setting build properties to the local drives of the Windows and Linux systems. How would I go about this, or is it even possible yet?

sodev:
Use git or any other RCS/VCS. Really, this is the way. CodeBlocks does support different platform configurations inside one project file, but depending on the required different settings it might be easier to use different projects per platform like CodeBlocks does itself.

BlueHazzard:
The general idea is to create a target per platform:
Project->Properties->Build targets->Platform
ecc...

If you have the same source libraries, you can use global variables to differentiate between your windows and linux machine
http://wiki.codeblocks.org/index.php/Global_compiler_variables

AndrewCot:
If you are going to use QT then IMHO use QT Creator. On Windows use MSYS2 (https://www.msys2.org/) and on Linux use the packages from the distro. The one QT project can be used for windows and Linux.
If you want to use Codeblocks have a look at wxWidget or SDL2 as a cross platform GUI. Unfortunately you will end up with two projects, one for Windows and one for Linux, but it is relatively easy to keep them in sync as they are text files and can be diffed using Winmerge on Windows or Meld on Linux.

BlueHazzard:

--- Quote --- Unfortunately you will end up with two projects
--- End quote ---
As i said, this is not strictly needed... But this is nitpicking :)

Navigation

[0] Message Index

[#] Next page

Go to full version