From: Vadim G. <vgo...@ro...> - 2007-12-17 13:11:43
|
John Stoneham wrote: > > For example, trying to compile tutorial t1. GNAT GPL (and QtAda) are > installed at c:\gnat. I cd to c:\gnat\examples\qtada\tutorial\t1 and run: > C:\GNAT\examples\qtada\tutorial\t1>gnatmake -Ic:\gnat\include\qtada\core > -Ic:\gnat\include\qtada\gui -Ic:\gnat\include\qtada\ui_tools -c main > This completes fine. > > I then run: > C:\GNAT\examples\qtada\tutorial\t1>gnatbind -aOc:\gnat\lib\qtada -F main > which also completes fine. > > Then, I try: > C:\GNAT\examples\qtada\tutorial\t1>gnatlink main > ...and get a zillion "undefined reference to" errors. > > Obviously I'm missing something. Qt4\bin is in my path, ad is gnat and > qtada, so it should be finding everything it needs. Is there a gnatlink > option I'm missing? > You are don't pass to the linker list of required libraries. This list is long and platform dependent. I have recommended to you use GNAT Project Files instead. You may found some description about usage of GNAT Project Files in the documentation directory. The shortest .gpr file will looks like: with "qt_gui"; project Example is for Main use ("main"); package Compiler is for Default_Switches ("Ada") use ("-gnat05"); end Compiler; package Binder is for Default_Switches ("Ada") use ("-F"); end Binder; end Example; PS. If you don't want to use GNAT Project Files you may run: gnatlink main -lqt4ada-core -lqt4ada-gui -lQtCore4 -lQtGui4 and may be you will needed to pass additional switches. This is really not portable, for examples for the UNIX you must write -lQtCore instead of -lQtCore4 on Windows. For Mac OS X several frameworks must be included in the linking. |