GNAT GPL 2009: Shared library project cannot import static library project?

GNAT GPL 2009: Shared library project cannot import static library project?

Post by Andrei » Thu, 21 Jan 2010 03:02:26


Hello everybody!

Can some body help me?
I have tryed to compile a shared library project using: "GPS 4.3.1
(20090114) hosted on pentium-mingw32msv & GNAT GPL 2009 (20090519)".

My shared library project imports a static library project and
compiler (gnatmake) raise an error: "Shared library project cannot
import static library project". Why???

Using the GNAT GPL 2008 with the same projects dont raise any errors.

Thank evrebody for you help.

Andrei
 
 
 

GNAT GPL 2009: Shared library project cannot import static library project?

Post by Andrei » Thu, 21 Jan 2010 22:15:36


More exactly, I have used the next sequence of commands:
# gnatmake -c -gnatc -PMyProject.gpr -d -XLegacy=Ada2005
# gnatdll -d ../libMyDLL.dll -e ./src/libMyDLL.def -I../obj -n ../obj/
mydll.ali

Thank everybody for possible assistance!
Andrei

 
 
 

GNAT GPL 2009: Shared library project cannot import static library project?

Post by sjw » Fri, 22 Jan 2010 05:12:45


Perhaps because a shared library needs to be compiled to be position-
independent (-fPIC on some platforms) but a static library doesn't?


AdaCore continually improve error-detection.


Have you tried gprbuild? would (probably, I don't know Windows) know
how to run gnatdll.
 
 
 

GNAT GPL 2009: Shared library project cannot import static library project?

Post by Vadim Godu » Sat, 23 Jan 2010 04:01:57


It is a error condition not detected by GNAT GPL 2008.
 
 
 

GNAT GPL 2009: Shared library project cannot import static library project?

Post by Per Sandbe » Mon, 25 Jan 2010 07:07:59

Having a dynamic library importing a static library may lead to very
"interesting" behavior of programs in a larger context, if there is any
"static" data in the static library and therefore this is treated as an
error by default with the GNAT tools.

This default behaviour could be supressed with switches to gprbuild if
you know what you are doing and have read the manuals in depth and
understand all the implications.

/Per

2010-01-19 19:02, AndreiK skrev: