PDA

View Full Version : how can i run my c program in ubuntu?



zdcode81
September 23rd, 2005, 08:28 AM
the problem is i am a new user of ubuntu, i have a program that i made it in c language using windows how can i run those program?

thumper
September 23rd, 2005, 09:53 AM
the problem is i am a new user of ubuntu, i have a program that i made it in c language using windows how can i run those program?
That very much depends on whether or not you are using any Windows specific C calls.

If you have a file called test.c, then you compile it with the command

gcc test.c

And run it with

./a.out

If you want to call your program foo instead of the default (which is not that usefull really), do this

gcc -o foo test.c

toojays
September 24th, 2005, 02:40 AM
Additionally, if your program does use windows specific calls, you may be able to get it to compile in Ubuntu by installing the libwine-dev package, and using winegcc instead of gcc.