Hello!
I have done a lot of programming in Windows, and have never spent much time with UNIX/Linux. I installed FreeBSD to set up a shell and web server and have fallen in love! So on to my questions, I tossed together a quick program just to test out how to compile and run in UNIX:
After that I searched for how to compile and found two options it seems. I can use CC or GCC, which leads to my question: is one actually better than the other for compiling console based applications? I compiled it with this command:
After spending a few minutes with this I found that I have to run the program using "./hello" instead of just "hello". Why is this? The only reason I can assume is that there is already a "hello" program in the system, but when compiled under "m33valhx" it still requires "./"
I will continue searching for this answer, but I am at work and may hear the answer faster through this post.
Thanks!
I have done a lot of programming in Windows, and have never spent much time with UNIX/Linux. I installed FreeBSD to set up a shell and web server and have fallen in love! So on to my questions, I tossed together a quick program just to test out how to compile and run in UNIX:
Code:
#include </usr/include/stdio.h>
int main()
{
printf("Hello FreeBSD!");
return 0;
}
After that I searched for how to compile and found two options it seems. I can use CC or GCC, which leads to my question: is one actually better than the other for compiling console based applications? I compiled it with this command:
Code:
cc -o hello main.c
After spending a few minutes with this I found that I have to run the program using "./hello" instead of just "hello". Why is this? The only reason I can assume is that there is already a "hello" program in the system, but when compiled under "m33valhx" it still requires "./"
I will continue searching for this answer, but I am at work and may hear the answer faster through this post.
Thanks!