AdaCore / gprbuild

GPRbuild is an advanced build system designed to help automate the construction of multi-language systems.
Other
64 stars 21 forks source link

linker errors, many 'undefined reference' #25

Closed LaRueGT closed 6 years ago

LaRueGT commented 7 years ago

I'm having a hard time building from a windows mingw environment, running into link errors.

The first of my errors was cleared up by this issue: https://github.com/AdaCore/gprbuild/issues/5

Build process progresses further, but ends with many link errors gcc -c -gnatwua -gnaty -gnatQ -O2 -gnatn schema-dom_readers.adb gcc -c -gnatwua -gnaty -gnatQ -O2 -gnatn schema-decimal.adb gcc -c -gnatwua -gnaty -gnatQ -O2 -gnatn schema-date_time.adb gprlib.exe xmlada_unicode.lexch g++.exe -shared -shared-libgcc -o C:\msys64\home\gtlar\code\ada\lib\xmlada\xmlada-gpl-2016-src\unicode\lib\relocatable\libxmlada_unicode.dll ... C:\tmp\GNAT-TEMP-000025.TMP ... C:\msys64\home\gtlar\code\ada\lib\xmlada\xmlada-gpl-2016-src\unicode\obj\relocatable\unicode.o:unicode.adb:(.text+0x19d): undefined reference to `system__utf_32__utf_32_to_lower_case'

(snip)

C:\msys64\home\gtlar\code\ada\lib\xmlada\xmlada-gpl-2016-src\unicode\obj\relocatable\unicode-ccs-iso_8859_15.o:unicode-ccs-iso_8859_15.adb:(.text+0x2d9): undefined reference to __gnat_raise_exception' C:\msys64\home\gtlar\code\ada\lib\xmlada\xmlada-gpl-2016-src\unicode\obj\relocatable\unicode-ccs-iso_8859_1.o:unicode-ccs-iso_8859_1.adb:(.text+0x4a): undefined reference tosystemimg_uns__image_unsigned' C:\msys64\home\gtlar\code\ada\lib\xmlada\xmlada-gpl-2016-src\unicode\obj\relocatable\unicode-ccs-iso_8859_1.o:unicode-ccs-iso_8859_1.adb:(.text+0xce): undefined reference to `gnat_raise_exception' collect2.exe: error: ld returned 1 exit status gprlib: c:\msys64\mingw64\bin\g++ execution error gprbuild: could not build library for project xmlada_unicode make: *** [Makefile:58: relocatable] Error 4

I suspect this is en environment issue on my end, but I'm having a hard time with it, running the shell as admin, permission on the tmp folder is wide open.

t-14 commented 7 years ago

I suspect this is en environment issue on my end

Those unresolved references were supposed to be resolved by the Ada runtime. We don't use mingw64 toolchain ourselves, but as far as I can tell, this suggests that your toolchain is not (completely) Ada-aware for some reason. Does building Ada programs of "hello-world" kind work for you? I also find it peculiar that it uses g++ as linker driver, which it only does if language C++ is declared, and I don't think that's the case for xmlada_unicode project.

t-14 commented 6 years ago

We are closing this issue, if you would like to pursue it, feel free to comment.