[Vala] Fwd: Namespaces and Compiling With Multiple Source Files



Jonas and Steven:

I feel quite stupid for making that mistake. You are correct, when I
executed the executable with out appending ".vala" everything ran
correctly.

I really appreciate the help and support from the Vala community so
far. The forum has been patient and responsive.

I hope to make some minor contributions back to the community soon.
This will include some code. I'm working on some unit testing classes
that imitate a testing framework I designed for Java. I've also
started on some collections classes (lists and trees). The collections
offer the user a bit of control over the internal operations of the
collection, and they operate on a Collectable interface which supplies
methods on comparison and equality, instead of using generics. I've
also got some basic geospatial geometry code I'll be able to split out
into a reusable library.

I hope I can start sharing this code in the next couple of weeks!

I'd also like to contribute some documentation. I'm using Vala to
develop a library for the management and production of cartographic
annotations. The development of this library is going to be featured
in a new series of articles in the OSGeo Journal
(http://www.osgeo.org/journal). My documentation efforts will start
there. My first article should appear in the issue of the journal
being published before the end of the month, so I will be sure to
share the link here.

Thanks again for all the help! I look forward to learning more about Vala!

Landon

On Mon, Sep 10, 2012 at 4:39 AM, Steven Oliver <oliver steven gmail com> wrote:
On Mon, Sep 10, 2012 at 3:34 AM, Jonas Kulla <nyocurio gmail com> wrote:

2012/9/10 Landon Blake <sunburned surveyor gmail com>

I'm trying to compile and run a Vala program from two (2) vala source
files. I can compile the program with the following command:

valac geospatial_annotations.vala sutiv.vala -o
test_geospatial_annotations.vala

The sutiv.vala file contains the namespace "Sutiv". It defines a
couple of classes I use in geospatial_annotations.vala. I have "using
Sutiv" at the top of my geospatial_annotations.vala file.

The program compiles without errors. When I attempt to execute it with
the command "vala test_geospatial_annotations.vala" the interpreter
tells me "Namespace Sutiv could not be found."

Any ideas what I'm doing wrong. How do I compile a program that uses a
namespace defined in a separate source code file?

I can provide the source code files if needed.


Hi Landon,

The command you use to "compile" your code looks confusing to me.
AFAIK, valac will compile your vala source code to a binary executable,
therefore I don't understand why you give it the extension *.vala .

What happens if you just run the executable like this:

./test_geospatial_annotations.vala


Yeah, vala isn't an interpreted language (like Ruby or Python). You should
be able to do just do the following:

valac geospatial_annotations.vala sutiv.vala -o test_geospatial_annotations
./test_geospatial_annotations

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




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