2

I like to figure out how to create a recipe which is downloaded from git and build by using a make file. For example:

the g3logger (git https://github.com/KjellKod/g3log.git)

How must be the recipe "bb" file looks like?

Stefan Jaritz
  • 1,999
  • 7
  • 36
  • 60
  • 1
    Similar question has been already responded in: http://stackoverflow.com/questions/18382407/cmake-with-bitbake-recipe – iksajotien Apr 25 '16 at 13:50
  • 1
    there is still an problem that the g++ compiler does not find the c++ headers. It breaks when cmake tries to compile "#include " – Stefan Jaritz Apr 26 '16 at 07:42

2 Answers2

5

So, this is a problem in g3log (which other programs also likely have). If you open up 'Build.cmake' and look around lines 53-56 you see:

   ELSE()
       set(PLATFORM_LINK_LIBRIES rt)
       set(CMAKE_CXX_FLAGS "-Wall -rdynamic -Wunused -std=c++11 -pthread -D_GLIBCXX_USE_NANOSLEEP -D_GLIBCXX_USE_SCHED_YIELD")
   ENDIF()

Which overrides what OpenEmbedded has placed into toolchain.cmake. If you change this instead to:

       set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -rdynamic -Wunused -std=c++11 -pthread -D_GLIBCXX_USE_NANOSLEEP -D_GLIBCXX_USE_SCHED_YIELD")

it will now inherit the flags that OpenEmbedded wants you to have such as --sysroot= so that standard includes are found.

Tom Rini
  • 2,058
  • 8
  • 11
1

In addition to your comment: Maybe it's an error from your Makefile? For string it should be:

#include <string.h>

or

#include <cstring>

You can also show logs for specific task like do_compile, so we'll have deeper insight.

Tips on debugging tasks in bitbake: Yocto Ref Manual - Debugging build failures

iksajotien
  • 991
  • 18
  • 24
  • I think it's somewhere in my "g3log.bb" file. I give you a listing: ################### SUMMARY = "g3log" SECTION = "sek4" DEPENDS ="boost" SRCREV = "db23383aeaa9704f466422d3cb6ea527c2434290" SRC_URI = "git://github.com/KjellKod/g3log.git" S = "${WORKDIR}/git" inherit pkgconfig cmake LICENSE = "LICENSE" LIC_FILES_CHKSUM = "file://${WORKDIR}/git/LICENSE;md5=7246f848faa4e9c9fc0ea91122d6e680" ################### – Stefan Jaritz Apr 26 '16 at 13:09
  • The recipe doesn't seem to be broken (I can only suggest placing LICENSE variables before the SRCREV and DEPENDS after S). Please show the output from: 'bitbake -c compile -f g3log'. – iksajotien Apr 26 '16 at 13:58
  • ok done! the (shortened)log: arm-poky-linux-gnueabi-g++ -Dg3logger_shared_EXPORTS -Wall -rdynamic -Wunused -std=c++11 -pthread -D_GLIBCXX_USE_NANOSLEEP -D_GLIBCXX_USE_SCHED_YIELD -O2 -pipe -g -feliminate-unused-debug-types -O2 -pipe -g -feliminate-unused-debug-types -fvisibility-inlines-hidden -DNDEBUG -fPIC -I/src -I/example -o CMakeFiles/g3logger_shared.dir/src/logcapture.cpp.o -c /src/logcapture.cpp | In file included from /src/g3log/logmessage.hpp:13:0, | from /src/logmessage.cpp:9: | /src/g3log/loglevels.hpp:25:18: fatal error: string: No such file or directory – Stefan Jaritz Apr 27 '16 at 08:01
  • I deleted the paths. It seems that the include paths of the std. libs are getting lost. Maybe set them manually - do you know how? – Stefan Jaritz Apr 27 '16 at 08:03