Re: [Vala] Mixing C with vala




-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Hi:

If I can do a sugestion, try to use Autovala to automagically generate
cmake files. It allows to easily mix C and Vala too.

On 23/09/15 22:16, Daniel Brendle wrote:
Hi guys.

I want to use Vala together with C, in order to do some lowlevel
manual memory management stuff in a certain subsystem of my program.
At first i tried writing g-object boilerplate-code myself, but it was
a bit cumbersome, so i decided to write a class in vala and let the
vala compiler generate the boilerplate-code for me. (I obtained the c
file via -C and the headerfile via -h)

currently i have 4 files involved:

main.vala
nsp-page.c
nsp-page.h
nsp.vapi

main.vala has a simple main-method and creates a Nsp.Page. nsp-page.c
and nsp-page.h contain the gobject-code for the Nsp.Page class.
nsp.vapi describes the Nsp.Page-class towards the vala compiler.

I try to compile everything with

$ valac -X -I. --vapidir . --pkg nsp main.vala nsp-page.c

Now the following problem arises:


main.vala.c:(.text+0x8b): undefined reference to `nsp_page_unref'

Of course, the C-code generated from main.vala tries to unreference
the generated Page-object. This method does not exist anywhere. When i
write Nsp.Page as regular vala-class, main.c tries to derefence the
Page-object via g_object_unref() instead of some class-specific method
that doesn't exist.

What am I doing wrong here?

Yours, Grindhold
_______________________________________________
vala-list mailing list
vala-list gnome org
https://mail.gnome.org/mailman/listinfo/vala-list


- -- 
Nos leemos
                 RASTER    (Linux user #228804)
raster rastersoft com              http://www.rastersoft.com

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBCgAGBQJWAxVJAAoJED690wQnnlF1laAP/1atwIPXf/qHnFDoCmvZPQ6M
bpNvOPg8AjF6phC9xHeGpZe7MdbBTuIputs2CnIZAFYEQuqsExa109ztmbD4cTbJ
i2xozdjsBPBsxmVV2m742+gVAevNFWam14z/cL1oIzRT3Z8+zE5g7SR9uu3mnX2r
P1Sa79EHRYpJZ4IY4+KyWO53aa1jh7qRtk7YSRgjM+Zw+8Xs7VAGoTawB7hJduqQ
7BTZKfCSTBiGco2ZtLe/YxvIHqpeYubN4Nz0+yoXE4F+bH6gBe76hMYtXmVPm/b8
mC8guyYt2R3xsGUj5ICmC03pXUG945D0PNMDOYcGVoPTMQcr3nV4V0YphDazoX1d
Zf5XyBLSrpAZCuRUZyd/Cam6tLOgZWtPTzLllowTRLwuUUbq1R0Z1+Lee4RsqIGR
gybsMoEr40ECyD0BOGCtpAjFB0etkSR5WSkVZNssJT9sJvokqp3p9ANz0tGGJtJI
33uc1jV9MAtupUYaNyFXeoyV4KCs+ovSL67oRefxJuezuDrgx6CS+8D/JkMEu8EG
jSVX1/+jiqTRyInrjr5v8Shlw5P2/zNDNSleDBq1LI7K+PjOzddFipdjIHT1Kejg
FCGd0eisUWDPXC00S2Wd6c9MmZETAnFLuZC8L7221UGrcgx2NZSUqls6Tk8NbGwr
9AnfF8lBHDxgEIZOE9y3
=RUsC
-----END PGP SIGNATURE-----



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]