Results 1 to 6 of 6

Thread: How to fix this error ? undefined reference to `IID_IMultiLanguage'

  1. #1
    Join Date
    Dec 2010
    Location
    Tunisia
    Posts
    21
    Thanks
    6
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default How to fix this error ? undefined reference to `IID_IMultiLanguage'

    Hi,

    when i try to compile a script using VMime on Windows i have this error :

    undefined reference to `IID_IMultiLanguage'

    I can't find a libmlang.a nor the library sources in internet.

    So how can i fix this ?

    Thanks.

  2. #2
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: How to fix this error ? undefined reference to `IID_IMultiLanguage'

    You need to include a header (or other) file that defines IID_IMultiLanguage to be able to compile the code.
    To link the code, you also need to link to the library.

    So, how do you fix this?
    Find the library. If you can't find it, I suggest you contact the people of the website you downloaded the code from.

  3. The following user says thank you to tbscope for this useful post:

    slimittn (23rd January 2011)

  4. #3
    Join Date
    Dec 2010
    Location
    Tunisia
    Posts
    21
    Thanks
    6
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to fix this error ? undefined reference to `IID_IMultiLanguage'

    I only found the "mlang.h" header file on the mingw/include folder and this don't resolve the problem.

    I have also contacted the people of the website i downloaded the code from but still now no response.

    Thanks.

  5. #4
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: How to fix this error ? undefined reference to `IID_IMultiLanguage'

    The error you have is a linker error, so your code is compiling OK (the header file is found). I expect this symbol is defined in mlang.dll in your Windows system folder.


    What does your PRO file have for LIBS?

    Since MingW can sometimes directly link against the DLL (no import library required) I would first try simply adding:
    Qt Code:
    1. LIBS += -lmlang
    To copy to clipboard, switch view to plain text mode 
    or
    Qt Code:
    1. LIBS += C:/Windows/system32/mlang.dll
    To copy to clipboard, switch view to plain text mode 
    to your PRO file.

    Failing that you could try making an import library using the http://msdn.microsoft.com/en-us/libr...08(VS.85).aspx (docs) and http://www.mingw.org/wiki/CreateImportLibraries

  6. The following user says thank you to ChrisW67 for this useful post:

    slimittn (24th January 2011)

  7. #5
    Join Date
    Dec 2010
    Location
    Tunisia
    Posts
    21
    Thanks
    6
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to fix this error ? undefined reference to `IID_IMultiLanguage'

    The first solution :

    Qt Code:
    1. LIBS += -lmlang
    To copy to clipboard, switch view to plain text mode 

    gives me this error : :: error: cannot find -lmlang.

    The second solution :

    Qt Code:
    1. win32:LIBS += -LC:/Windows/system32/mlang.dll
    To copy to clipboard, switch view to plain text mode 

    doesn't change anything.

    I also tried to make the import library and it also doesn't succeed . I think that the mlang dll isn't compatible with the dlltool of MinGW.

    http://www.mingw.org/wiki/CreateImportLibraries

    Note also that some dll's may just *not be compatible* -- for example if size differences occur between long long in the different compilers, and you attempt to pass out structs that have long longs. MSVC is known to have different lengths than gcc for long double, some of its versions of it have a difference for size_t, as well (other discrepancies may be lurking, as well).
    Or maybe i don't known how to do it.

    Note : I succeed to compile this lib (VMime) under Ubuntu.

    So can you help me please ?

  8. #6
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: How to fix this error ? undefined reference to `IID_IMultiLanguage'

    Quote Originally Posted by slimittn View Post
    The second solution :

    Qt Code:
    1. win32:LIBS += -LC:/Windows/system32/mlang.dll
    To copy to clipboard, switch view to plain text mode 
    doesn't change anything.
    That isn't quite what I wrote, but I expect that what I wrote will not work either.
    Qt Code:
    1. // What I wrote explicitly lists the library file full path
    2. win32: LIBS += C:/Windows/system32/mlang.dll
    3. // and you could also try this search path (-L) and lib (-l) variation
    4. win32: LIBS += -LC:/Windows/system32 -lmlang
    To copy to clipboard, switch view to plain text mode 

    I also tried to make the import library and it also doesn't succeed . I think that the mlang dll isn't compatible with the dlltool of MinGW.

    Or maybe i don't known how to do it.
    I think the only option is to hand craft a DEF file and make the import library yourself. You'd need the docs for the mlang library (link in my earlier reply) and perserverance. You could start with this:
    http://code.google.com/p/win-iconv/s.../mlang.def?r=5
    and see how you get on.

Similar Threads

  1. Plugin compiler error: undefined reference
    By FinderCheng in forum Qt Programming
    Replies: 8
    Last Post: 1st May 2010, 16:49
  2. Getting Undefined Reference Error
    By A.H.M. Mahfuzur Rahman in forum Qt Programming
    Replies: 2
    Last Post: 22nd June 2009, 02:12
  3. Error - undefined reference qMain
    By tpf80 in forum Newbie
    Replies: 4
    Last Post: 23rd February 2009, 07:54
  4. error undefined reference ...............
    By amit_pansuria in forum Qt Programming
    Replies: 2
    Last Post: 8th June 2007, 14:28
  5. Undefined Reference error!!!
    By Kapil in forum Newbie
    Replies: 25
    Last Post: 28th March 2006, 12:03

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.