Sorry for the newbie question. I am just starting to learn C programming.
I am running pfSense, a modified (smaller) FreeBSD 10.3 version to implement a router/firewall. I would like to compile some simple C programs, like the classical:
But I get:
Same results if I change stdio.h to stdlib.h.
Could someone please tell me what is wrong here? Maybe I need to download such ".h" files?
Even when my FreeBSD version is a restricted one, I usually success in downloading and installing packages from here:
http://pkg.freebsd.org/freebsd:10:x86:64/latest/All/
But, in this case, I don't know what package should I install.
I am running pfSense, a modified (smaller) FreeBSD 10.3 version to implement a router/firewall. I would like to compile some simple C programs, like the classical:
Code:
#include<stdio.h>
int main()
{
printf("\nHello World,\nWelcome to my first C program in Linux\n");
return(0);
}
But I get:
Code:
$ gcc --version
gcc (FreeBSD Ports Collection) 4.9.4
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ gcc helloworld.c
In file included from helloworld.c:1:0:
/usr/local/lib/gcc49/gcc/x86_64-portbld-freebsd10.3/4.9.4/include-fixed/stdio.h:53:23: fatal error: sys/cdefs.h: No such file or directory
#include <sys/cdefs.h>
^
compilation terminated.
$ clang35 helloworld.c
helloworld.c:1:9: fatal error: 'stdio.h' file not found
#include<stdio.h>
^
1 error generated.
Same results if I change stdio.h to stdlib.h.
Could someone please tell me what is wrong here? Maybe I need to download such ".h" files?
Even when my FreeBSD version is a restricted one, I usually success in downloading and installing packages from here:
http://pkg.freebsd.org/freebsd:10:x86:64/latest/All/
But, in this case, I don't know what package should I install.