I've got some code I wrote in MSVC++ 6 and I'd like to run it in Linux. Can I compile my code for Linux?
I've got some code I wrote in MSVC++ 6 and I'd like to run it in Linux. Can I compile my code for Linux?
Code that complies to standard ANSI C should work. Code that relies on OS specific functionality will not. POSIX compliant code should compile aswell. My guess is that your code will need altleast alittle bit of work before it compiles correctly in *NIX.
It's just a basic app that is in the console. I'll try the above command and get back.
This is the output I got during compile.
Everything still worked and the app ran fine in the command line. Should I be worried about the given output?Code:[Chris@Jupiter Chris]$ g++ Condition.c -o binary Condition.c:27:1: warning: no newline at end of file /tmp/ccKQfdh4.o: In function `testCondition(void)': /tmp/ccKQfdh4.o(.text+0x48): the `gets' function is dangerous and should not be used.
Should you be worried about there not being a new line at the end of the file? Eh... depends. It doesn't really harm your code at all, but the syntax checker likes it there.
Should you be worried about the gets function? Oh, but definitely. Look up fgets() instead; it basically does the same thing, but is a "safe" version of it. basically, fgets() will only read in a specifically designated number of chars at a time, and so you can prevent it from reading more data than your buffer can hold.
starX
www.axisoftime.com
If its for console you might have to change some things (like conio.h functions), it its Windows API, sorry, but you probably have to code it again