Help save net neutrality! Learn more.
Close

Using wxd --> undefined reference to ...

wxD
Thomas
2009-02-23
2013-05-22
  • Thomas

    Thomas - 2009-02-23

    Hi @ll,

    ich wrote a simple D application:

    ---
    import std.stdio;
    import wx.wx;

    int main()
    {
      writefln("Hello world");
      return 0;
    }
    ---

    Which does not compile:
    ---
    #gdc -I /usr/local/include/d/ bla.d
    /tmp/ccsU7Q35.o:(.data+0x78): undefined reference to `_D2wx2wx12__ModuleInfoZ'
    collect2: ld returned 1 exit status
    ---

    Google has 0 results for "_D2wx2wx12__ModuleInfoZ" and tons of useless stuff for anything else I tried :-(.

    I am using openSuse 10.3 x64 and I installed wxGTK(-devel) 2.84 using yast. Then I compiled wxd.

    I am greatful for any ideas :-).

     
    • Anders F Björklund

      That symbol is in the "wxd" library. You will also need the "wxc" library, and all of the wxWidgets libraries. If you look at one of the samples, you'll see what to include ?

       
      • Thomas

        Thomas - 2009-02-24

        I have installed the packages wxWidgets(-devel) as well.

        I tried to compile the example "Hello", which did not work at first since ld failed to find libstdc++. I could finally make this work by executing `ln -s ../lib64/libstdc++.so.6.0.9 libstdc++.so` in /usr/lib. Although this worked and ended in a working Hello-application it feels awfully wrong to solve the problem. How can I make it better?

        After reading the sample makefiles, make-output and trying a lot of different things I managed to find a way to compile my program sucessfully:
        ---
        gdc -I ~/installation.files/wxd/wxd -O2 -g -c -o bla.o bla.d
        gdc -o bla bla.o -L ~/installation.files/wxd/wxd -lwxd  -lwxc `wx-config --libs` -lstdc++
        ---
        I tried to merge these two commands, but I have not been successful so far. I am greatful for any clues.

        Additionally the path in ~/installation.files is the path where I have extracted the wxd lib temporarely. I wonder where to copy which files to make things cleaner...

         

Log in to post a comment.