From: Rob Solomon on
On Mon, 19 Oct 2009 15:06:01 -0700 (PDT), Ludovic Brenta
<ludovic(a)ludovic-brenta.org> wrote:

>Rob Solomon wrote:
>> I'd offer to help, but from your response I think that would be a very
>> bad idea. �It seems that I don't know anything.
>
>I didn't know anything either when I started packaging things for
>Debian :) TextTools is one of the easiest packages to maintain so is a
>good choice if you want to learn. Any help is appreciated and
>welcome.
I have emailed you privately. I hope the email address is correct.
From: Rob Solomon on
On Mon, 19 Oct 2009 01:12:13 -0700 (PDT), Ludovic Brenta
<ludovic(a)ludovic-brenta.org> wrote:

>Rib Solomon wrote on comp.lang.ada:
>[on Ubuntu 9.04]
>[lots snipped]
>> windows.adb:(.text+0x386af): undefined reference to `CDesktop'
>> collect2: ld returned 1 exit status
>> gnatlink: error when calling /usr/bin/gcc-4.3
>> gnatmake: *** link failed.
>>
>> [2009-10-18 15:48:54] process exited with status4 (elapsed time:
>20.64s)
>>
>> The following is the contents of my basic.gpr file
>> basic.gpr
>> project Basic is
>>
>> � �for Source_Dirs use ("./**",
>> � � � � � � � � � � � � "/usr/share/ada/adainclude/texttools/**");
>> � �for Main use ("basic.adb");
>> � �package Builder is
>> � � � for Default_Switches ("Ada") use ("-x");
>> � �end Builder;
>> � �package Compiler is
>> � � �for Switches("basic") use ("-x");
>> � �end Compiler;
>> � �package Linker is
>> � � � for Default_Switches ("Ada") use ("-lm",
>> � � � � � � � � � � � � � � � � � � � � "-lcurses");
>> � �end Linker;
>>
>> end Basic;
>
>This is wrong and is almost certainly the cause for all your problems.
>Please read the contents of /usr/share/ada/adainclude/texttools.gpr
>for instructions on how to properly use the installed package. For
>background information, please read the Debian Policy for Ada[1],
>chapter 5 "Using shared libraries".
>
>[1] http://people.debian.org/~lbrenta/debian-ada-policy.html#Using-shared-libraries
>
>Also, you should not have the sources of TextTools in your home
>directory, only the examples you wish to compile.
>
>By the way, I have been looking for a new maintainer for this package
>for 18 months now. If nobody steps up, I will request removal of this
>package and it will not be in the next release of Debian, to be frozen
>in March 2010 and released some time later.

The following basic.gpr is not working either:
with "texttools";
project basic is
for Source_Dirs use (".");
for Object_dir use "obj";
for Exec_Dir use ".";
for Main use ("basic");
package Linker is
for Default_Switches ("Ada") use ("/usr/lib/libtexttools.a");
end linker;
end basic;

I tried this without first and then with the package Linker clause.
Neither works. I get very similar errors to the first time I posted,
w/ lots of undefined and unlinkable symbols.
From: Ludovic Brenta on
Rob Solomon wrote on comp.lang.ada:
> The following basic.gpr is not working either:
> with "texttools";
> project basic is
>    for Source_Dirs use (".");
>    for Object_dir use "obj";
>    for Exec_Dir use ".";
>    for Main use ("basic");
>    package Linker is
>       for Default_Switches ("Ada") use ("/usr/lib/libtexttools.a");
>    end linker;
> end basic;
>
> I tried this without first and then with the package Linker clause.
> Neither works.  I get very similar errors to the first time I posted,
> w/ lots of undefined and unlinkable symbols.

OK, I'll try to reproduce that and get back to you.

--
Ludovic Brenta.
From: Ludovic Brenta on
On Oct 20, 11:28 am, Ludovic Brenta <ludo...(a)ludovic-brenta.org>
wrote:
> Rob Solomon wrote on comp.lang.ada:
>
> > The following basic.gpr is not working either:
> > with "texttools";
> > project basic is
> >    for Source_Dirs use (".");
> >    for Object_dir use "obj";
> >    for Exec_Dir use ".";
> >    for Main use ("basic");
> >    package Linker is
> >       for Default_Switches ("Ada") use ("/usr/lib/libtexttools.a");
> >    end linker;
> > end basic;
>
> > I tried this without first and then with the package Linker clause.
> > Neither works.  I get very similar errors to the first time I posted,
> > w/ lots of undefined and unlinkable symbols.
>
> OK, I'll try to reproduce that and get back to you.

On my Debian (testing) system, I do not get the same errors as you do;
this seems to be a bug introduced by Ubuntu 9.04, so the only way I
can help you here is by saying "upgrade to Debian" :/

However, even on Debian there is a minor bug; /usr/lib/libtexttools.so
is not linked against libgnarl.so as it should. A simple workaround
is to write the project file thus:

with "texttools";
project basic is
for Source_Dirs use (".");
for Object_dir use "obj";
for Exec_Dir use ".";
for Main use ("basic");
package Linker is
for Default_Switches ("Ada") use ("-lgnarl");
end linker;
end basic;

which, on my system, results in a working executable. For reference,
here are tha packages that I used:

ii gnat 4.3.3-9 The GNU Ada compiler
ii gnat-4.3 4.3.4-4 The GNU Ada compiler
ii gnat-4.3-base 4.3.4-4 The GNU Compiler Collection (gnat base
package)
ii libgnat-4.3 4.3.4-4 Runtime library for GNU Ada
applications
ii libgnat-4.3-dbg 4.3.4-4 Runtime library for GNU Ada
applications
ii libgnatprj-dev 4.3.3-9 GNU Ada Project Manager development
files
ii libgnatprj4.3 4.3.4-4 GNU Ada Project Manager
ii libgnatprj4.3-dbg 4.3.4-4 GNU Ada Project Manager
ii libgnatprj4.3-dev 4.3.4-4 GNU Ada Project Manager development
files
ii libgnatvsn-dev 4.3.3-9 GNU Ada compiler version library -
development files
ii libgnatvsn4.3 4.3.4-4 GNU Ada compiler version library
ii libgnatvsn4.3-dbg 4.3.4-4 GNU Ada compiler version library
ii libgnatvsn4.3-dev 4.3.4-4 GNU Ada compiler version library -
development files
ii libtexttools-dev 2.0.5-1 Ada and C++ library for writing
console applications
ii libtexttools2.0.5 2.0.5-1 Ada and C++ library for writing
console applications

--
Ludovic Brenta.

From: Rob Solomon on
On Tue, 20 Oct 2009 10:49:59 -0700 (PDT), Ludovic Brenta
<ludovic(a)ludovic-brenta.org> wrote:

>On Oct 20, 11:28�am, Ludovic Brenta <ludo...(a)ludovic-brenta.org>
>wrote:
>> Rob Solomon wrote on comp.lang.ada:
>>
>> > The following basic.gpr is not working either:
>> > with "texttools";
>> > project basic is
>> > � �for Source_Dirs use (".");
>> > � �for Object_dir use "obj";
>> > � �for Exec_Dir use ".";
>> > � �for Main use ("basic");
>> > � �package Linker is
>> > � � � for Default_Switches ("Ada") use ("/usr/lib/libtexttools.a");
>> > � �end linker;
>> > end basic;
>>
>> > I tried this without first and then with the package Linker clause.
>> > Neither works. �I get very similar errors to the first time I posted,
>> > w/ lots of undefined and unlinkable symbols.
>>
>> OK, I'll try to reproduce that and get back to you.
>
>On my Debian (testing) system, I do not get the same errors as you do;
>this seems to be a bug introduced by Ubuntu 9.04, so the only way I
>can help you here is by saying "upgrade to Debian" :/
>
>However, even on Debian there is a minor bug; /usr/lib/libtexttools.so
>is not linked against libgnarl.so as it should. A simple workaround
>is to write the project file thus:
>
>with "texttools";
>project basic is
> for Source_Dirs use (".");
> for Object_dir use "obj";
> for Exec_Dir use ".";
> for Main use ("basic");
> package Linker is
> for Default_Switches ("Ada") use ("-lgnarl");
> end linker;
>end basic;
>
>which, on my system, results in a working executable. For reference,
>here are tha packages that I used:
Finally got it to work. I also found that the order of these options
in the Linker clause is important. This worked:

package Linker is
for Default_Switches("Ada") use ("-lm","-lcurses","-lgnarl");
end linker;

I almost cannot believe it worked.

Now I have to try some of the other examples.