PDA

View Full Version : How to fix this error ? undefined reference to `IID_IMultiLanguage'



slimittn
23rd January 2011, 13:34
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.

tbscope
23rd January 2011, 17:46
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.

slimittn
23rd January 2011, 20:43
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.

ChrisW67
23rd January 2011, 22:43
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:

LIBS += -lmlang

or


LIBS += C:/Windows/system32/mlang.dll

to your PRO file.

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

slimittn
24th January 2011, 13:43
The first solution :


LIBS += -lmlang

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

The second solution :


win32:LIBS += -LC:/Windows/system32/mlang.dll

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 ?

ChrisW67
24th January 2011, 22:14
The second solution :


win32:LIBS += -LC:/Windows/system32/mlang.dll
doesn't change anything.

That isn't quite what I wrote, but I expect that what I wrote will not work either.


// What I wrote explicitly lists the library file full path
win32: LIBS += C:/Windows/system32/mlang.dll
// and you could also try this search path (-L) and lib (-l) variation
win32: LIBS += -LC:/Windows/system32 -lmlang



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/source/browse/tags/0.0.1/mlang.def?r=5
and see how you get on.