All of lore.kernel.org
 help / color / mirror / Atom feed
* Weird Compilation issue with a c++ recipe
@ 2021-03-24 17:03 arunlee
  0 siblings, 0 replies; 11+ messages in thread
From: arunlee @ 2021-03-24 17:03 UTC (permalink / raw)
  To: poky

[-- Attachment #1: Type: text/plain, Size: 6362 bytes --]

Hi,

I am facing an issue with compiling a recipe which has c++ sources.

The CMakeList.txt is has the following
---------------------------------------------------------------------------------------------------------------------------

# Set minimum required CMake version
cmake_minimum_required(VERSION 3.5.1)

# Name the project Intel RealSense D400 camera server
project (rs-camera-master)

# Integrity
if (${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
MESSAGE( FATAL_ERROR "In-source builds not allowed. Please specify a build directory!")
endif()

SET (EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR})
SET (LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR})

# Enable C++11
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED TRUE)

if(COMPILER_SUPPORTS_CXX11)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
elseif(COMPILER_SUPPORTS_CXX0X)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
endif()

if(MSVC)
if(BUILD_WITH_STATIC_CRT)
set(CMAKE_CXX_FLAGS_RELEASE "/MT")
else()
set(CMAKE_CXX_FLAGS_RELEASE "/MD")
endif()

add_definitions(-D_WIN32)
elseif(ANDROID)
SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pipe -fPIC -pie -llog -pedantic -std=gnu++11 -O2 -W -Wl,--no-undefined -fopenmp -ldl")
else()
EXEC_PROGRAM(uname ARGS -p OUTPUT_VARIABLE CMAKE_SYSTEM_PROCCESSOR)
message(STATUS "CMAKE_SYSTEM_PROCCESSOR=${CMAKE_SYSTEM_PROCCESSOR}")
SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pipe -pedantic -std=gnu++11 -W -Wl,--no-undefined -fopenmp")
endif()

# calibration api include and library paths
set (DCAPI_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/librscalibrationapi/Include)

if(MSVC)
set (DCAPI_LIBS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/librscalibrationapi/lib/windows/x64)
elseif(${CMAKE_SYSTEM_PROCCESSOR} MATCHES "aarch64|AARCH64")
set (DCAPI_LIBS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/librscalibrationapi/lib/linux/aarch64)
else()
set (DCAPI_LIBS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/librscalibrationapi/lib/linux/x86_64)
endif()

INCLUDE_DIRECTORIES(include)

# Add the sources to the target
add_subdirectory(src)

---------------------------------------------------------------------------------------------------------------------------

the bb file is
----------------------------------------------------------------------------------------------------------------------------------------

LICENSE = "Unknown"
LIC_FILES_CHKSUM = "file://License.txt;md5=65a9f55463db06e17a43396aa0c4ed4b"

SRC_URI = "http://myserver.com/temp/rs-oem-kit-server-${PV}.tar.gz"
SRC_URI[md5sum] = "58bee3aff61140b53bc94884b872eab4"
SRC_URI[sha1sum] = "6d4febf4bb32072078c4f67d0e7672a97e6fb5be"
SRC_URI[sha256sum] = "0aa975e73248e20e07aaf124e46fb92292f083f85a043c4b6a1f7dcb538b88a6"
SRC_URI[sha384sum] = "180d259fb3c8bdc79265e9643577e6883d6c85c31bb2df8751af26937c02279e8c85d3fb72ebf053f58894904371377b"
SRC_URI[sha512sum] = "7c808c053103d39a97de6f25519e4733a417d9e61d1dc6ce7cfdb11d16bcedde8341f9f1904eae76188c939f3e7daf35cb0ce7c5f0046474718bd6aa7119ab98"

S = "${WORKDIR}/${BPN}"
CXXFLAGS_append = " -lstdc++"
# NOTE: the following library dependencies are unknown, ignoring: usb
#       (this is based on recipes that have previously been built and packaged)
inherit cmake pkgconfig

# Specify any options you want to pass to cmake using EXTRA_OECMAKE:
EXTRA_OECMAKE = ""

----------------------------------------------------------------------------------------------------------------------------------------

I am getting a compilation error for bitbake rs-oem-kit-server
----------------------------------------------------------------------------------------------------------------------------------------

| [8/34] /home/aravind2/work/mevolve-yocto/mvdevice/build/tmp/work/aarch64-poky-linux/rs-oem-kit-server/1.8.2.0-r0/recipe-sysroot-native/usr/bin/aarch64-poky-linux/aarch64-poky-linux-g++   -I/home/aravind2/work/mevolve-yocto/mvdevice/build/tmp/work/aarch64-poky-linux/rs-oem-kit-server/1.8.2.0-r0/rs-oem-kit-server/include -I/home/aravind2/work/mevolve-yocto/mvdevice/build/tmp/work/aarch64-poky-linux/rs-oem-kit-server/1.8.2.0-r0/rs-oem-kit-server/src/writer/../common -std=gnu++11 -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -fstack-protector-strong -lpthread -fpermissive   -std=gnu++11 -MD -MT src/writer/CMakeFiles/rs-calibration-writer.dir/__/device/d400_dev.cpp.o -MF src/writer/CMakeFiles/rs-calibration-writer.dir/__/device/d400_dev.cpp.o.d -o src/writer/CMakeFiles/rs-calibration-writer.dir/__/device/d400_dev.cpp.o -c /home/aravind2/work/mevolve-yocto/mvdevice/build/tmp/work/aarch64-poky-linux/rs-oem-kit-server/1.8.2.0-r0/rs-oem-kit-server/src/device/d400_dev.cpp
| FAILED: src/writer/CMakeFiles/rs-calibration-writer.dir/__/device/d400_dev.cpp.o
| /home/aravind2/work/mevolve-yocto/mvdevice/build/tmp/work/aarch64-poky-linux/rs-oem-kit-server/1.8.2.0-r0/recipe-sysroot-native/usr/bin/aarch64-poky-linux/aarch64-poky-linux-g++   -I/home/aravind2/work/mevolve-yocto/mvdevice/build/tmp/work/aarch64-poky-linux/rs-oem-kit-server/1.8.2.0-r0/rs-oem-kit-server/include -I/home/aravind2/work/mevolve-yocto/mvdevice/build/tmp/work/aarch64-poky-linux/rs-oem-kit-server/1.8.2.0-r0/rs-oem-kit-server/src/writer/../common -std=gnu++11 -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -fstack-protector-strong -lpthread -fpermissive   -std=gnu++11 -MD -MT src/writer/CMakeFiles/rs-calibration-writer.dir/__/device/d400_dev.cpp.o -MF src/writer/CMakeFiles/rs-calibration-writer.dir/__/device/d400_dev.cpp.o.d -o src/writer/CMakeFiles/rs-calibration-writer.dir/__/device/d400_dev.cpp.o -c /home/aravind2/work/mevolve-yocto/mvdevice/build/tmp/work/aarch64-poky-linux/rs-oem-kit-server/1.8.2.0-r0/rs-oem-kit-server/src/device/d400_dev.cpp
| /home/aravind2/work/mevolve-yocto/mvdevice/build/tmp/work/aarch64-poky-linux/rs-oem-kit-server/1.8.2.0-r0/rs-oem-kit-server/src/device/d400_dev.cpp:15:10: fatal error: iostream: No such file or directory
|    15 | #include <iostream>
|       |          ^~~~~~~~~~
| compilation terminated.

---------------------------------------------------------------------------------------------------------------------------------------

Could you please see what i am doing wrong here?

Host: Ubuntu 18.04
Yocto: poky dunfell, with raspberrypi meta layers

regards
Arun

[-- Attachment #2: Type: text/html, Size: 7317 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2021-03-25 19:39 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <Groupsio.1.pwb1.1616605380917082275.iIyZ@lists.yoctoproject.org>
2021-03-24 18:43 ` [poky] Weird Compilation issue with a c++ recipe Khem Raj
2021-03-24 20:06   ` arunlee
2021-03-24 20:43     ` Arun Ravindran
2021-03-24 21:02       ` [poky] " Khem Raj
2021-03-24 21:08       ` Arun Ravindran
2021-03-25  5:48         ` Arun Ravindran
2021-03-25  6:33           ` [poky] " Khem Raj
2021-03-25 19:39             ` Arun Ravindran
     [not found]   ` <12874.1616616288995699304@lists.yoctoproject.org>
2021-03-24 20:10     ` Private: Re: [poky] " Khem Raj
2021-03-24 20:33       ` arunlee
2021-03-24 17:03 arunlee

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.