GNOME Bugzilla – Bug 587367
sdl.vapi is broken
Last modified: 2009-11-24 09:05:47 UTC
Please describe the problem: sdl.vapi:222.2-222.20: error: The type `SDL.Color` doesn't declare a type id Steps to reproduce: 1. SDL.Color color; 2. compile it Actual results: compilation errors Expected results: successful compilation Does this happen every time? Other information:
Sorry, but: using SDL; int main () { SDL.Color color_1; return 0; } valac --pkg=sdl test_sdl_587367.vala Only "warning: local variable `color_1' declared but never used". p.s. Vala 0.7.4 (*buntu 8.4)
Sorry. I thought this error doesn't depend on my project. So get it from svn: svn co https://gore.svn.sourceforge.net/svnroot/gore gore cd gore/trunk/client chmod +x waf ./waf configure ./waf build
Do you mind cooking up a patch for the sdl.vapi file? I see that you already have done this for some other libs in your project.
SDL.vapi line 220-227 [CCode (cname="SDL_Color", has_type_id=false)] "has_type_id=false" << ??? SDL-ttf.vapi line 108-109 [CCode (cname="TTF_RenderUNICODE_Blended")] public Surface? render_blended_unicode([CCode (array_length = false)] uint16[] text, Color fg); seems to be this call lead to apperance this error, but what wrong with it? Is tere any examples of passing SDL.Color (in tye sdl-gfx color defined as uint32)
Created attachment 138238 [details] Testcase for bug (SDL-ttf bindings) This is testcase I suspect SDL-ttf bindings
That test case works for me. There is no pkg-config file for sdl-ttf, so you have to tell valac to pass -lSDL_ttf: valac -X '-lSDL_ttf' -o 587367 587367.vala --pkg sdl --pkg sdl-ttf Otherwise you'll get some errors about undefined references. I also had to initialize that SDL.Color. I've also checked out that project and built it. I don't see any errors. It is possible that the problem is that the sdl vapis use has_type_id=false instead of has_type_id = "0", as is used everywhere else. If you are still having this problem, please provide a small test case that duplicates the problem. You can also try running `sed -i -e 's/has_type_id=false/has_type_id = "0"/' *.vapi` in your vapi directory--if that fixes the issue, please let us know.
Hi, thanks for answer. This time command was valac -X '-lSDL_ttf' --pkg sdl --pkg sdl-ttf test_sdl_587367.vala --vapidir=. i have to used own copy of sdl.vapi in the same dir. There are no undefined reference. sdl.vapi:222.2-222.20: error: The type `SDL.Color` doesn't declare a type id public struct Color { ^^^^^^^^^^^^^^^^^^^ Compilation failed: 1 error(s), 0 warning(s) user@digglint:~/temp/test_vala/587367$ With or without "0" error stayed the same. In the mail list (http://mail.gnome.org/archives/vala-list/2009-June/msg00208.html) Кутейников Дмитрий says that this appear in 0.7.4 version.
Харин, would you please try with 0.7.5 (which was just released), or git?
Hi, all. Using new Vala (0.7.5, *buntu 8.4.3) SDL.Color m_color = {100,100,100}; No error, 1 warning. warning: local variable `surf' declared but never used Seems to be bug should be closed. Само собой пофиксилось.