开发者

Running a particular c file in linux

i am very new to unix/linux/c which i guess is why i am in this predicament.

Anyway, i have just completed a c programme assignmnet and am trying to run it from linux terminal. So far i can create the main programme by

navigating to the folder running gcc myFile.c then doing .a/.out

this then runs my programme from the terminal window. Thats fine, however to test our output out teacher gave us another file - i guess it has certain conditional checks to tets our outputs are correct. On inspection it appears to be a .exe file with the name myFile_ok.exe

to run it i have tried to do the above steps

navigating to the folder doing ./myFile_ok.exe

but i get an error saying myFile_ok : cannot execute binary file

Any ideas how i actually can run this file at all?

开发者_开发百科

Thank you

edit: there is also a make file if that makes answering my question any easier?


You'll have to use wine or mono to run it, since it's not a Linux executable. Run file against it to be sure.


If the filename ends in .exe it is most likely a Windows executable, which you would not be able to run under Linux. (Maybe you could run it under Wine but that's probably beyond the scope of your assignment).

Probably easier to recompile your program on a Windows PC and test there. If you get Cygwin you can still compile with gcc.


Put the makefile in the same directory as the c file and run make in the terminal. The makefile means that you shouldn't have to worry about the compilation steps - it'll just do it for you.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜