Using "libmcc" in Qt project

I’m trying using “libmcc” in a Qt project, but the link-process indicates an error as shown below:
undefined reference to 'mcc_initialize(unsigned int)

I have defined the “libmcc” and path in project file (.pro):
LIBS += -lmcc
LIBS += -L/Development/board/colibri_vf/OpenEmbedded/LinuxImageV2.4/oe-core/build/out-glibc/sysroots/colibri-vf/usr/lib/

I have observed that in the path above, the file “libmcc.la” is missing.

What I need to do to include the “libmcc”?

Thanks in advance!

There should be a static library named libmcc.a, on my build system it has been populated after building the image:

$ find out-glibc/sysroots/ -name libmcc*
out-glibc/sysroots/colibri-vf/usr/lib/libmcc.a
...

The libmcc build file does not use libtool to generate a la file, but in practice an a static library should work too.

Note that link order might lead to the error message too. Make sure that you link the mcc library after the symbol use.

See also this similar inquiry:
https://www.toradex.com/community/questions/1030/how-to-build-linux-mcc-pingpong-example.html

Stefan,

I appreciate your attention. I didn’t understand your note “Make sure that you link the mcc library after the symbol use.”

The lines below are defined in my “.pro” file:

QT += core gui network
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = tca
TEMPLATE = app
QMAKE_CXXFLAGS += -std=c++11

INCLUDEPATH += /home/evandro/Development/board/colibri_vf/OpenEmbedded/LinuxImageV2.4/oe-core/build/out-glibc/sysroots/colibri-vf/usr/include

LIBS += -L/home/evandro/Development/board/colibri_vf/OpenEmbedded/LinuxImageV2.4/oe-core/build/out-glibc/sysroots/colibri-vf/usr/lib/

LIBS += -lmcc -lsqlite3 -lcurl

SOURCES += main.cpp
mainwindow.cpp \

The “libmcc” is populated in the same folder that “libcurl” is. The “libcurl” is working fine, but the “libmcc” is not linked (error: undefined reference to ‘mcc_initialize(unsigned int)’).

evandro@notebook:~/Development/board/colibri_vf/OpenEmbedded/LinuxImageV2.4/oe-core/build/out-glibc/sysroots/colibri-vf/usr/lib$ ls -la libmcc* libcurl*-rw-r–r-- 1 evandro evandro 3931424 Set 10 2015 libcurl.a
-rwxr-xr-x 1 evandro evandro 1029 Set 10 2015 libcurl.la
lrwxrwxrwx 1 evandro evandro 16 Set 10 2015 libcurl.so → libcurl.so.5.3.0
lrwxrwxrwx 1 evandro evandro 16 Set 10 2015 libcurl.so.5 → libcurl.so.5.3.0
-rwxr-xr-x 1 evandro evandro 2068148 Set 10 2015 libcurl.so.5.3.0
-rw-r–r-- 1 evandro evandro 14748 Set 10 2015 libmcc.a
lrwxrwxrwx 1 evandro evandro 11 Set 10 2015 libmcc.so → libmcc.so.1
lrwxrwxrwx 1 evandro evandro 13 Set 10 2015 libmcc.so.1 → libmcc.so.1.0
-rwxr-xr-x 1 evandro evandro 17184 Set 10 2015 libmcc.so.1.0

Do you have any suggestions ?

Another issue, in the V2.6 release notes I found it “- removed support for multi-core communication (MCC)”. What does it mean?

Thanks and advance!

I found out why the problems related above. I was using

#include 

to reference “libmcc files”. Once my app is a “C++ app”, then I changed “mcc_api.h” inclusion declaration as shown below:

extern "C" {
#include 
}

Now, my app is working fine.

Thanks folks!

I am correcting my last post:

I was using "include mcc_api.h " to reference “libmcc functions”. Once … shown below:

extern “C” {
#include mcc_api.h
}

Btw, I forgot about it in the last answer, but we included MCC to our XY Pen Plotter Qt project:

We also use extern “C” to include mcc.h (XYPenPlotter/xypenplottercontroller.cpp at with-libmcc · toradex/XYPenPlotter · GitHub)/