Hack Forums
[C] Cross Platform C++ Program - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118)
+---- Thread: [C] Cross Platform C++ Program (/showthread.php?tid=6077856)



Cross Platform C++ Program - testUser - May 13, 2020

Hi,
I am willing to write a software code in C++ for windows, but i use Linux [Ubuntu],
can someone help me in compilation of that Code so that it'd work in Windows too!
🙄


RE: Cross Platform C++ Program - SIM-3991524 - May 13, 2020

I think this is your answer? https://stackoverflow.com/questions/38786014/how-to-compile-executable-for-windows-with-gcc-with-linux-subsystem
Though the easiest way imo would be to run a windows 7 vm and compile your code in there


RE: Cross Platform C++ Program - saltycracker - May 14, 2020

To compile something for a particular platform requires a few things.
1. You need a compiler and linker that will produce the correct binary.
2. You need to link to the proper binaries that are present on that particular platform.

That's about it. It just a matter of downloading a compiler/linker that will output the correct binary format and have the additional header and associated binaries present.