Forum


Notice to all users

We are migrating towards a new forum system located at community.teamspeak.com, as such this forum will become read-only on January 29, 2020

Page 1 of 2 12 LastLast
Results 1 to 15 of 19
  1. #1
    Join Date
    December 2009
    Location
    Germany
    Posts
    32

    SDK + qmake + mingw = error 126?

    Hi, I am currently developing a simple plugin using the sdk. Everything is fine for my linux version, that i compile on 32 bit ubuntu. When i try to cross compile the whole stuff for windows, the plugin fails to load with error number 126 from loadlibrary.
    using google you can find several problems regarding unicode and mingw with this stuff.
    So my question is, did anyone successfully cross-compile or just simply compile a plugin with qt qmake using mingw or is everyone just using msvc?

    i already tried changing from shared to static library versions and to disable the unicode stuff, that qt uses, none of that was successfull.

    a link to the dll can be found here:
    http://dl.dropbox.com/u/1080522/tsstalker.dll

    the project file looks like this:
    Code:
    ######################################################################
    # Automatically generated by qmake (2.01a) Fri Oct 29 22:18:19 2010
    ######################################################################
    
    TEMPLATE = lib
    TARGET = bin/plugins/tsstalker
    DEPENDPATH += . include ts3client_pluginsdk/src
    INCLUDEPATH += . include ts3client_pluginsdk/src
    CONFIG += qt dll release shared 
    DEFINES -= UNICODE
    QT += xml
    
    # Input
    HEADERS += include/clientlib_publicdefinitions.h \
               include/plugin_definitions.h \
               include/plugin_events.h \
               include/public_definitions.h \
               include/public_errors.h \
               include/public_rare_definitions.h \
               include/ts3_functions.h \
               src/plugin.h \
               include/ContextMenu.h \
               include/Stalker.h
    SOURCES += src/plugin.cpp \
               src/ContextMenu.cpp \
               src/Stalker.cpp
    thx in advance

  2. #2
    Join Date
    September 2005
    Location
    Germany / Dortmund
    Posts
    1,376
    You need to use the msvc on windows, if you want to use the client's qt libraries. Otherwise your plugin can't resolve your qt symbols.


    (=> Moved to plugins section)

  3. #3
    Join Date
    December 2009
    Location
    Germany
    Posts
    32
    so it should just work if i do a complete static linked library with all qt and the libgcc linked in it, right?
    what a pity that the default qt mingw framework for windows doesnt come statically build, that nearly makes it impossible to do a complete static library without a windows installation.

  4. #4
    Join Date
    September 2005
    Location
    Germany / Dortmund
    Posts
    1,376
    Yeah, that's my dilemma too.

    I use different virtual machines to compile my projects for the different platforms.

  5. #5
    Join Date
    December 2009
    Location
    Germany
    Posts
    32
    The road to a working windows plugin version seems to be very hard. I have got my plugin working now with MSVC 2010 Express but i like to use at least the xml-library from qt too. As long as i build the plugin without the xml stuff only depending on qtcore4 and qtgui4 the plugin is loaded without problems, but if i insert code that depends on qtxml4 I get a LoadLibrary 127 error, i know you use qt stuff in your plugin, did you encounter similar problems or know what the problem may be?

    btw, the qtxml4.dll is in the path and the same version as the other qt dlls.

    does it maybe matter that im using msvc 2010 and the qt stuff is for msvc 2008? this windows world is terrible... i swear i needed about half the time to write the plugin and get it to run in linux than i just needed to install the toolchain on windows.
    Last edited by banane; November 2nd, 2010 at 11:56 PM.

  6. #6
    Join Date
    September 2005
    Location
    Germany / Dortmund
    Posts
    1,376
    the qtxml4.dll is in the path
    Did you put it in the client's directory or the plugins-directory?
    The librarypath is only set to the client's main directory, so you need to put it there.

    does it maybe matter that im using msvc 2010 and the qt stuff is for msvc 2008
    That could be the reason, but I really don't know.

    this windows world is terrible
    Confirmed. On linux it's so easy, no trouble with the compiler.

  7. #7
    Join Date
    December 2009
    Location
    Germany
    Posts
    32
    the qtxml4.dll is in the clients main directory...

    is switched to msvc 2008, nothing changed, same strange behaviour.

    I additionally checked wether all dependencies of the dll are met mit the dependency walker and everything looks fine and really the same like in the doodle.dll but that there is the additional dependency on qtxml4.dll.

    i recognized, that although i installed the 4.6.2 framework of qt my own qt dlls differ in the size from the ones in the teamspeak client lib.

    I'm stuck right now, I dont really need the Xml stuff at the moment but it may come in handy later, so i may just go on without the Xml stuff. Furthermore i noticed that the same LoadLibrary error occurs when i use a "foreach" loop.

  8. #8
    Join Date
    September 2005
    Location
    Germany / Dortmund
    Posts
    1,376
    that although i installed the 4.6.2 framework of qt my own qt dlls differ in the size from the ones in the teamspeak client lib.
    Yes, mine too. You and the developers seems to configure Qt with different parameters, so for example you could have enabled sql, but the developers not.

    Later this day I will test a little project with the xml module, if this helps.

  9. #9
    Join Date
    December 2009
    Location
    Germany
    Posts
    32
    would be really nice

  10. #10
    Join Date
    February 2010
    Location
    Hollandia
    Posts
    57
    hope you don't mind if i try with you....
    installed qt creator with the sdk 4.6.2 on it.... got the source right here..
    it compiles the source. makes a .dll file but doesn't load as a plugin inside teamspeak3.
    so i guess i am almost there...

    other option would be vs2010, but I was now trying it inside qt creator.

    https://sites.google.com/site/stezzz...edirects=0&d=1

  11. #11
    Join Date
    September 2005
    Location
    Germany / Dortmund
    Posts
    1,376
    it compiles the source. makes a .dll file but doesn't load as a plugin inside teamspeak3.
    As I already told you (I think three times? ), you will need to compile your plugin with the Visual C(++) Compiler, because the client's Qt libraries are for Visual C, not MinGW (the Qt SDK for Windows uses MinGW).

    MinGW (gcc) and Visual C use different formats for the symboltables and different formats for name mangling.

    EDIT:
    Code:
    QApplication a(argc, argv);
    I found that in your code (commented out). Never - I mean really never - create two QApplication objects in only one application. The TeamSpeak 3 client has a QApplication object which can be accessed by plugin. :P

  12. #12
    Join Date
    December 2009
    Location
    Germany
    Posts
    32
    stezzz, the only other way around would be compiling qt completely static and then create a dependent dll containing all the code used from the qt library. i tried it using mingw, but didnt manage to get the final dependent dll, its a lot of hassling around with the compiler options and qt project files. so you can guess that this may be the hardest way and building the qt stuff statically takes hours...

    do it like thomas said, just switch to msvc, you dont even need to use the ide, you can configure your makefiles using

    qmake -spec win32-msvc2010 (or 2008 accordingly) to create the makefiles and this will make you independent from any ide.

  13. #13
    Join Date
    September 2005
    Location
    Germany / Dortmund
    Posts
    1,376
    Yeah, I tried the static way too, but I didn't want more than two Qt installations on my machine (4.6.2 for plugins, and the newest Qt version for other projects).

    I think if you have the possibility to use msvc, you should use it, this would be the easiest way.


    EDIT: Tested some small testplugin with core, gui and xml module. Runs without problems on linux, but can't load on windows with QtXml-lib in the client's directory.
    Perhaps you have success with static Qt bindings.
    Last edited by Thomas; November 3rd, 2010 at 06:47 PM.

  14. #14
    Join Date
    February 2010
    Location
    Hollandia
    Posts
    57
    Quote Originally Posted by Thomas
    I found that in your code (commented out). Never - I mean really never - create two QApplication objects in only one application. The TeamSpeak 3 client has a QApplication object which can be accessed by plugin. :P
    I love to Comment, It gave me just the right result thnxs for the nice explanation, I mean i read about TS3 being build on the QT Frameworks and all, so that describes your comment

    Quote Originally Posted by banane View Post
    stezzz, the only other way around would be compiling qt completely static and then create a dependent dll containing all the code used from the qt library. i tried it using mingw, but didnt manage to get the final dependent dll, its a lot of hassling around with the compiler options and qt project files. so you can guess that this may be the hardest way and building the qt stuff statically takes hours...

    do it like thomas said, just switch to msvc, you dont even need to use the ide, you can configure your makefiles using

    qmake -spec win32-msvc2010 (or 2008 accordingly) to create the makefiles and this will make you independent from any ide.
    K so the source i posted (link)
    So I go with the visual command prompt to that directory and run your command: qmake -spec win32-msvc2010
    Than I will have the makefiles.?
    So than what to do to get the dll out of this?

    Just trying to get something to work before the end of the night

  15. #15
    Join Date
    December 2009
    Location
    Germany
    Posts
    32
    it works this way:
    qmake -spec win32-msvc2010
    nmake clean
    nmake
    this will put a QTPlugin.dll into the same folder. qmake just creates the makefiles from your .pro file, so whenever you change the profile, you need to invoke qmake.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. MinGW Qt and LoadLibrary error: 193
    By ispovedn1k in forum Client Plugins / Lua Scripts
    Replies: 0
    Last Post: March 18th, 2015, 05:57 PM
  2. Replies: 16
    Last Post: October 24th, 2012, 01:58 PM
  3. Replies: 0
    Last Post: September 5th, 2011, 07:20 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •