I develop C ++ software on Windows 32-bit (using MSVC ++), but since I want to be able to use my software on each platform, I decided to use CMake as a build generator.
Therefore, I am still new to CMake. From the CMake tutorials, I understand that in order to cross-compile the codes, an instrument chain must first be installed on the host platform that simulates the target platform. Then, using the appropriate C and C ++ compilers of the target platform provided by this toolchain, CMake will be able to create make files, etc.
Now I want to create my own code for the Linux platform (GNU / Linux) on the Win32 platform. I tried to perform the above procedure using CMake in combination with Cygwin and use gcc and g ++ as compilers. He created beautiful, created makefiles, and when I released "make" on the Cygwin terminal, the generated makefiles were "made". Now I have an executable that I was hoping to run on the Linux platform. But on Linux, I get an error: bash cannot execute the binary.
Using the batch file executablename, I realized that the executable created by the above procedure is of type PE32, which is designed only for Windows.
Now my question is: do I understand the cross-platform build procedure using cmake correctly? Or do I just need to use another Linux toolchain under the windows to get the Linux ELF executable? What tips come to mind that will give me what I want?
Thank you very much
Setareh
source share