After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 587367 - sdl.vapi is broken
sdl.vapi is broken
Status: RESOLVED FIXED
Product: vala
Classification: Core
Component: Bindings
0.7.x
Other All
: Normal normal
: ---
Assigned To: Vala maintainers
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2009-06-29 21:34 UTC by Kuteynikov
Modified: 2009-11-24 09:05 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Testcase for bug (SDL-ttf bindings) (396 bytes, text/plain)
2009-07-11 10:57 UTC, Харин Роман
Details

Description Kuteynikov 2009-06-29 21:34:15 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:
Comment 1 Харин Роман 2009-06-30 07:11:27 UTC
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)
Comment 2 Kuteynikov 2009-06-30 21:30:20 UTC
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

Comment 3 Jaap A. Haitsma 2009-07-01 06:00:37 UTC
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.
Comment 4 Харин Роман 2009-07-11 10:53:34 UTC
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)

Comment 5 Харин Роман 2009-07-11 10:57:04 UTC
Created attachment 138238 [details]
Testcase for bug (SDL-ttf bindings)

This is testcase
I suspect SDL-ttf bindings
Comment 6 Evan Nemerson 2009-08-01 20:44:16 UTC
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.
Comment 7 Харин Роман 2009-08-02 08:50:21 UTC
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.
Comment 8 Evan Nemerson 2009-08-02 21:23:29 UTC
Харин, would you please try with 0.7.5 (which was just released), or git?
Comment 9 Харин Роман 2009-08-04 17:28:57 UTC
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.

Само собой пофиксилось.