Important: Please read the Qt Code of Conduct -

Problem with ImmSetConversionStatus

  • Hello

    I'm writing an app where I need support for japanese language and because of that I want to change keyboard layout from eng to jap automatically in order to type japanese characters so user won't have to do that himself.

    I've found WINAPI function 'ActivateKeyboardLayout'. Thanks to that I can change english layout to japanese IME but the problem is that it starts working in 'Direct mode' instead of 'Hiragana'. 'ImmSetConversionStatus' function is a solution for that but here I've found a problem:

    First function works fine with Qt4. However, the seconds one causes:

    @debug/widget.o:C:\Documents and Settings\Baca\Moje dokumenty\My Qt4 Projects\nihongo-build-desktop/../nihongo/widget.cpp:21: undefined reference to `ImmSetConversionStatus@12'

    collect2: ld returned 1 exit status@

    I've included <windows.h> and <imm.h> files. What am I doing wrong? These functions works fine in example project in VS2010.

    Thanks for help

  • This is a linker error message not a compiler message. This means you are missing a library reference. If you look at MSDN, this is:


  • Thanks for the answer! Hovewer, I can't find anywhere this library. Adding:

    @LIBS += Coreimm.lib@

    to .pro file doesn't work either. What to do?

  • Do you use the microsoft toolchain of mingw?
    for mingw, it would be

    LIBS += -lCoreimm.a

  • you must search your computer where that file is and add the path to the .pro like this:

    LIBS += -Lc:/path/to/the/dir -lCoreimm

  • ups, ok, for mingw without .a...
    But the windows libraries are already in the library search path for mingw I think.

    win32 {
    LIBS += -ladvapi32 -luser32

    this normally works without adding the path

  • Thanks for help! Your advice was very helpful. I've finally managed to compile my project. I added 'LIBS += -limm32' and now everything works nearly perfect.

    Everything works fine under Debug/Release mode in QtCreator. The problem occurs when I want to run compiled application. There are no errors but functions changing keyboard layout and IME are not working. What's wrong? I suppose it's because I use this library but I don't know how to run my app (without using QtCreator).

    I hope you'll be able to help me this time too :)

Log in to reply