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

James Blachly james.blachly at gmail.com
Sun Aug 18 15:20:53 UTC 2019


On 8/6/19 7:45 AM, Stefanos Baziotis wrote:
> Hello everyone,
> 
> I just installed GDC with sudo apt-get install gdc and I can't compile a 
> simple hello world program. I get e.g. static foreach errors:

I also have just installed GDC via apt on Ubuntu18 and cannot compile my 
codebase (via dub build --compiler=gdc). However, I am getting a 
different error related to symbols:

../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.


This codebase compiles fine with dmd2 and ldc2, neither of which is 
installed at the system level. This is a clean VM.

Since I have version() sprinkled all throughout the code, and the error 
relates to a symbol that should not even be present (avltree) , I am 
wondering if GDC is correctly honoring the version() markers in the 
code. Why else would the avltree symbol appear if it is 100% version()ed 
out?



More information about the D.gnu mailing list