user215721
user215721

Reputation: 317

How to run a compiled C++ code written originally for Linux in Windows?

I have the .tar.gz source of a (scientific) program written for Linux. I want to compile and run the program in Windows. I compiled the program in Windows using CodeBlocks (GCC) and now want to run it.

The program has some predefined scenarios (inputs) as example, that are (seemingly) stored as .h files.

In Linux, I run them this way: (the name of the program is PROG)

$ \.PROG sample

and it shows the computed output. Now that I've compiled it in Windows how can I do the same here?

Upvotes: 1

Views: 291

Answers (2)

Angelos Makrygiorgos
Angelos Makrygiorgos

Reputation: 1452

You can run the program from inside codeblocks. You should go to Project -> Set Program Arguments and write "sample" to do so.

Upvotes: 1

sashang
sashang

Reputation: 12194

Normally when running a program on Linux I use:

./prog

and on Windows I remove the ./ because the current working directory is already included in the search path. On a typical linux shell it is not, which is why you have to use ./when the program is not in one of the directories in PATH.

Upvotes: 1

Related Questions