From: AndreiK on
Hello everybody!

Can somebody what does this mean?

The compiler outputs:
"shared library project "X" cannot import project "Y" that is not a
shared library project"

used Windows hosted GNAT GPL and GPS 2009 and compiler, just
downloaded.

Thank you!
From: AndreiK on
The "X" project file is:

===============================
with "../AdFilters/cpp_adfilters.gpr";

project Cpp_BI_SSLL_DLL is

for Languages use ("C++");

for Object_Dir use project'Object_Dir & "../../obj";
for Source_Dirs use project'Source_Dirs & "./src";

for Library_Dir use "lib";
for Library_Name use "BISD";
for Library_Kind use "dynamic";

package Naming is
for Specification_Suffix ("C++") use ".h";
for Implementation_Suffix ("C++") use ".cpp";
end Naming;

end Cpp_BI_SSLL_DLL;
===================================

The "Y" project file is:
=================================
with "../SystemsCL/cpp_systemscl.gpr";

project Cpp_AdFilters is

for Languages use ("C++");

for Object_Dir use project'Object_Dir & "../../obj";
for Source_Dirs use project'Source_Dirs & "./src";

package Naming is
for Specification_Suffix ("C") use ".h";
for Implementation_Suffix ("C") use ".c";
for Specification_Suffix ("C++") use ".h";
for Implementation_Suffix ("C++") use ".cpp";
end Naming;

end Cpp_AdFilters;
===================================

Thanks to everybody for some advise!
From: Yannick Duchêne (Hibou57) on
Le Wed, 02 Jun 2010 13:05:38 +0200, AndreiK <andrei.krivoshei(a)gmail.com> a
écrit:

> Hello everybody!
Hello you!

> Can somebody what does this mean?
>
> The compiler outputs:
> "shared library project "X" cannot import project "Y" that is not a
> shared library project"
As the message says, you are attempting, from a library project, to import
a project which is not a library project.

CPP_AdFilters does not contain any “for Library_Name use ...;” so it is
not a library project.

As far as I know, a library project can only import library projects. Both
must be library project.

The page
http://gcc.gnu.org/onlinedocs/gnat_ugn_unw/Library-Projects.html
says
“Standard project files can import library project files.”

Library project are to be imported from standard project, while standard
project are not to be imported from library project.

This is just like an application depends on a library, while a library is
not to depend on an application.

Le Wed, 02 Jun 2010 13:09:24 +0200, AndreiK <andrei.krivoshei(a)gmail.com> a
écrit:

> The "X" project file is:
>
> ===============================
> with "../AdFilters/cpp_adfilters.gpr";
>
> project Cpp_BI_SSLL_DLL is
>
> for Languages use ("C++");
>
> for Object_Dir use project'Object_Dir & "../../obj";
> for Source_Dirs use project'Source_Dirs & "./src";
>
> for Library_Dir use "lib";
> for Library_Name use "BISD";
> for Library_Kind use "dynamic";
>
> package Naming is
> for Specification_Suffix ("C++") use ".h";
> for Implementation_Suffix ("C++") use ".cpp";
> end Naming;
>
> end Cpp_BI_SSLL_DLL;
> ===================================
>
> The "Y" project file is:
> =================================
> with "../SystemsCL/cpp_systemscl.gpr";
>
> project Cpp_AdFilters is
>
> for Languages use ("C++");
>
> for Object_Dir use project'Object_Dir & "../../obj";
> for Source_Dirs use project'Source_Dirs & "./src";
>
> package Naming is
> for Specification_Suffix ("C") use ".h";
> for Implementation_Suffix ("C") use ".c";
> for Specification_Suffix ("C++") use ".h";
> for Implementation_Suffix ("C++") use ".cpp";
> end Naming;
>
> end Cpp_AdFilters;
> ===================================
>
> Thanks to everybody for some advise!


--
There is even better than a pragma Assert: a SPARK --# check.
--# check C and WhoKnowWhat and YouKnowWho;
--# assert Ada;
-- i.e. forget about previous premises which leads to conclusion
-- and start with new conclusion as premise.
From: sjw on
On Jun 2, 12:09 pm, AndreiK <andrei.krivos...(a)gmail.com> wrote:
> The "X" project file is:

In general, different compiler options (eg -fpic) are needed when
compiling a shared library; so your CPP_AdFilters project might use
the wrong options.

Each project (that actually has source in it) needs to have its own
Object_Dir, I think yours may be the same? (I'm not familiar with
"project'Object_Dir" used like this, does it mean the current
directory? -- yes, nice!)

you might consider just exporting variables:

in CPP_AdFilters,

Source_Dirs := project'Source_Dirs & "./src";
for Source_Dirs use ();

in Cpp_BI_SSLL_DLL,

for Source_Dirs use project'Source_Dirs & "./src" &
CPP_AdFilters.Source_Dirs;

(not sure about the bracketing there).

From: AndreiK on
>
> As far as I know, a library project can only import library projects. Both  
> must be library project.
>
> The pagehttp://gcc.gnu.org/onlinedocs/gnat_ugn_unw/Library-Projects.html
> says
> “Standard project files can import library project files.”
>

There is sayd, that "Standard project files can import library project
files", BUT not sayd, that "Standard project files MUST import ONLY
library project files"
Have somebody any advise?

Best regards,
Andrei