Installed with sudo apt-get install gdc in Ubuntu 18.04 - Can't compile a simple program.

James Blachly james.blachly at gmail.com
Mon Aug 19 02:36:51 UTC 2019


On 8/18/19 11:20 AM, James Blachly wrote:
> ../intervaltree/.dub/build/library-release-debug-linux.posix-x86_64-gdc_2068-CAF4B0AA644EFF0EF2E4C805B972A804/libintervaltree.a:(minfo+0x20): 
> multiple definition of `_D12intervaltree7avltree11__moduleRefZ'
> /tmp/ccNVyy2Z.o:(minfo+0xe0): first defined here
> ../intervaltree/.dub/build/library-release-debug-linux.posix-x86_64-gdc_2068-CAF4B0AA644EFF0EF2E4C805B972A804/libintervaltree.a:(.data+0x80): 
> multiple definition of `_D12intervaltree7avltree12__ModuleInfoZ'
> /tmp/ccNVyy2Z.o:(.data+0x2c0): first defined here
> collect2: error: ld returned 1 exit status
> gdc failed with exit code 1.

Problem solved -- I had identical module file under a different path; 
DMD and LDC merged them into a single symbol/code, while GDC generated 
and emitted them separately, resulting in a linker error.

This also means I have successfully compiled with GDC for the first 
time. Glad that it was painlessly available via apt-get.


More information about the D.gnu mailing list