* Cmake + qt4 = linker error
[not found] <560AA635.30407@streamunlimited.com>
@ 2015-09-29 15:09 ` Radek Dostál
2015-09-29 17:05 ` Khem Raj
0 siblings, 1 reply; 3+ messages in thread
From: Radek Dostál @ 2015-09-29 15:09 UTC (permalink / raw)
To: openembedded-devel
[-- Attachment #1: Type: text/plain, Size: 904 bytes --]
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
[-- Attachment #2: nsdktoolbox.bb --]
[-- Type: text/plain, Size: 139 bytes --]
LICENSE = "CLOSED"
inherit cmake
DEPENDS += "qt4-embedded"
SRC_URI = "\
file://main.cpp \
file://CMakeLists.txt \
"
S = "${WORKDIR}"
[-- Attachment #3: CMakeLists.txt --]
[-- Type: text/plain, Size: 504 bytes --]
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)
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Cmake + qt4 = linker error
2015-09-29 15:09 ` Cmake + qt4 = linker error Radek Dostál
@ 2015-09-29 17:05 ` Khem Raj
2015-09-30 13:44 ` Radek Dostál
0 siblings, 1 reply; 3+ messages in thread
From: Khem Raj @ 2015-09-29 17:05 UTC (permalink / raw)
To: Martin Jansa
[-- Attachment #1: Type: text/plain, Size: 1348 bytes --]
> On Sep 29, 2015, at 8:09 AM, Radek Dostál <radek.dostal@streamunlimited.com> wrote:
>
> 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?
may be you should inherit qt4e in your recipe as well
>
> Thanks,
> Radek
>
>
>
> <nsdktoolbox.bb><CMakeLists.txt>--
> _______________________________________________
> Openembedded-devel mailing list
> Openembedded-devel@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-devel
[-- Attachment #2: Message signed with OpenPGP using GPGMail --]
[-- Type: application/pgp-signature, Size: 211 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Cmake + qt4 = linker error
2015-09-29 17:05 ` Khem Raj
@ 2015-09-30 13:44 ` Radek Dostál
0 siblings, 0 replies; 3+ messages in thread
From: Radek Dostál @ 2015-09-30 13:44 UTC (permalink / raw)
To: openembedded-devel
Hi Raj,
> may be you should inherit qt4e in your recipe as well
I have tried this as well producing interesting behavior. When using:
1) inherit cmake qt4e
it did not even passed do_configure, as qt4e overwrite configuration
method with the one which used qmake.
2) inherit qt4e cmake
it produced the same behavior as the DEPENDS += "qt4-embedded".
FYI: I have chosen DEPENDS += "qt4-embedded" for example as it looked
slightly more readable, but there is no difference between the two.
Thanks,
Radek
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-09-30 13:44 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <560AA635.30407@streamunlimited.com>
2015-09-29 15:09 ` Cmake + qt4 = linker error Radek Dostál
2015-09-29 17:05 ` Khem Raj
2015-09-30 13:44 ` Radek Dostál
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.