www.digitalmars.com         C & C++   DMDScript  

D.gnu - [Bug 243] New: Module std.array is already defined in...

http://bugzilla.gdcproject.org/show_bug.cgi?id=243

            Bug ID: 243
           Summary: Module std.array is already defined in...
           Product: GDC
           Version: 5.x
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: Normal
         Component: gdc
          Assignee: ibuclaw gdcproject.org
          Reporter: chalix web.de

Hi,
I found some inconsistency to the dmd compiler. If I want to compile this
simple program:


import std.stdio;
import gtk.Main; /* -I/usr/local/include/d/gtkd-3 */

void main(string[] args)
{
        // Prints "Hello World" string in console
        writeln("Hello World!");

        // Lets the user press <Return> before program returns
        stdin.readln();
        return;
}


I get an error using gdc, but not with dmd. The GtkD library must be installed,
though. My .so files are at a default location, the header files are at a
seperate location.

Now the output of both:

~$ dmd main.d -I/usr/local/include/d/gtkd-3 -L-lgtkd-3
~$ ./main
Hello World!


~$ gdc main.d -I/usr/local/include/d/gtkd-3 -lgtkd-3
~$ ./a.out 
Fatal Error while loading '/usr/lib/x86_64-linux-gnu/libphobos2.so.0.71':
        The module 'std.array' is already defined in './a.out'.


It is this line, which causes the error:
import gtk.Main; /* -I/usr/local/include/d/gtkd-3 */
If I delete this line, a.out does not throw an error. (But I cant use the GtkD
library then...)



Some more information:


~$ gdc --version
gdc (Ubuntu 5.4.0-6ubuntu1~16.04.2) 5.4.0 20160609

~$ ld -v
GNU ld (GNU Binutils for Ubuntu) 2.26.1

~$ dmd -v
DMD64 D Compiler v2.071.1

-- 
You are receiving this mail because:
You are watching all bug changes.
Oct 03 2016