comp.lang.ada
 help / color / mirror / Atom feed
* Dynamic link library
@ 2005-12-07 18:48 Lucretia
  2005-12-08  8:54 ` Ludovic Brenta
  0 siblings, 1 reply; 2+ messages in thread
From: Lucretia @ 2005-12-07 18:48 UTC (permalink / raw)


Whilst rebuilding my lib as a shared one, I noticed the following link
errors:

[begin]
cd samples && make
make[1]: Entering directory
`/home/laguest/src/svn-controlled/wxAda/samples'
make[2]: Entering directory
`/home/laguest/src/svn-controlled/wxAda/samples/minimal'
gnatmake -I.. -aI/home/laguest/opt/wxAda/lib/adainclude -u -D debug
minimal.adb
gcc -c -I.. -I/home/laguest/opt/wxAda/lib/adainclude -o debug/minimal.o
minimal.adb
gnatmake -I.. -aI/home/laguest/opt/wxAda/lib/adainclude -u -D debug
minimal_app.adb
gcc -c -I.. -I/home/laguest/opt/wxAda/lib/adainclude -o
debug/minimal_app.o minimal_app.adb
gnatmake -I.. -aI/home/laguest/opt/wxAda/lib/adainclude -u -D debug
minimal_frame.adb
gcc -c -I.. -I/home/laguest/opt/wxAda/lib/adainclude -o
debug/minimal_frame.o minimal_frame.adb
gnatmake -I.. -aI/home/laguest/opt/wxAda/lib/adainclude -u -D debug
test_event.adb
gcc -c -I.. -I/home/laguest/opt/wxAda/lib/adainclude -o
debug/test_event.o test_event.adb
cd debug; \
gnatmake -b -aO/home/laguest/opt/wxAda/lib/adalib minimal; \
gnatmake -l -aO/home/laguest/opt/wxAda/lib/adalib minimal -largs
-lwxadad -L/home/laguest/opt/wxAda/lib/adalib `wx-config --debug=yes
--libs`
gnatbind -aO./ -aO/home/laguest/opt/wxAda/lib/adalib -I- -x minimal.ali
gnatlink minimal.ali -lwxadad -L/home/laguest/opt/wxAda/lib/adalib
-L/home/laguest/opt/wxGTK/lib -pthread -L/usr/X11R6/lib
-lwx_gtk2d_xrc-2.6 -lwx_gtk2d_qa-2.6 -lwx_gtk2d_html-2.6
-lwx_gtk2d_dbgrid-2.6 -lwx_gtk2d_adv-2.6 -lwx_gtk2d_core-2.6
-lwx_based_odbc-2.6 -lwx_based_xml-2.6 -lwx_based_net-2.6
-lwx_based-2.6
/home/laguest/opt/wxAda/lib/adalib/libwxadad.so: undefined reference to
`system__tasking__protected_objects__operations__complete_entry_body'
/home/laguest/opt/wxAda/lib/adalib/libwxadad.so: undefined reference to
`system__tasking__protected_objects__operations__service_entries'
/home/laguest/opt/wxAda/lib/adalib/libwxadad.so: undefined reference to
`system__tasking__protected_objects__entries__protection_entriesIP'
/home/laguest/opt/wxAda/lib/adalib/libwxadad.so: undefined reference to
`system__tasking__protected_objects__operations__protected_entry_call'
/home/laguest/opt/wxAda/lib/adalib/libwxadad.so: undefined reference to
`system__tasking__protected_objects__entries__initialize_protection_entries'
/home/laguest/opt/wxAda/lib/adalib/libwxadad.so: undefined reference to
`system__tasking__protected_objects__operations__communication_blockIP'
/home/laguest/opt/wxAda/lib/adalib/libwxadad.so: undefined reference to
`system__tasking__protected_objects__entries__lock_entries'
collect2: ld returned 1 exit status
gnatlink: cannot call /opt/gcc-4.1-20050902/bin/gcc

raised MAKE.LINK_FAILED : make.adb:6289
make[2]: *** [minimal] Error 1
make[2]: Leaving directory
`/home/laguest/src/svn-controlled/wxAda/samples/minimal'
make[1]: *** [subdirs] Error 2
make[1]: Leaving directory
`/home/laguest/src/svn-controlled/wxAda/samples'
make: *** [all-samples] Error 2
[end]

Now, I finally found these references in the GNARL library, but if I
link libgnarl to my lib the references are still not resolved.

Anyone have any idea why this is?

Thanks,
Luke.

P.S: And yes, I am using a makefile and not the GNAT projects. I want
to know how to do this using a makefile, not a project file.




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Dynamic link library
  2005-12-07 18:48 Dynamic link library Lucretia
@ 2005-12-08  8:54 ` Ludovic Brenta
  0 siblings, 0 replies; 2+ messages in thread
From: Ludovic Brenta @ 2005-12-08  8:54 UTC (permalink / raw)



Lucretia a écrit :
...
> /home/laguest/opt/wxAda/lib/adalib/libwxadad.so: undefined reference to
> `system__tasking__protected_objects__operations__complete_entry_body'
...
> collect2: ld returned 1 exit status
> gnatlink: cannot call /opt/gcc-4.1-20050902/bin/gcc
>
> raised MAKE.LINK_FAILED : make.adb:6289
> make[2]: *** [minimal] Error 1
> make[2]: Leaving directory
> `/home/laguest/src/svn-controlled/wxAda/samples/minimal'
> make[1]: *** [subdirs] Error 2
> make[1]: Leaving directory
> `/home/laguest/src/svn-controlled/wxAda/samples'
> make: *** [all-samples] Error 2
> [end]

Add -lgnat -lgnarl to your linker command line.  Also change -pthread
to
-lpthread, if you are on FreeBSD (GNU/Linux does not need this
library).

> Now, I finally found these references in the GNARL library, but if I
> link libgnarl to my lib the references are still not resolved.
>
> Anyone have any idea why this is?
>
> Thanks,
> Luke.
>
> P.S: And yes, I am using a makefile and not the GNAT projects. I want
> to know how to do this using a makefile, not a project file.

You should avoid recursive makefiles. One flat makefile is better
for various reasons [1].

[1] www.pcug.org.au/~millerp/rmch/recu-make-cons-harm.html

HTH

-- 
Ludovic Brenta.




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-12-08  8:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-12-07 18:48 Dynamic link library Lucretia
2005-12-08  8:54 ` Ludovic Brenta

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox