PDA

View Full Version : compiling in linux vs. windows



megiddo
January 27, 2005, 10:23 PM
Hey guys, i recently switched to linux. And im doing my C programming course up at utech. today i was trying to compile some code using kate, and it said that i didnt have stdio.h on my machine. there are some other syntax errors and sucht things that do not occur in windows at all. does anyone know of any equivalent libraries etc for programming in linux vs windows? plz, i really need to sort this out, because i hate using windows.

leoandru
January 27, 2005, 10:34 PM
Well first up u need to check the linux box ur using if it has the stdio.h library installed if not get a package for the standard c library and install it.

the header files for the standard library are normally located in the /usr/lib folder or /lib u need to point ur compiler to the location of the libraries that ur using. Im not sure of ur compiler options but if ur smart enough to use linux then u smart enough to figure that out.

Gillion
January 28, 2005, 12:22 AM
I recommend you install kdevelop (i told you this before youte)

It is a more advanced interface that kate and it sorts out issues like this.

Anyway... try this code



#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

#include <stdio.h>
#include <stdlib.h>

int main(int argc, char *argv[])
{
printf("Hello, world!\n");

return EXIT_SUCCESS;
}


Please note... there is no getch(); in Linux or UNIX. getch (); is bastarddized contrstruct on DOS/Windows systems

You will have to find better design methods.

You can go here... www.linuxquestions.org