[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
hello all,
I am pretty new to eclipse and cdt. if any of my questions sound funny
you may forgive me. be gentle. ;-)
as I said, I just recently installed eclipse as my ide and cdt for
programming plain c. my system is windows.
as compiler I installed the current mingw and I configured eclipse so
that the right mingw make.exe is called.
my first hello-world compiled fine. :-)
but since the target system I do development for is openbsd, I have to
make a lot of use of things like getuid() and such.
this is where my problem starts..
#include <sys/types.h>
#include <stdio.h>
#include <unistd.h>
int main(int argc, char **argv)
{
uid_t uid; /* real and effective user id's */
gid_t gid; /* real and effective group id's */
gid = getgid();
uid = getuid();
printf("gid: %d\nuid: %d\n",gid,uid);
return 0;
}
the above code should compile just fine imho. but this is, what the
building process tells me:
<snip>
gcc -IC:\Tools\MinGW\include -IC:\Tools\MinGW\lib\gcc-lib\mingw32\3.2.3\include -O3 -gstabs -Wall -c -v -o test.o ../test.c
Reading specs from C:/Tools/MinGW/bin/../lib/gcc-lib/mingw32/3.2.3/specs
Configured with: ../gcc/configure --with-gcc --with-gnu-ld --with-gnu-as --host=mingw32 --target=mingw32 --prefix=/mingw --enable-threads --disable-nls --enable-languages=c++,f77,objc --disable-win32-registry --disable-shared --enable-sjlj-exceptions
Thread model: win32
gcc version 3.2.3 (mingw special 20030504-1)
C:\Tools\MinGW\bin\..\lib\gcc-lib\mingw32\3.2.3\cc1.exe -lang-c -v -IC:\Tools\MinGW\include -IC:\Tools\MinGW\lib\gcc-lib\mingw32\3.2.3\include -iprefix C:\Tools\MinGW\bin/../lib/gcc-lib/mingw32/3.2.3/ -D__GNUC__=3 -D__GNUC_MINOR__=2 -D__GNUC_PATCHLEVEL__=3 -D__GXX_ABI_VERSION=102 -D_WIN32 -D__WIN32 -D__WIN32__ -DWIN32 -D__MINGW32__ -D__MSVCRT__ -DWINNT -D_X86_=1 -D_WIN32 -D__WIN32 -D__WIN32__ -D__WIN32__ -D__MINGW32__ -D__MSVCRT__ -D__WINNT__ -D_X86_=1 -D__WIN32 -D__WINNT -Asystem=winnt -D__OPTIMIZE__ -D__STDC_HOSTED__=1 -Acpu=i386 -Amachine=i386 -Di386 -D__i386 -D__i386__ -D__tune_i586__ -D__tune_pentium__ -D__stdcall=__attribute__((__stdcall__)) -D__cdecl=__attribute__((__cdecl__)) -D__fastcall=__attribute__((__fastcall__)) -D_stdcall=__attribute__((__stdcall__)) -D_cdecl=__attribute__((__cdecl__)) -D_fastcall=__attribute__((__fastcall__)) -D__declspec(x)=__attribute__((x)) ../test.c -quiet -dumpbase test.c -gstabs -O3 -Wall -version -o C:\DOKUME~1\ADMINI~1\LOKALE~1\Temp/!
cc2taaaa.s
GNU CPP version 3.2.3 (mingw special 20030504-1) (cpplib) (80386, BSD syntax)
GNU C version 3.2.3 (mingw special 20030504-1) (mingw32)
compiled by GNU C version 3.2.3 (mingw special).
ignoring nonexistent directory "C:/Tools/MinGW/mingw32/include"
ignoring nonexistent directory "/mingw/lib/gcc-lib/mingw32/3.2.3/../../../../include"
ignoring nonexistent directory "/mingw/include"
ignoring nonexistent directory "/mingw/lib/gcc-lib/mingw32/3.2.3/include"
ignoring nonexistent directory "/mingw/lib/gcc-lib/mingw32/3.2.3/../../../../mingw32/include"
ignoring nonexistent directory "/usr/local/mingw32/include"
#include "..." search starts here:
#include <...> search starts here:
C:/Tools/MinGW/include
C:/Tools/MinGW/lib/gcc-lib/mingw32/3.2.3/include
C:/Tools/MinGW/include
C:/Tools/MinGW/lib/gcc-lib/mingw32/3.2.3/include
End of search list.
../test.c: In function `main':
../test.c:7: `uid_t' undeclared (first use in this function)
../test.c:7: (Each undeclared identifier is reported only once
../test.c:7: for each function it appears in.)
../test.c:7: parse error before "uid"
../test.c:9: `uid' undeclared (first use in this function)
../test.c:9: warning: implicit declaration of function `getuid'
C:\Tools\MinGW\bin\mingw32-make.exe: *** [test.o] Error 1
</snap>
as I understand this, something has gone wrong with the includes. but
what? any hints would be appreciated!
if you need some more information, please say so.
best regards
/Christian
---
-o) _
caefer /\\ Message void if penguin violated V
c.2003 _\_V Don't mess with the penguin O
---------------------------------------------------
Christian
Isarstrasse 4 + Tel. : +49 (0)421 16 535 16
28199 Bremen + eMail: mailto:caefer@xxxxxxxxxxxxxxxx
---------------------------------------------------
- graphics - webdevelopment - general programming -