Re: [Vala] forward déclaration



picca wrote:
Hello

I have a C project with two structures _HklVector and _HklMatrix in two
different files the first one is defined in the hkl-vector.h and the
second one from hkl-matrix.h

But in the first file methods depend of _HklMatrix and in the second it
depends of _HklVector. So converting this C file to vala files do not
compile. Indeed vala do not produce forward declaration.

hkl-vector.h: void hkl_vector_times_matrix(vector, matrix)
hkl-matrix.h: void hkl_matrix_times_vector(matrix, vector)

I would like to separate the two class instead of putting both in the same vala file.

Is it possible ?

Cheers

Frederic


IIRC, if you write the two files (lets say Hkl/Vector.vala and Hkl/Matrix.vala) without any "forward references"(not possible), then compile them in the same command

$ valac -c Vector.vala Matrix.vala

the compiler automatically finds cross references (like, it does the parsing of both files before the symbol analysis).


--
Vlad http://blad.wordpress.com




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