| www.delorie.com/gnu/docs/gcc/gnat_ug_33.html | search |
![]() Buy the book! | |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Usually the linker of the C++ development system must be used to link mixed applications because most C++ systems will resolve elaboration issues (such as calling constructors on global class instances) transparently during the link phase. GNAT has been adapted to ease the use of a foreign linker for the last phase. Three cases can be considered:
c++. Note that this setup is not
very common because it may request recompiling the whole GCC
tree from sources and it does not allow to upgrade easily to a new
version of one compiler for one of the two languages without taking the
risk of destabilizing the other.
$ c++ -c file1.C $ c++ -c file2.C $ gnatmake ada_unit -largs file1.o file2.o --LINK=c++ |
$ gnatbind ada_unit $ gnatlink -v -v ada_unit file1.o file2.o --LINK=c++ |
$ gnatlink -v -v ada_unit file1.o file2.o --LINK=./my_script $ cat ./my_script #!/bin/sh unset BINUTILS_ROOT unset GCC_ROOT c++ $* |
$ gnatlink ada_unit file1.o file2.o --LINK=./my_script $ cat ./my_script #!/bin/sh CC $* `gcc -print-libgcc-file-name` |
Where CC is the name of the non GNU C++ compiler.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
| webmaster donations bookstore | delorie software privacy |
| Copyright © 2003 by The Free Software Foundation | Updated Jun 2003 |