0

I want to create a binary file after compiling .cpp file and create a plug-in for a speech processing software (Praat). However, this binary file creates compatibility issues on different platforms (Windows, Mac , Linux). I want to solve this by compiling the code using CMake.

Am I correct? I'm new to CMake. Could anyone provide any insight?

Dev-iL
  • 23,742
  • 7
  • 57
  • 99
  • 1
    cmake only manages software building process according to make file - some kind of script that describe what to do with your source code and libraries used by your code. If you want building at one platform for different platforms, some conditions should be in make file. And of course you need compiler able to make such builds. – VolAnd Dec 13 '16 at 05:48

1 Answers1

0

No, Cmake just help you in building process, clearly it makes Makefile's for you. you cannot compile a cpp file to a single (or plugable) binary file and expect that it could work on different platforms.

Also you could write your programs with Cross-Platform in mind, but they need to be compiled for each platform. You could use platforms like Qt or Boost which help you write more Cross-Platform codes and compile them under different platforms without worrying about differences.

Also, The Qt has its own build system named QMake which is very easy to use and your use qmake instead of cmake to make a cross platform build system.

Also if you need truly cross platform binary programs, you could try things like Java.

e.jahandar
  • 1,715
  • 12
  • 30
  • My goal is to get a binary file , and use this to create plug- in Praat(Speech Processing Software).But I compiled the .cpp file using gcc(I use Linux -16 version) , which causes compatibility issues in lower Linux versions and Windows and Mac.I want to solve this problem .Since Cmake is available in Mac and Windows , I had this assumption that , once compiled using Cmake , the resultant binary file would work across platforms and versions.From your previous post , you are telling that this is not possible , instead try with Boost/Qt .Am I right ? (SOrry for being Naive Im new and still learng – aishwarya selvaraj Dec 13 '16 at 09:43
  • right, you cannot build single native binary programs for different platforms. if you want code C++ you can try Qt, its a comprehensive cross-platform C++ platform which help you to build programs for different platforms without worrying about platform restrictions. – e.jahandar Dec 13 '16 at 09:49