[solved] mingw32-make install doesn't work



  • I'm using QtCreator 2.2 alongside Qt SDK 1.1 on Windows.

    Now I tried to install the "kqoauth-library":http://gitorious.org/kqoauth/kqoauth by doing mingw32-make clean, qmake, mingw32-make, mingw32-make install.
    Building it works without errors, but it doesn't seem to be installed correctly.

    bq. twittercli.cpp:24:20: error: QtKOAuth: No such file or directory

    happens when I try

    @#include <QtKOAuth>@

    What am I doing wrong?

    This is the mingw32-make install output:

    @C:\kqoauth-kqoauth>mingw32-make install
    cd src\ && mingw32-make -f Makefile install
    mingw32-make[1]: Entering directory C:/kqoauth-kqoauth/src' mingw32-make -f Makefile.SharedDebug install mingw32-make[2]: Entering directoryC:/kqoauth-kqoauth/src'
    mingw32-make[2]: Nothing to be done for install'. mingw32-make[2]: Leaving directoryC:/kqoauth-kqoauth/src'
    mingw32-make[1]: Leaving directory C:/kqoauth-kqoauth/src' cd examples\ && mingw32-make -f Makefile install mingw32-make[1]: Entering directoryC:/kqoauth-kqoauth/examples'
    mingw32-make[1]: Nothing to be done for install'. mingw32-make[1]: Leaving directoryC:/kqoauth-kqoauth/examples'
    cd tests\ && mingw32-make -f Makefile install
    mingw32-make[1]: Entering directory C:/kqoauth-kqoauth/tests' cd ut_kqoauth\ && mingw32-make -f Makefile install mingw32-make[2]: Entering directoryC:/kqoauth-kqoauth/tests/ut_kqoauth'
    mingw32-make -f Makefile.Debug install
    mingw32-make[3]: Entering directory C:/kqoauth-kqoauth/tests/ut_kqoauth' mingw32-make[3]: Nothing to be done forinstall'.
    mingw32-make[3]: Leaving directory C:/kqoauth-kqoauth/tests/ut_kqoauth' mingw32-make[2]: Leaving directoryC:/kqoauth-kqoauth/tests/ut_kqoauth'
    cd ft_kqoauth\ && mingw32-make -f Makefile install
    mingw32-make[2]: Entering directory C:/kqoauth-kqoauth/tests/ft_kqoauth' mingw32-make -f Makefile.Debug install mingw32-make[3]: Entering directoryC:/kqoauth-kqoauth/tests/ft_kqoauth'
    mingw32-make[3]: Nothing to be done for install'. mingw32-make[3]: Leaving directoryC:/kqoauth-kqoauth/tests/ft_kqoauth'
    mingw32-make[2]: Leaving directory C:/kqoauth-kqoauth/tests/ft_kqoauth' mingw32-make[1]: Leaving directoryC:/kqoauth-kqoauth/tests'@

    Happens upon trying to compile the sample.



  • It seem as if the Makefile installs the lib into the regular lib directory of Qt.

    Did you check if the files actually have been installed in the target dirs?

    I just checked the Makefiles for win32-g++ (MinGW) generated on a Mac OS X box (no definitive answer though), but it seems as if "make install" does nothing here. That means, you will either have to copy the stuff yourself or set the INCLUDEPATH and LIBS variables of your .pro file to the respective paths in your source tree of kqoauth.



  • Which folders would that be to properly install it?
    I put them in C:\QtSDK\Desktop\Qt\4.7.3\mingw\lib but that didn't help.

    I also added these two lines in the project-file which didn't help either.

    @INCLUDEPATH += ../../lib
    LIBS += ../../lib@



  • I do not have an SDK installed, so I just can guess.

    • put the library (.a/.so/.lib/.dll - whatever it is in MinGW) into the same directory were the respective QtCore, QtGui, etc. counterparts live (this may be lib for the .lib and bin for the .dll files, I don't know)
    • put all header files into the include folder where the Qt headers are located

    You'll have to repeat this for every Qt version you install afterwards.

    I personally would add the paths of the source directory to the .pro file:

    @
    INCLUDEPATH += C:/kqoauth-kqoauth/include C:/kqoauth-kqoauth/src
    LIBS += C:/kqoauth-kqoauth/lib -lkqoauth
    @

    It's just a guess, so please adjust the paths if you need so.



  • your paths were right. However the compiler complains that it can't find -lkqoauth

    bq. c:/qt/qtcreator-2.1.84/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../../mingw32/bin/ld.exe: cannot find -lkqoauth

    The error message is the same even if I use that instead:

    bq. LIBS += C:/kqoauth-kqoauth/lib -lkqoauthd0



  • What files are in the C:/kqoauth-kqoauth/lib directory?



  • kqoauth.prl
    kqoauthd.prl
    kqoauthd0.dll
    libkqoauthd0.a



  • Ah, sorry, the snippet was not complete. This is the correct one (spot the "-L" before the path!):

    @
    LIBS += -LC:/kqoauth-kqoauth/lib -lkqoauthd0
    @



  • The problem remains

    @c:/qt/qtcreator-2.1.84/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../../mingw32/bin/ld.exe: cannot find -lkqoauth@



  • You should change the second one to

    @
    -lkqoauthd0
    @

    The general rule is: If you have a file libxblurb.a then you must specify -lxblurb to the linker.



  • I found out the LINKAGE-entries in the kqoauth.prf lead to that problem.
    The relevant part is this:

    @# else, link normally
    isEmpty(LINKAGE) {
    exists($$PWD/kqoauth.pro): INCLUDEPATH += $$KQOAUTH_INCDIR
    else: INCLUDEPATH += $$KQOAUTH_INCDIR/QtKOAuth
    LIBS += -L$$KQOAUTH_LIBDIR
    LINKAGE = -libkqoauthd0
    CONFIG(debug, debug|release) {
    windows:LINKAGE = -libkqoauthd0
    mac:LINKAGE = -lkqoauth_debug
    }
    }@

    After I changed -lkqoauth to -libkqoauthd0 as you can see I get this error now:

    @c:/qt/qtcreator-2.1.84/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../../mingw32/bin/ld.exe: cannot find -libkqoauthd0@



  • I would guess, this still puts wrong paths into the library search path.

    I would recommend to copy the twitter sample application into a separate directory, do not include the .prf files and adjust the .pro file of the sample as mentioned above. I do not have a running MinGW environment at the moment an so cannot test.



  • I did what you said. It compiles now.
    The problem however is that it doesn't display any output. It just ends.

    According to the main-function it should call showHelp() which should give some output. So I guess something went wrong again. Any ideas?

    Here's the main-function:

    @int main(int argc, char *argv[])
    {
    QCoreApplication app(argc, argv);
    QCoreApplication::setOrganizationName("kQOAuth");
    QCoreApplication::setApplicationName("TwitterCLI");

    QStringList args = QCoreApplication::arguments();
    
    TwitterCLI tAuth;
    if(args.contains("-t")) {
        if(args.last() != "-t") {
            tAuth.sendTweet(args.last());
        }
     } else if( args.contains("-a")){
        tAuth.getAccess();
    } else if (args.contains("-x")) {
        tAuth.xauth();
    } else {
        tAuth.showHelp();
        return 0;
    }
    
    return app.exec();
    

    }@

    and here's showHelp

    @void TwitterCLI::showHelp() {
    QTextStream qout(stdout);
    qout << "TwitterCLI, version 0.95. Author: Johan Paul johan.paul@d-pointer.com\n"
    << "\n"
    << "Usage: twittercli -[at] <tweet>\n"
    << " -a Request for access tokens.\n"
    << " -x Use Twitter xAuth to retrieve access tokens.\n"
    << " -t '<tweet>' Send <tweet> to Twitter after retrieving access tokens\n"
    << "\n";
    }@



  • Did you step through the debugger? It works for me there.

    And watch out: It's a console application, you will not get a window with the message :-)



  • I just tried it. btw. I'm using Qt Creator.
    While stepping through it it shows the output (showHelp) but if I simply run it, it shows nothing (not even a qDebug() I set at the beginning of the main-function.

    Its the same when I start it from the cmd-window -> no output

    congrats to your 2.4k-th post :)



  • Ah... damn! the stdout trap on windows! As far as I know you do not have this in the cmd shell of windows, so you'll have to stick to Qt Creator to see this (or just make it a small gui, shouldn't be too hard to make a button for each option and a QTextBrowser for the output)

    EDIT: Oh, and thanks for the congrats of course.



  • No, that's all I needed.
    I'll implement it straight in my program.
    It's working beautiful.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.