Qt World Summit: Submit your Presentation

[SOLVED] Help request foreign library static linking

  • Hi all,
    I’m a beginner using Qt.
    Until now I’ve developed using mostly (VB | C#) & .Net Framework.

    I'm using the DLL version of this library in a VB+.Net project
    "Feitian – Rockey4nd":http://www.rockey.it/rockey4nd-download.htm
    I downloaded “ROCKEY4ND Windows SDK” (Note: This is gz compressed non zip)

    I'm trying to use it in a QtProject but I'm not able to understand which is the correct file to link and how to use the Rockey() funcion.

    Thanks in advance

  • Hi,

    Which compiler do you use? static lib for mingw seems to be inside Api32\DEV_C++, dynamic for mingw/VS inside Api32\Dynamic, and static for VS inside Api32\Static.

    What is the problem with Rockey() ? the first pages in "Docs\Rockey4ND Developer Guide.pdf" are simple introduction into API convention. Main idea is that you use this function for everything, but you need to pass different arguments to achive particular effect.

    Best regards,

  • Please don't open more than 1 thread for the "same topic":http://qt-project.org/forums/viewthread/27942/.

  • AT hardcodes.de:
    I'm sorry. Is it possible to merge the two topics?

    AT bogdan:
    I've tryied all this Api32\DEV_C++ Api32\Dynamic and Api32\Static
    but I get the error: (!) undefined reference to 'Rockey'

    I've made a simple test project:

    @QT += testlib

    QT -= gui

    TARGET = tst_rockey4ndtest
    CONFIG += console
    CONFIG -= app_bundle

    TEMPLATE = app

    SOURCES += tst_rockey4ndtest.cpp
    DEFINES += SRCDIR=\"$$PWD/\"

    win32: LIBS += -L$$PWD/../../Libraries/Rockey/Static/ -lRockey4ND

    INCLUDEPATH += $$PWD/../../Libraries/Rockey/Static
    DEPENDPATH += $$PWD/../../Libraries/Rockey/Static

    win32: PRE_TARGETDEPS += $$PWD/../../Libraries/Rockey/Static/Rockey4ND.lib@

    @void Rockey4ndTest::testRockeyFunc()
    unsigned short retcode;
    unsigned short handle[16], p1, p2, p3, p4;
    unsigned long lp1, lp2;
    unsigned char buffer[1024];
    p1 = 0xf910;
    p2 = 0xf5ca;
    p3 = 0xf561;
    p4 = 0xca39;
    retcode = Rockey(RY_FIND, &handle[0], &lp1, &lp2, &p1, &p2, &p3, &p4, buffer);
    QVERIFY2(retcode, ERR_SUCCESS);

    Rockey4_ND_32.h (changed)
    @extern "C" unsigned short Rockey(unsigned short function,unsigned short *handle,unsigned long *lp1,unsigned long *lp2,unsigned short *p1,unsigned short *p2,unsigned short *p3,unsigned short *p4,unsigned char *buffer);

  • [quote author="BorisSclauzero" date="1369060084"]AT hardcodes.de:
    I'm sorry. Is it possible to merge the two topics?

    An admin should be able to do that. Maybe its best to copy the information from the other thread in here and change the topic to something like [please delete thread]

  • If you are reading this thread and you need help
    send me a request :)

Log in to reply