Hi, first i will explain the situation and later my question.

I 
create a dir in vala's directory named "Proyects", inside I have:
   
 test.vala
    /CFunctions -> A directory with 2 archives, 
Operations.c and Operations.h
    /Vapis -> A directory with only 
one archive, Operations.vapi

Operations.c have this:
---------
#include
 "Operations.h"

int sum (int a, int b) {
    return a+b;
}
----------


Operations.h
 have this:
----------
int sum (int a, int b);
----------


and
 Opèrations.vapi have this:
----------
namespace Operations {
   
 [CCode (cname = "sum", cheader_filename = 
"C:/vala-0.9.3/Proyects/CFunctions/Operations.h")]
    public int sum
 (int a, int b);
}
----------

the file test.vala have next:
-------
using
 Operations;


public void main () {
    
Operations.sum(2,4);
}
-------

I compile the vala file with
 this comand with the console in the directory proyects: 
     
C:/vala-0.9.3/Proyects>valac --vapidir=./Vapis --pkg=Operations 
test.vala

but the compilator answer the next:
    
test.vala.c<.text+0x16>: undefined reference to sum

but if i
 generate only the c file, it is ok:
----------------
/* test.c 
generated by valac, the Vala compiler
 * generated from p.vala, do 
not modify */


#include <glib.h>
#include 
<glib-object.h>
#include 
<C:/vala-0.9.3/Proyects/CFunctions/Operations.h>




void
 _vala_main (void);



void _vala_main (void) {
    sum 
(2, 4);
}


int main (int argc, char ** argv) {
    
g_type_init ();
    _vala_main ();
    return 0;
}
----------------

¿What
 I do bad? Thanks                                         
_________________________________________________________________
No has visto nada como el nuevo Messenger, ¡te sorprenderá!
http://explore.live.com/windows-live-messenger
_______________________________________________
vala-list mailing list
vala-list@gnome.org
http://mail.gnome.org/mailman/listinfo/vala-list

Reply via email to