Intel® Integrated Performance Primitives
Deliberate problems developing high-performance vision, signal, security, and storage applications.

Hello world IPP example using Qt Creator - Link problem!

J_House
Beginner
1,449 Views

Hello-

I am trying to write a very simple 'Hello World' C++ program that makes use of IPP. I am developing on Windows using Qt's Creator IDE.  All my program does for now is call ippInit.  The code is below:

#include <QCoreApplication>
#include "ippcore.h"

int main(int argc, char *argv[])
{
    QCoreApplication a(argc, argv);

    ippInit();

    return a.exec();
}

My project file (.pro) file is also very simple, see below.  BTW, we happen to store our IPP libraries in a 'third party' directory for historical reasons.  Note that I am not making use of any of the path variables defined when you run Intel's install script.  But I'm assuming, perhaps incorrectly, that not having those defines is not what is killing me.

#-------------------------------------------------
#
# Project created by QtCreator 2014-10-08T13:50:59
#
#-------------------------------------------------
QT       += core
QT       -= gui

IntelIPPlibs = -lippac -lippcc -lippch -lippcv -lippdc -lippdi -lippi -lippj -lippm -lippr -lipps -lippsc -lippvc -lippvm -lippcore


#	Set the intel path based upon the platform.
ThirdPartyLibraryPath = ../../../../thirdparty
win32: IntelIPPPath = $${ThirdPartyLibraryPath}/Intel/Windows/ipp
linux: IntelIPPPath = $${ThirdPartyLibraryPath}/Intel/Linux/ipp

win32 {
    DEFINES += WINNT
    LIBS += -L$$IntelIPPPath/lib/intel64 $$IntelIPPlibs
}

unix {
    DEFINES += LINUX
    LIBS += -L$$IntelIPPPath/lib/intel64 $$IntelIPPlibs
}

INCLUDEPATH += $${IntelIPPPath}/include

TARGET = HelloIPP
CONFIG   += console
CONFIG   -= app_bundle

TEMPLATE = app
SOURCES += main.cpp

When I attempt to build, I get the following error:

main.obj : error LNK2019: unresolved external symbol ippInit referenced in function main debug\HelloIPP.exe : fatal error LNK1120: 1 unresolved externals

I am using the MSVS 2012 64 bit compiler.  I suspect the problem MIGHT have to do with how the MSVC compiler is mangling the function names, but I see in ipp.h that it makes use of the "extern "C"" so that does not seem to be the problem.

Any suggestions would be greatly appreciated!  Driving me crazy for the past six hours...

Regards,

Jim

0 Kudos
2 Replies
Pavel_B_Intel1
Employee
1,449 Views

Hi Jim,

ippInit() function is in ippCore domain, you should link the domain: -lippcore.

Please note: you link with IPP dynamic libraries it means that you should include all IPP DLLs in your application package. Why don't you link with static libraries? If you would like link with static libraries you should link with ipp{domain}mt.lib instead of ipp{domain}.lib.

Pavel

0 Kudos
Chao_Y_Intel
Moderator
1,449 Views

Hello,

It looks you are building some "win32" application, but you are linking with 64 bit Intel IPP libraries (lib/intel64)?

win32 {
  DEFINES += WINNT
  LIBS += -L$$IntelIPPPath/lib/intel64
}

Regards,
Chao

0 Kudos
Reply