Originally posted by: yhs1234567890@163.com
i use eclipse CDT on AIX 5.3 with gcc 4.0.2
hostb/>oslevel
5.3.0.0
hostb/>cd /usr/bin
hostb/usr/bin>g++ -version
g++: unrecognized option '-version'
g++: no input files
hostb/usr/bin>g++ --version
g++ (GCC) 4.0.2
Copyright (C) 2005 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.
hostb/usr/bin>
#include <iostream>
#include <unistd.h>
#include <sys/types.h>
#include <sys/errno.h>
#include <sys/time.h>
int main()
{
timestruc_t t;
curtime(&t);
pid_t p;
p=fork();
if(p!=0)
{
printf("parent's pid is %d\n",p);
}
else
{
printf("child's pid is %d\n",p);
}
return 0;
}
when i compile this program i got error:
-
Full rebuild of configuration Debug for project mytest ****
/opt/freeware/bin/make clean all
rm -rf ./main.o ./main.d main
Building file: ../main.cpp
Invoking: GCC C++ Compiler
g++ -O0 -g3 -Wall -c -fmessage-length=0 -omain.o ../main.cpp
../main.cpp: In function 'int main()':
../main.cpp:10: error: 'curtime' was not declared in this scope
make: ***
http://main.o Error 1
Build complete for project mytest
#AIX-Forum