[oe] Fwd: Cmake + qt4 = linker error

Radek Dostál radek.dostal at streamunlimited.com
Tue Sep 29 15:09:51 UTC 2015


Hi,

I have a very simple (hello world style) program which uses cmake for
compilation and depends on qt4. I am trying to put together bitbake
recipe for this program. See attached.

When compiling it fail with following error:
/tmp/oe-work/sysroots/x86_64-linux/usr/lib/libQtCore.so: file not
recognized: File format not recognized

I suspect it is looking for libraries in native sysroot due to following 
message in log.do_configure: "Found Qt4:
/tmp/oe-work/sysroots/x86_64-linux/usr/bin/qmake2 (found version "4.8.5")"

Obviously it can only find qmake2 binary in the native sysroot and not
in the target sysroot as it does not make any sense to build qmake2 for
target.

I checked meta-openembedded and openembedded-core and could not find any 
  example I could use for inspiration.

1) Is there something I am missing?

2) Is this a known problem?

Thanks,
Radek



-------------- next part --------------
LICENSE = "CLOSED"

inherit cmake

DEPENDS += "qt4-embedded"

SRC_URI = "\
	file://main.cpp \
	file://CMakeLists.txt \
"

S = "${WORKDIR}"
-------------- next part --------------
project(nsdk_toolbox)
cmake_minimum_required(VERSION 2.6)

find_package(Qt4 REQUIRED)

#include(Qt4Macros)

include_directories(${QT_INCLUDES})

set(nsdk_toolbox_SOURCES
	main.cpp
)

set(nsdk_toolbox_HEADERS
)

qt4_wrap_cpp(nsdk_toolbox_MOC ${nsdk_toolbox_HEADERS} OPTIONS -nw)

add_executable(nsdk_toolbox ${nsdk_toolbox_SOURCES} ${nsdk_toolbox_HEADERS} ${nsdk_toolbox_MOC})

target_link_libraries(nsdk_toolbox ${QT_QTCORE_LIBRARY})
install(TARGETS nsdk_toolbox DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)


More information about the Openembedded-devel mailing list