0
0
0685582016-12-19 15:43:13
C++ / C#
068558, 2016-12-19 15:43:13

C++ program on external media for Win, Linux, Mac OS?

Good afternoon.
Tell me, is it possible to run a program written in C ++, which is located on external media, on all operating systems without recompiling?
Those.
There is a program that uses / modifies certain files on a flash drive. For example, there is a file "age". The user enters his age and this value is stored in this file (for example, this value was entered by a Linux user), then when starting this program from a flash drive under Windows, the user could enter his age and it would be written to the same file and any user of any OS could get the data from the "age" file.
What is the best way to organize such a program?
Compile several versions of the program for each OS on a USB flash drive and run the desired version with a specific OS?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
Rou1997, 2016-12-19
@Rou1997

Compile several versions of the program for each OS on a USB flash drive

There are no other options for C++, since it is compiled into "native" machine code for one family of processors, linked into a "native" OS-dependent executable format.
"Never say..."

J
Jacob E, 2016-12-19
@Zifix

Compile several versions of the program for each OS on a USB flash drive and run the desired version with a specific OS?

Yes
The file is in Utf8, you can take Qt which has excellent QString with unicode support. True, you will also have to drag libraries for all three operating systems ...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question