[MonoDevelop] [Problem] Project reference with vala
Levi Bard
taktaktaktaktaktaktaktaktaktak at gmail.com
Thu Apr 9 14:21:46 EDT 2009
> I am playing with some Vala code in monodevelop. I currently have two projects
> in the solution -- one library and one unit test for it -- and plan to add a
> few more. And I have a problem with the reference from the test project to the
> library one works only partly.
>
> I mean, the valac is given correct .vapi file to generate the code, but it is
> *not* given either include path nor the library file for the C compiler, so
> vala generates the C sources, but compiling them fails.
Hi, it's great to see someone using MD for Vala!
I think valac's behavior in this respect has changed semi-recently; if
I recall correctly, it used to be that, if one were compiling directly
to binaries, neither the include path nor the linker path were
required. (What version of Vala are you using?)
> I have currently worked around the problem by manually adding
> appropriate --Xcc= options in the Build/Code Generation properties. But as I
> said, I plan to add a few more projects and it will quickly grow ugly.
>
> Do you have any better proposal? Or should this be reported as a (possibly
> wish-list) bug?
This is definitely a bug. I'll address it as soon as possible.
> Note, that monodevelop generated a .md.pc file for me and even seems to
> regenerate it with every build. It only includes the Libs: definition and no
> Cflags: and does not seem to be used anyway. Should it be used somehow, or
> does it only exist as a template?
This is a carryover of the project reference behavior from the C
binding; it should be used internally or not at all.
> To complicate matters a little more, I am not entirely sure whether linking
> the libraries should be done by path to the .so file (which will generate
> rpath) or -L and -l options and using LD_LIBRARY_PATH for execution (which is
> pain, but it will avoid the rpath, which is undesired for installed binaries).
>
> For unit-tests the rpath variant seems better, but the installed binary
> (I have none yet, but I will have) should not have rpath and I fear MD can't
> tell those cases apart.
I agree that -L/-l is a better general case; MD and valac should be
handling this for you.
--
http://homes.eff.org/~barlow/EconomyOfIdeas.html
http://www.dreamsongs.com/MobSoftware.html
http://www.gnu.org/philosophy/shouldbefree.html
More information about the Monodevelop-list
mailing list