All,
Please excuse me, I'm rather new at working with C on LINUX. I'm trying to implement some code that will read information off of my weather station then post it to the web. Thought it would be as simple as running 'make' and then executing the code, but gcc came back with pages of errors. So I've stepped back to the simple 'hello world' code to familiarize myself with gcc.
My code is as follows:
Code:
#include <iostream>
using namespace std;
int main()
{
cout<<"HEY, you, I'm alive! Oh, and Hello World!\n";
cin.get();
}
I'm also using the following makefile:
Code:
CC= gcc
LIBDIR= -I/usr/include/c++/3.4.2
SRC= test.c
OBJS= test.o
PROG= test
test: ${OBJS}
${CC} -o ${PROG} ${SRC} ${LIBDIR}
When I run make, I get the following errors:
test.c:1:20: iostream: No such file or directory
test.c:3: error: syntax error before "namespace"
......
I've been unable to correctly characterize the header files locations so that the gcc recognizes it.
Thanks