How to incorporate non-inline assembly files and CPP into single QT project?

  • Hi, guys
    I am newcomer to QT and Creator. Now I am facing a problem that I need incorporate several assemble files, with file extension, .s into my UI application, in order to speed up Color Space Conversion, but it seems that the method, which is exported in assembly file, could not be recognized by main CPP. The qtcreator compiler says, that is undefined referrence. Does QT Creator support such an hybrid project,mixing up with C++ and assemply together? Do I need special configuration on project?

    Brooks Li.

  • @Brooks

    Hi and welcome to devnet

    Qt creator is only an IDE and has no compiling capabilities. You have to install an external compiler for compilation. If you installed compiler does not support assembler files.
    If your compiler does support assembler files you have to check how to add another compiler to the development environment.

    Not sure if this is very easy. Probably the best solution would be to use an external library hosting the compiled assembly files and providing a C++ header file.

  • Hi and welcome to devnet,

    just to clarify: Qt Creator is only an IDE; it uses the compiler configured in the Kits.

    To import assembly files you should check which options are provided by the compiler are you using (MinGW, VisualStudio, GCC, clang, ....) and how to handle in your project file.

    Could you show your .pro file?

  • @koahnig
    Thank you for your reply. I've got the solution to use inline assembly, supported by gcc to do color space conversion, instead of seperated assembly files. The performance is good enough.

  • @mcosta
    You are right, QT just uses the configured compiler in kits. So, in mkspec, I added the new options,

    QMAKE_CFLAGS_RELEASE = -O3 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp
    QMAKE_CXXFLAGS_RELEASE = -O3 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp

    QMAKE_CFLAGS_DEBUG = -O3 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp
    QMAKE_CXXFLAGS_DEBUG = -O3 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp

    in /usr/local/Trolltech/QtEmbedded-4.8.5-arm/mkspecs/qws/linux-arm-g++/qmake.conf.

    And that works for solving my problem.


Log in to reply

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