Re: [Vala] Newbie Compile Time Errors

2010-03-13 Thread Jan Hudec
On Fri, Mar 12, 2010 at 17:17:25 -0700, Jeff Cave wrote:
  Anyway, I think it's better to install the library.
 
 One of the problems is that the library is not even at version 0.0.2, that 
 means its going to change frequently. 
 
 I was actually hoping to use it as a learning tool for building my own 
 libraries and understanding the compiler. I actually don't want to install 
 the 
 library because I want to treat it as part of my overall project (this is as 
 much about setting up good project environments as anything else).

If the library provides a *-uninstalled.pc (libvfcgi-uninstalled.pc), you
can pretend it's installed by setting the PKG_CONFIG_PATH (environment
variable) to the directory where that file is. Than calling valac with
respective --vapidir and --pkg libvfcgi should do the right thing
automagically.

This is special feature in pkg-config, that it looks for
package-uninstalled.pc in preference to package.pc, provided for exactly
this kind of situation.

-- 
 Jan 'Bulb' Hudec b...@ucw.cz
___
Vala-list mailing list
Vala-list@gnome.org
http://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] Newbie Compile Time Errors

2010-03-11 Thread Abderrahim Kitouni
Hi,

2010/3/11, Jeff Cave jefferey.c...@gmail.com:
 I've decided to start tinkering with Vala  (come from MS C# background),
  having most of my interest in web development I've decided to start with
  libvfcgi. I've managed to compile libvfcgi, but can't seem to get my
  application (just the supplied example at this time) to link to the library
  (correctly at least).
  

  valac -d './bin/' -g  --vapidir .  --pkg glib-2.0  --pkg gio-2.0
  ./libvfcgi.vapi  ./ValaFCGI/fcgiserv.vala  -o ValaFCGI
You'll need to get C compiler flags for the library as well (the vapi
isn't enough).
The easiest way, if you've already installed the library, is to pass
--pkg libvfcgi to valac. (you may need to add the directory where
the libvfcgi.pc is installed to the PKG_CONFIG_PATH environment
variable).

  All of these header files would be coming from the VAPI, and I don't quite 
 get
  where the error is occuring: compilation of the library, the way I'm linking
  the library, or the compilation of fcgiserv.
The problem is in the compilation of fcgiserv : if passing the vapi
alone to the compiler, you'll need to pass the C compiler flags, using
the -X option or by compiling to C then compiling with the C compiler.
Anyway, I think it's better to install the library.

HTH,
Abderrahim

disclaimer: I've never tried this particular library, there may be
some quirks, but this is the general approach for vala.
___
Vala-list mailing list
Vala-list@gnome.org
http://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] Newbie Compile Time Errors

2010-03-11 Thread Bob Hazard
You will notice that these errors come from the .c file not the .vala
file.  When you are calling a library from a C program you must also
have the .h headers installed.   In practice this usually means
installing a package such as libNAME-dev

If you are using Ubuntu/Debian try

sudo apt-get install libfcgi-dev


Hope this helps, I am also a noob, but this happens to me a lot

On 11 March 2010 22:11, Jeff Cave jefferey.c...@gmail.com wrote:
 I've decided to start tinkering with Vala  (come from MS C# background),
 having most of my interest in web development I've decided to start with
 libvfcgi. I've managed to compile libvfcgi, but can't seem to get my
 application (just the supplied example at this time) to link to the library
 (correctly at least).
 

 valac -d './bin/' -g  --vapidir .  --pkg glib-2.0  --pkg gio-2.0
 ./libvfcgi.vapi  ./ValaFCGI/fcgiserv.vala  -o ValaFCGI

 snip: bunch of warnings

 fcgiserv.vala.c:12:20: error: server.h: No such file or directory
 fcgiserv.vala.c:13:18: error: init.h: No such file or directory
 fcgiserv.vala.c:16:21: error: request.h: No such file or directory
 fcgiserv.vala.c:54: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’
 before ‘*’ token
 fcgiserv.vala.c:55: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’
 before ‘*’ token
 fcgiserv.vala.c:67: error: expected ‘)’ before ‘*’ token
 fcgiserv.vala.c:68: error: expected ‘)’ before ‘*’ token
 fcgiserv.vala:30: error: expected ‘)’ before ‘*’ token
 fcgiserv.vala.c: In function ‘program_main’:
 fcgiserv.vala.c:88: error: ‘FastCGIServer’ undeclared (first use in this
 function)
 fcgiserv.vala.c:88: error: (Each undeclared identifier is reported only once
 fcgiserv.vala.c:88: error: for each function it appears in.)
 fcgiserv.vala.c:88: error: ‘_tmp0_’ undeclared (first use in this function)
 fcgiserv.vala.c:89: error: ‘_tmp1_’ undeclared (first use in this function)
 fcgiserv.vala.c:90: error: ‘FastCGIServerRequestHandlerFunc’ undeclared (first
 use in this function)
 fcgiserv.vala.c:90: error: expected ‘;’ before ‘_tmp2_’
 fcgiserv.vala:17: error: ‘program_s_server’ undeclared (first use in this
 function)
 fcgiserv.vala:18: error: ‘_tmp2_’ undeclared (first use in this function)
 fcgiserv.vala:18: error:
 ‘_program_request_handler_fast_cgi_server_request_handler_func’ undeclared
 (first use in this function)
 fcgiserv.vala: At top level:
 fcgiserv.vala:30: error: expected ‘)’ before ‘*’ token
 error: cc exited with status 256
 Compilation failed: 1 error(s), 16 warning(s)
 

 All of these header files would be coming from the VAPI, and I don't quite get
 where the error is occuring: compilation of the library, the way I'm linking
 the library, or the compilation of fcgiserv.

 Possibly relevant: using version 0.7.10 from MonoDevelop. I've cut a bunch of
 the warnings out, they are mostly regarding deprecated syntax.


 Jeff Cave
 403.835.0845
 jefferey.c...@gmail.com
 ___
 Vala-list mailing list
 Vala-list@gnome.org
 http://mail.gnome.org/mailman/listinfo/vala-list

___
Vala-list mailing list
Vala-list@gnome.org
http://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] Newbie Compile Time Errors

2010-03-11 Thread Bob Hazard
Sorry his reply appeared after I had sent

On 11 March 2010 22:42, Bob Hazard linuxoflon...@googlemail.com wrote:
 You will notice that these errors come from the .c file not the .vala
 file.  When you are calling a library from a C program you must also
 have the .h headers installed.   In practice this usually means
 installing a package such as libNAME-dev

 If you are using Ubuntu/Debian try

 sudo apt-get install libfcgi-dev


 Hope this helps, I am also a noob, but this happens to me a lot

 On 11 March 2010 22:11, Jeff Cave jefferey.c...@gmail.com wrote:
 I've decided to start tinkering with Vala  (come from MS C# background),
 having most of my interest in web development I've decided to start with
 libvfcgi. I've managed to compile libvfcgi, but can't seem to get my
 application (just the supplied example at this time) to link to the library
 (correctly at least).
 

 valac -d './bin/' -g  --vapidir .  --pkg glib-2.0  --pkg gio-2.0
 ./libvfcgi.vapi  ./ValaFCGI/fcgiserv.vala  -o ValaFCGI

 snip: bunch of warnings

 fcgiserv.vala.c:12:20: error: server.h: No such file or directory
 fcgiserv.vala.c:13:18: error: init.h: No such file or directory
 fcgiserv.vala.c:16:21: error: request.h: No such file or directory
 fcgiserv.vala.c:54: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’
 before ‘*’ token
 fcgiserv.vala.c:55: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’
 before ‘*’ token
 fcgiserv.vala.c:67: error: expected ‘)’ before ‘*’ token
 fcgiserv.vala.c:68: error: expected ‘)’ before ‘*’ token
 fcgiserv.vala:30: error: expected ‘)’ before ‘*’ token
 fcgiserv.vala.c: In function ‘program_main’:
 fcgiserv.vala.c:88: error: ‘FastCGIServer’ undeclared (first use in this
 function)
 fcgiserv.vala.c:88: error: (Each undeclared identifier is reported only once
 fcgiserv.vala.c:88: error: for each function it appears in.)
 fcgiserv.vala.c:88: error: ‘_tmp0_’ undeclared (first use in this function)
 fcgiserv.vala.c:89: error: ‘_tmp1_’ undeclared (first use in this function)
 fcgiserv.vala.c:90: error: ‘FastCGIServerRequestHandlerFunc’ undeclared 
 (first
 use in this function)
 fcgiserv.vala.c:90: error: expected ‘;’ before ‘_tmp2_’
 fcgiserv.vala:17: error: ‘program_s_server’ undeclared (first use in this
 function)
 fcgiserv.vala:18: error: ‘_tmp2_’ undeclared (first use in this function)
 fcgiserv.vala:18: error:
 ‘_program_request_handler_fast_cgi_server_request_handler_func’ undeclared
 (first use in this function)
 fcgiserv.vala: At top level:
 fcgiserv.vala:30: error: expected ‘)’ before ‘*’ token
 error: cc exited with status 256
 Compilation failed: 1 error(s), 16 warning(s)
 

 All of these header files would be coming from the VAPI, and I don't quite 
 get
 where the error is occuring: compilation of the library, the way I'm linking
 the library, or the compilation of fcgiserv.

 Possibly relevant: using version 0.7.10 from MonoDevelop. I've cut a bunch of
 the warnings out, they are mostly regarding deprecated syntax.


 Jeff Cave
 403.835.0845
 jefferey.c...@gmail.com
 ___
 Vala-list mailing list
 Vala-list@gnome.org
 http://mail.gnome.org/mailman/listinfo/vala-list


___
Vala-list mailing list
Vala-list@gnome.org
http://mail.gnome.org/mailman/listinfo/vala-list