Hi!
I'm very new to DirectFB, and I wanted to try the simple.c example (http://www.directfb.org/docs/DirectFB_Tutorials/simple.html ). I tried to compile it using gcc, but I got this error :
/tmp/ccAPaDmn.o: In function `main':
test1.c:(.text+0x1e): undefined reference to `DirectFBInit'
test1.c:(.text+0x5f): undefined reference to `DirectFBErrorFatal'
test1.c:(.text+0x6b): undefined reference to `DirectFBCreate'
test1.c:(.text+0xac): undefined reference to `DirectFBErrorFatal'
test1.c:(.text+0x107): undefined reference to `DirectFBErrorFatal'
test1.c:(.text+0x178): undefined reference to `DirectFBErrorFatal'
test1.c:(.text+0x1db): undefined reference to `DirectFBErrorFatal'
test1.c:(.text+0x255): undefined reference to `DirectFBErrorFatal'
/tmp/ccAPaDmn.o:test1.c:(.text+0x2c8): more undefined references to `DirectFBErrorFatal' follow
collect2: ld returned 1 exit status

I thought it may be because this was not a c file but rather a c++ file and switched to g++. This worked a little better, but I still got these errors :
g++ -I /usr/include/directfb test1.c
test1.c: In function ‘int main(int, char**)’:
test1.c:26: error: invalid conversion from ‘int’ to ‘DFBSurfaceCapabilities’ test1.c:34: error: invalid conversion from ‘int’ to ‘DFBSurfaceFlipFlags’
make: *** [test.o] Error 1

In the code, line 26 is the following : dsc.caps = DSCAPS_PRIMARY | DSCAPS_FLIPPING;

I took a look at directfb.h and found (I guess) what the error is due to. DFBSurfaceCapabilities is an enum, and while DSCAPS_PRIMARY and DSCAPS_FLIPPING are part of the enum, DSCAPS_PRIMARY | DSCAPS_FLIPPING isn't. This may have been fixed in DirectFB > 1.0, but this is the version I'm using (this is the package available in debian stable).

If it has been corrected, could someone add a comment to the file saying that you need DirectFB > x.x in order to compile simple.c ?
And of course, if that is not the issue, could you tell me what it is ?


--
Jérémy

_______________________________________________
directfb-users mailing list
[email protected]
http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-users

Reply via email to