Hi im getting this error when trying to build poco with gcc at cygwin console, it is related with a recipe failed and im not sure how to solved this...
Here is the error code:
$ make
make -C /cygdrive/c/poco-1.4.6p4-all/Foundation
make[1]: Entering directory '/cygdrive/c/poco-1.4.6p4-all/Foundation'
** Compiling src/ArchiveStrategy.cpp (debug, shared)
g++ -Iinclude -I/cygdrive/c/poco-1.4.6p4-all/CppUnit/include -I/cygdrive/c/poco-1.4.6p4-all/Foundation/include -I/cygdrive/c/poco-1.4.6p4-all/XML/include -I/cygdrive/c/poco-1.4.6p4-all/Util/include -I/cygdrive/c/poco-1.4.6p4-all/Net/include -I/cygdrive/c/poco-1.4.6p4-all/Crypto/include -I/cygdrive/c/poco-1.4.6p4-all/NetSSL_OpenSSL/include -I/cygdrive/c/poco-1.4.6p4-all/Data/include -I/cygdrive/c/poco-1.4.6p4-all/Data/SQLite/include -I/cygdrive/c/poco-1.4.6p4-all/Data/ODBC/include -I/cygdrive/c/poco-1.4.6p4-all/Data/MySQL/include -I/cygdrive/c/poco-1.4.6p4-all/Zip/include -I/cygdrive/c/poco-1.4.6p4-all/PageCompiler/include -I/cygdrive/c/poco-1.4.6p4-all/PageCompiler/File2Page/include -DPOCO_NO_FPENVIRONMENT -DPOCO_NO_WSTRING -DPOCO_NO_SHAREDMEMORY -DPOCO_BUILD_HOST=PB00YCT7 -D_XOPEN_SOURCE=500 -g -D_DEBUG -c src/ArchiveStrategy.cpp -o /cygdrive/c/poco-1.4.6p4-all/Foundation/obj/CYGWIN/x86_64/debug_shared/ArchiveStrategy.o
Assembler messages:
Fatal error: can't create /cygdrive/c/poco-1.4.6p4-all/Foundation/obj/CYGWIN/x86_64/debug_shared/ArchiveStrategy.o: No such file or directory
/cygdrive/c/poco-1.4.6p4-all/build/rules/compile:53: recipe for target '/cygdrive/c/poco-1.4.6p4-all/Foundation/obj/CYGWIN/x86_64/debug_shared/ArchiveStrategy.o' failed
make[1]: *** [/cygdrive/c/poco-1.4.6p4-all/Foundation/obj/CYGWIN/x86_64/debug_shared/ArchiveStrategy.o] Error 1
make[1]: Leaving directory '/cygdrive/c/poco-1.4.6p4-all/Foundation'
Makefile:62: recipe for target 'Foundation-libexec' failed
make: *** [Foundation-libexec] Error 2
Here is the bunch of code that is close to the line 53 that is showed as error:
$(OBJPATH_DEBUG_SHARED)/%.o: $(SRCDIR)/%.cpp $(DEPPATH)/%.d
#echo "** Compiling" $< "(debug, shared)"
$(CXX) $(INCLUDE) $(CXXFLAGS) $(DEBUGOPT_CXX) $(SHAREDOPT_CXX) -c $< -o $#
This may be easy to solve but i haven't figure it out in days because im not an expert on c++ and makefiles.
Update: Im still getting the same error, i will add the complete rule definitions file:
# $Id: //poco/1.4/build/rules/compile#1 $
#
# compile
#
# Compile rule definitions for makefiles
#
#
# Targets
#
.PHONY: all all_static all_shared all_debug all_release \
clean static_debug static_release shared_debug shared_release
all: $(DEFAULT_TARGET)
all_static: static_debug static_release
all_shared: shared_debug shared_release
all_debug: static_debug shared_debug
all_release: static_release shared_release
#
# Create directories if necessary
#
.PHONY: objdirs libdirs bindirs static_bindirs
objdirs: $(OBJPATH_RELEASE_STATIC) $(OBJPATH_DEBUG_STATIC) $(OBJPATH_RELEASE_SHARED) $(OBJPATH_DEBUG_SHARED)
libdirs: objdirs $(LIBPATH)
bindirs: objdirs $(BINPATH)
static_bindirs: objdirs $(BINPATH)/static
$(OBJPATH_RELEASE_STATIC) $(OBJPATH_DEBUG_STATIC) $(OBJPATH_RELEASE_SHARED) $(OBJPATH_DEBUG_SHARED) $(LIBPATH) $(BINPATH) $(BINPATH)/static:
$(MKDIR) $#
#
# Rules for compiling
#
$(OBJPATH_DEBUG_STATIC)/%.o: $(SRCDIR)/%.cpp $(DEPPATH)/%.d
#echo "** Compiling" $< "(debug, static)"
$(CXX) $(INCLUDE) $(CXXFLAGS) $(DEBUGOPT_CXX) $(STATICOPT_CXX) -c $< -o $#
$(OBJPATH_RELEASE_STATIC)/%.o: $(SRCDIR)/%.cpp $(DEPPATH)/%.d
#echo "** Compiling" $< "(release, static)"
$(CXX) $(INCLUDE) $(CXXFLAGS) $(RELEASEOPT_CXX) $(STATICOPT_CXX) -c $< -o $#
$(OBJPATH_DEBUG_STATIC)/%.o: $(SRCDIR)/%.c $(DEPPATH)/%.d
#echo "** Compiling" $< "(debug, static)"
$(CC) $(INCLUDE) $(CFLAGS) $(DEBUGOPT_CC) $(STATICOPT_CC) -c $< -o $#
$(OBJPATH_RELEASE_STATIC)/%.o: $(SRCDIR)/%.c $(DEPPATH)/%.d
#echo "** Compiling" $< "(release, static)"
$(CC) $(INCLUDE) $(CFLAGS) $(RELEASEOPT_CC) $(STATICOPT_CC) -c $< -o $#
$(OBJPATH_DEBUG_SHARED)/%.o: $(SRCDIR)/%.cpp $(DEPPATH)/%.d
#echo "** Compiling" $< "(debug, shared)"
$(CXX) $(INCLUDE) $(CXXFLAGS) $(DEBUGOPT_CXX) $(SHAREDOPT_CXX) -c $< -o $#
$(OBJPATH_RELEASE_SHARED)/%.o: $(SRCDIR)/%.cpp $(DEPPATH)/%.d
#echo "** Compiling" $< "(release, shared)"
$(CXX) $(INCLUDE) $(CXXFLAGS) $(RELEASEOPT_CXX) $(SHAREDOPT_CXX) -c $< -o $#
$(OBJPATH_DEBUG_SHARED)/%.o: $(SRCDIR)/%.c $(DEPPATH)/%.d
#echo "** Compiling" $< "(debug, shared)"
$(CC) $(INCLUDE) $(CFLAGS) $(DEBUGOPT_CC) $(SHAREDOPT_CC) -c $< -o $#
$(OBJPATH_RELEASE_SHARED)/%.o: $(SRCDIR)/%.c $(DEPPATH)/%.d
#echo "** Compiling" $< "(release, shared)"
$(CC) $(INCLUDE) $(CFLAGS) $(RELEASEOPT_CC) $(SHAREDOPT_CC) -c $< -o $#
#
# Rules for creating dependency information
#
$(DEPPATH)/%.d: $(SRCDIR)/%.cpp
#echo "** Creating dependency info for" $^
$(MKDIR) $(DEPPATH)
$(DEP) $(SRCDIR)/$(patsubst %.d,%.cpp,$(notdir $#)) $# $(OBJPATH_DEBUG_STATIC) $(OBJPATH_RELEASE_STATIC) $(OBJPATH_DEBUG_SHARED) $(OBJPATH_RELEASE_SHARED) $(INCLUDE) $(CXXFLAGS)
$(DEPPATH)/%.d: $(SRCDIR)/%.c
#echo "** Creating dependency info for" $^
$(MKDIR) $(DEPPATH)
$(DEP) $(SRCDIR)/$(patsubst %.d,%.c,$(notdir $#)) $# $(OBJPATH_DEBUG_STATIC) $(OBJPATH_RELEASE_STATIC) $(OBJPATH_DEBUG_SHARED) $(OBJPATH_RELEASE_SHARED) $(INCLUDE) $(CFLAGS)
depend: $(addprefix $(DEPPATH)/,$(addsuffix .d,$(objects)))
I would say the problem is that the directory doesn't exist. The compiler won't create a directory that doesn't exist. Try modifying your rule to create the directory before invoking the compiler:
$(OBJPATH_DEBUG_SHARED)/%.o: $(SRCDIR)/%.cpp $(DEPPATH)/%.d
#echo "** Compiling" $< "(debug, shared)"
mkdir -p $(dir $#)
$(CXX) $(INCLUDE) $(CXXFLAGS) $(DEBUGOPT_CXX) $(SHAREDOPT_CXX) -c $< -o $#
Related
I know this question has been asked a million times but I can't seem to figure this out.
I'm working with a Makefile written by someone else:
CC=g++
CFLAGS=-Wall -g -gdwarf-3 -std=c++0x -rdynamic #
JEMALLOC=deps/jemalloc-5.1.0
NNMSG=deps/nng-1.3.2
BOOST=deps/boost_1_67_0
CRYPTOPP=deps/crypto
SQLITE=deps/sqlite-autoconf-3290000/build
.SUFFIXES: .o .cpp .h
SRC_DIRS = ./ ./benchmarks/ ./client/ ./transport/ ./system/ ./statistics/ ./blockchain/ ./db/ ./smart_contracts/ ./data_structures
DEPS = -I. -I./benchmarks -I./client/ -I./transport -I./system -I./statistics -I./blockchain -I./smart_contracts -I./data_structures -I$(JEMALLOC)/include -I$(NNMSG)/include -I$(BOOST) -I$(CRYPTOPP) -I./db -I$(SQLITE)/include
CFLAGS += $(DEPS) -D NOGRAPHITE=1 -Werror -Wno-sizeof-pointer-memaccess
LDFLAGS = -Wall -L. -L$(NNMSG)/lib -L$(JEMALLOC)/lib -Wl,-rpath,$(JEMALLOC)/lib -pthread -gdwarf-3 -lrt -std=c++0x -L$(CRYPTOPP) -L$(SQLITE)/lib
LDFLAGS += $(CFLAGS)
LIBS = -lnng -lanl -ljemalloc -lcryptopp -lsqlite3 -ldl
DB_MAINS = ./client/client_main.cpp ./unit_tests/unit_main.cpp
CL_MAINS = ./system/main.cpp ./unit_tests/unit_main.cpp
UNIT_MAINS = ./system/main.cpp ./client/client_main.cpp
CPPS_DB = $(foreach dir,$(SRC_DIRS),$(filter-out $(DB_MAINS), $(wildcard $(dir)*.cpp)))
CPPS_CL = $(foreach dir,$(SRC_DIRS),$(filter-out $(CL_MAINS), $(wildcard $(dir)*.cpp)))
CPPS_UNIT = $(foreach dir,$(SRC_DIRS),$(filter-out $(UNIT_MAINS), $(wildcard $(dir)*.cpp)))
#CPPS = $(wildcard *.cpp)
OBJS_DB = $(addprefix obj/, $(notdir $(CPPS_DB:.cpp=.o)))
OBJS_CL = $(addprefix obj/, $(notdir $(CPPS_CL:.cpp=.o)))
OBJS_UNIT = $(addprefix obj/, $(notdir $(CPPS_UNIT:.cpp=.o)))
#NOGRAPHITE=1
all:rundb runcl
.PHONY: deps_db
deps:$(CPPS_DB)
$(CC) $(CFLAGS) -MM $^ > obj/deps
sed '/^[^ ]/s/^/obj\//g' obj/deps > obj/deps.tmp
mv obj/deps.tmp obj/deps
-include obj/deps
rundb : $(OBJS_DB)
$(CC) -static -o $# $^ $(LDFLAGS) $(LIBS)
./obj/%.o: transport/%.cpp
$(CC) -static -c $(CFLAGS) $(INCLUDE) $(LIBS) -o $# $<
./obj/%.o: benchmarks/%.cpp
$(CC) -c $(CFLAGS) $(INCLUDE) -o $# $<
./obj/%.o: blockchain/%.cpp
$(CC) -c $(CFLAGS) $(INCLUDE) -o $# $<
./obj/%.o: system/%.cpp
$(CC) -c $(CFLAGS) $(INCLUDE) -o $# $<
./obj/%.o: statistics/%.cpp
$(CC) -c $(CFLAGS) $(INCLUDE) -o $# $<
./obj/%.o: client/%.cpp
$(CC) -c $(CFLAGS) $(INCLUDE) -o $# $<
./obj/%.o: %.cpp
$(CC) -c $(CFLAGS) $(INCLUDE) -o $# $<
./obj/%.o: db/%.cpp
$(CC) -c $(CFLAGS) $(INCLUDE) -o $# $<
./obj/%.o: smart_contracts/%.cpp
$(CC) -c $(CFLAGS) $(INCLUDE) -o $# $<
runcl : $(OBJS_CL)
$(CC) -static -o $# $^ $(LDFLAGS) $(LIBS)
./obj/%.o: transport/%.cpp
$(CC) -static -c $(CFLAGS) $(INCLUDE) $(LIBS) -o $# $<
./obj/%.o: benchmarks/%.cpp
$(CC) -c $(CFLAGS) $(INCLUDE) -o $# $<
./obj/%.o: blockchain/%.cpp
$(CC) -c $(CFLAGS) $(INCLUDE) -o $# $<
./obj/%.o: system/%.cpp
$(CC) -c $(CFLAGS) $(INCLUDE) -o $# $<
./obj/%.o: statistics/%.cpp
$(CC) -c $(CFLAGS) $(INCLUDE) -o $# $<
./obj/%.o: client/%.cpp
$(CC) -c $(CFLAGS) $(INCLUDE) -o $# $<
./obj/%.o: %.cpp
$(CC) -c $(CFLAGS) $(INCLUDE) -o $# $<
.PHONY: clean
clean:
rm -f obj/*.o obj/.depend rundb runcl runsq unit_test
What I'm attempting to do is place a header only library crow_all.h into a my file system/client_thread.cpp. Its worth noting that the crow library has this path /deps/crow_all.h.
I've tried appending -lpthread -L$(BOOST)/libs -lboost_system the LDFLAGS flag but I still manage to get this error:
/mnt/d/programs/ExpoLab/ResilientDB/deps/boost_1_67_0/boost/asio/error.hpp:230: undefined reference to `boost::system::system_category()'
Furthermore, I think my compiler is picking up my system version of the boost library?? I only say that since when I use Make when inside a docker container, I get a different error:
/usr/bin/ld: cannot find -lboost_system
Any advice would be amazing.. this is pretty frustrating :(
I'm trying to keep the implicit rules of make, while having a substitution of the source path such as $(SRC:%=$(SRCDIR)/%) or by inserting a pipe function such as $(addprefix $SRCDIR/,$SRC).
How should I do that ?
Source files (*cpp *c) are in src/.
SRCDIR = src
HDRDIR = src/include
DDIR = src/d
.SUFFIXES = .o .cpp .c
.cpp.o:
g++ -c $(CCFLAGS) $<
.c.o:
gcc -c $(CFLAGS) $<
%.d: %.cpp
set -e; $(CC) -MM $(CPPFLAGS) $< \
| sed 's/\($*\)\.o[ :]*/\1.o $# : /g' > $#; [ -s $# ] || rm -f $#
%.d: %.c
set -e; gcc -MM $(CPPFLAGS) $< \
| sed 's/\($*\)\.o[ :]*/\1.o $# : /g' > $#; [ -s $# ] || rm -f $#
TESTHNF_CPP_SRCS = testhnf.cpp timings.cpp LongModular.cpp VeryLong.cpp VeryLongModular.cpp squfof.cpp
C_SRCS = mt19937int.c lip.c
include $(TESTHNF_CPP_SRCS:%.cpp=$(DDIR)/%.d)
include $(C__SRCS:%.c=$(DDIR)/%.d)
TESTHNF_OBJS = $(TESTHNF_CPP_SRCS:%.cpp=$(OBJDIR)/%.o) $(C_SRCS:%.c=$(OBJDIR)/%.o)
testhnf: $(TARGETDIR) $(TARGETDIR)/testhnf
$(TARGETDIR)/testhnf: $(TESTHNF_OBJS)
$(CC) $(CCFLAGS) -o $(TARGETDIR)/testhnf $(TESTHNF_OBJS) $(LIBS)
cleantesthnf:
rm -rf $(TARGETDIR)/testhnf $(TESTHNF_OBJS)
I am working on IMX7(Phytec zeta board) with yocto linux. On already working helloworld recipe(named as imx7-2110) I added some application source files(C, C++, h, hpp), created a make file and edited .bb files accordingly. on compilation I am getting error that one of the .hpp file(PktDriverAbstractionLayer.hpp) is not found, although it present in source directory and corresponding path is given to .bb file.
What could be the reason? I tried some suggestion available on internet forums but it didn't help.
Details of error are here:
[root#localhost build]# bitbake imx7-2110
Loading cache: 100% |###########################################| ETA:
00:00:00
Loaded 2800 entries from dependency cache.
Parsing recipes: 100% |#########################################| Time:
00:00:00
Parsing of 2223 .bb files complete (2222 cached, 1 parsed). 2799 targets,
220 skipped, 5 masked, 0 errors.
WARNING: No bb files matched BBFILE_PATTERN_phytec '^/opt/PHYTEC_BSPs
/yocto_imx7/sources/meta-phytec/common/'
NOTE: Resolving any missing task queue dependencies
Build Configuration:
BB_VERSION = "1.30.0"
BUILD_SYS = "x86_64-linux"
NATIVELSBSTRING = "CentOSLinux-7.4.1708"
TARGET_SYS = "arm-poky-linux-gnueabi"
MACHINE = "imx7d-phyboard-zeta-001"
DISTRO = "fsl-imx-x11"
DISTRO_VERSION = "4.1.15-2.0.1"
TUNE_FEATURES = "arm armv7ve vfp neon callconvention-hard
cortexa7"
TARGET_FPU = "hard"
meta
meta-yocto = "HEAD:f5da2a5913319ad6ac2141438ba1aa17576326ab"
meta-oe
meta-multimedia = "HEAD:247b1267bbe95719cd4877d2d3cfbaf2a2f4865a"
meta-fsl-arm = "HEAD:be78894e4682f111575470fb23e51e6ba523508d"
meta-fsl-arm-extra = "HEAD:3dfb82fc7e703eae9891b3ffda0e9393701f2396"
meta-fsl-demos = "HEAD:a165068f8a0d1cf29aabe4b4053f28be1c2aa492"
meta-bsp
meta-sdk = "HEAD:90399d99af8a2660ebe50b49752e95b210239fd9"
meta-browser = "HEAD:77736988073a5d90fcff9d0005c8477332ede387"
meta-gnome
meta-networking
meta-python
meta-filesystems = "HEAD:247b1267bbe95719cd4877d2d3cfbaf2a2f4865a"
meta-qt5 = "HEAD:ccae79be69c5268df3b47e4e14cea0591c39a531"
meta-phytec
meta-phytec-fsl = "HEAD:0b1de01225a2ec0debf71eb13be403baa9f4919f"
meta-imx7-2110 = "<unknown>:<unknown>"
NOTE: Preparing RunQueue
NOTE: Executing SetScene Tasks
NOTE: Executing RunQueue Tasks
ERROR: imx7-2110-0.1-r0 do_compile: Function failed: do_compile (log file
is located at /opt/PHYTEC_BSPs/yocto_imx7/build/tmp/work/cortexa7hf-
neon-poky-linux-gnueabi/imx7-2110/0.1-r0/temp/log.do_compile.7235)
ERROR: Logfile of failure stored in: /opt/PHYTEC_BSPs/yocto_imx7/build
/tmp/work/cortexa7hf-neon-poky-linux-gnueabi/imx7-2110/0.1-r0
/temp/log.do_compile.7235
Log data follows:
| DEBUG: Executing shell function do_compile
| arm-poky-linux-gnueabi-g++ -march=armv7ve -mfpu=neon -mfloat-abi=hard
-mcpu=cortex-a7 --sysroot=/opt/PHYTEC_BSPs/yocto_imx7/build/tmp/sysroots
/imx7d-phyboard-zeta-001 -c -pthread -std=c++11 -O2 -pipe -g
-feliminate-unused-debug-types -fdebug-prefix-map=/opt/PHYTEC_BSPs
/yocto_imx7/build/tmp/work/cortexa7hf-neon-poky-linux-gnueabi/imx7-2110
/0.1-r0=/usr/src/debug/imx7-2110/0.1-r0 -fdebug-prefix-map=/opt
/PHYTEC_BSPs/yocto_imx7/build/tmp/sysroots/x86_64-linux= -fdebug-prefix-
map=/opt/PHYTEC_BSPs/yocto_imx7/build/tmp/sysroots/imx7d-phyboard-
zeta-001= -fvisibility-inlines-hidden -g -c -Wall -Wextra -pthread
-std=c++0x pcieman_client.cpp -o pcieman_client.o
| In file included from pcieman_client.cpp:45:0:
| PktDriverUDPManager.hpp:18:41: fatal error:
PktDriverAbstractionLayer.hpp: No such file or directory
| compilation terminated.
| make: *** [pcieman_client.o] Error 1
| WARNING: /opt/PHYTEC_BSPs/yocto_imx7/build/tmp/work/cortexa7hf-
neon-poky-linux-gnueabi/imx7-2110/0.1-r0/temp/run.do_compile.7235:1 exit 2
from 'make'
| ERROR: Function failed: do_compile (log file is located at
/opt/PHYTEC_BSPs/yocto_imx7/build/tmp/work/cortexa7hf-neon-poky-linux-
gnueabi/imx7-2110/0.1-r0/temp/log.do_compile.7235)
ERROR: Task 6 (/opt/PHYTEC_BSPs/yocto_imx7/sources/meta-imx7-2110/recipes-
example/example/imx7-2110_0.1.bb, do_compile) failed with exit code '1'
NOTE: Tasks Summary: Attempted 351 tasks of which 346 didn't need to be
rerun and 1 failed.
No currently running tasks (351 of 358)
Summary: 1 task failed:
/opt/PHYTEC_BSPs/yocto_imx7/sources/meta-imx7-2110/recipes-example
/example/imx7-2110_0.1.bb, do_compile
Summary: There was 1 WARNING message shown.
Summary: There was 1 ERROR message shown, returning a non-zero exit code.
[root#localhost build]#
Update with recipe:
#
# This file was derived from the 'Hello World!' example recipe in the
# Yocto Project Development Manual.
#
SUMMARY = "Simple helloworld application"
SECTION = "examples"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}
/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
SRC_URI = "file://build/build.tar.gz \
file://src/src.tar.gz \
file://include/include.tar.gz \
file://xpcie.h \
"
S = "${WORKDIR}"
#EXTRA_OEMAKE += "CPPFLAGS='-c -pthread -std=c++11'"
#EXTRA_OEMAKE += "CXXFLAGS='-g -c -Wall -Wextra -pthread -std=c++0x'"
do_compile() {
make
}
do_install() {
install -d ${D}${bindir}
install -m 0755 pcieman_client ${D}${bindir}
}
Here is also make with supplementary Info:
# Define Compiler to use
CC=g++
# Define default compiler options
# Flags passed to the preprocessor.
CPPFLAGS=-c -pthread -std=c++11
CXXFLAGS += -g -c -Wall -Wextra -pthread -std=c++0x
LFLAGS=-Bsymbolic
all: pcieman_client
pcieman_client: pcieman_client.o parser.o udp_socket_class.o
ds_api_class.o syn1588_class.o tr03_class.o pio_class.o search_api_class.o
packet_proc_class.o socket_tools.o crc_calc.o stdafx.o transaction_class.o
lpq_api_class.o fileIn_class.o vip_Rx_udp.o vip_Tx_udp.o
PktDriverAbstractionLayer.o PktDriverUDPManager.o StateMachine.o
MessageEvent.o appl_menu.o
$(CC) $(LFLAGS) -lpthread pcieman_client.o parser.o udp_socket_class.o
ds_api_class.o syn1588_class.o tr03_class.o pio_class.o search_api_class.o
packet_proc_class.o socket_tools.o crc_calc.o stdafx.o transaction_class.o
lpq_api_class.o fileIn_class.o vip_Rx_udp.o vip_Tx_udp.o
PktDriverAbstractionLayer.o PktDriverUDPManager.o StateMachine.o
appl_menu.o MessageEvent.o -o pcieman_client
pcieman_client.o: version.h udp_socket_class.h socket_tools.h
packet_proc_class.h transaction_class.h parser_params.h parser.h
pcieman_client.cpp
$(CXX) $(CPPFLAGS) $(CXXFLAGS) pcieman_client.cpp -o pcieman_client.o
udp_socket_class.o: udp_socket_class.h udp_socket_class.cpp
$(CC) $(CPPFLAGS) udp_socket_class.cpp -o udp_socket_class.o
appl_menu.o: appl_menu.hpp appl_menu.cpp
$(CXX) $(CPPFLAGS) $(CXXFLAGS) appl_menu.cpp -o appl_menu.o
ds_api_class.o: ds_api_class.h ds_api_class.cpp
$(CC) $(CPPFLAGS) ds_api_class.cpp -o ds_api_class.o
search_api_class.o: crc_calc.h search_api_class.h search_api_class.cpp
$(CC) $(CPPFLAGS) search_api_class.cpp -o search_api_class.o
pio_class.o: crc_calc.h pio_class.h pio_class.cpp
$(CC) $(CPPFLAGS) pio_class.cpp -o pio_class.o
syn1588_class.o: RxTx_settings.h syn1588_class.h syn1588_class.cpp
$(CC) $(CPPFLAGS) syn1588_class.cpp -o syn1588_class.o
tr03_class.o: RxTx_settings.h tr03_class.h tr03_class.cpp
$(CC) $(CPPFLAGS) tr03_class.cpp -o tr03_class.o
packet_proc_class.o: packet_proc_class.h packet_proc_class.cpp
$(CC) $(CPPFLAGS) packet_proc_class.cpp -o packet_proc_class.o
socket_tools.o: socket_tools.h socket_tools.cpp
$(CC) $(CPPFLAGS) socket_tools.cpp -o socket_tools.o
crc_calc.o: crc_calc.h crc_calc.cpp
$(CC) $(CPPFLAGS) crc_calc.cpp -o crc_calc.o
stdafx.o: stdafx.h stdafx.cpp
$(CC) $(CPPFLAGS) stdafx.cpp -o stdafx.o
transaction_class.o: packet_proc_class.h transaction_class.h
transaction_class.cpp
$(CC) $(CPPFLAGS) transaction_class.cpp -o transaction_class.o
lpq_api_class.o: lpq_api_class.h lpq_api_class.cpp
$(CXX) $(CPPFLAGS) $(CXXFLAGS) lpq_api_class.cpp -o lpq_api_class.o
fileIn_class.o: fileIn_class.h fileIn_class.cpp
$(CC) $(CPPFLAGS) fileIn_class.cpp -o fileIn_class.o
vip_Rx_udp.o: vip_Rx_settings.h RxTx_settings.h ds_api_class.h
syn1588_class.h tr03_class.h pio_class.h lpq_api_class.h
search_api_class.h PktDriverUDPManager.hpp vip_Rx_udp.cpp
$(CXX) $(CPPFLAGS) $(CXXFLAGS) vip_Rx_udp.cpp -o vip_Rx_udp.o
vip_Tx_udp.o: vip_Tx_settings.h RxTx_settings.h PktDriverUDPManager.hpp
vip_Tx_udp.cpp
$(CXX) $(CPPFLAGS) $(CXXFLAGS)vip_Tx_udp.cpp -o vip_Tx_udp.o
parser.o: parser_params.h parser.h parser.cpp
$(CXX) $(CPPFLAGS) $(CXXFLAGS) parser.cpp -o parser.o
IGMPTimerManager.o: IGMPTimerManager.hpp IGMPTimerManager.cpp
$(CXX) $(CPPFLAGS) $(CXXFLAGS) IGMPTimerManager.cpp -o IGMPTimerManager.o
IGMPManager.o: IGMPManager.hpp IGMPManager.cpp
$(CXX) $(CPPFLAGS) $(CXXFLAGS) IGMPManager.cpp -o IGMPManager.o
IGMPNetworkManager.o: IGMPNetworkManager.hpp IGMPNetworkManager.cpp
$(CXX) $(CPPFLAGS) $(CXXFLAGS) IGMPNetworkManager.cpp -o
IGMPNetworkManager.o
IGMPHostEvent.o: IGMPHostEvent.hpp IGMPHostEvent.cpp
$(CXX) $(CPPFLAGS) $(CXXFLAGS) IGMPHostEvent.cpp -o IGMPHostEvent.o
IGMPMulticastHost.o: IGMPMulticastHost.hpp IGMPStateMachine.hpp
IGMPMulticastHost.cpp
$(CXX) $(CPPFLAGS) $(CXXFLAGS) IGMPMulticastHost.cpp -o
IGMPMulticastHost.o
StateMachine.o: StateMachine.hpp StateMachine.cpp
$(CXX) $(CPPFLAGS) $(CXXFLAGS) StateMachine.cpp -o StateMachine.o
MessageEvent.o: MessageEvent.hpp MessageEvent.cpp
$(CXX) $(CPPFLAGS) $(CXXFLAGS) MessageEvent.cpp -o MessageEvent.o
IGMPV2StateMachine.o: IGMPStateMachine.hpp IGMPV2StateMachine.cpp
$(CXX) $(CPPFLAGS) $(CXXFLAGS) IGMPV2StateMachine.cpp -o
IGMPV2StateMachine.o
IGMPV3StateMachine.o: IGMPStateMachine.hpp IGMPV3StateMachine.cpp
$(CXX) $(CPPFLAGS) $(CXXFLAGS) IGMPV3StateMachine.cpp -o
IGMPV3StateMachine.o
IGMPStateMachine.o: IGMPStateMachine.hpp IGMPStateMachine.cpp
$(CXX) $(CPPFLAGS) $(CXXFLAGS) IGMPStateMachine.cpp -o IGMPStateMachine.o
PktDriverAbstractionLayer.o: PktDriverAbstractionLayer.hpp
PktDriverAbstractionLayer.cpp
$(CXX) $(CPPFLAGS) $(CXXFLAGS) PktDriverAbstractionLayer.cpp -o
PktDriverAbstractionLayer.o
PktDriverUDPManager.o: PktDriverUDPManager.hpp PktDriverUDPManager.cpp
$(CXX) $(CPPFLAGS) $(CXXFLAGS) PktDriverUDPManager.cpp -o
PktDriverUDPManager.o
clean:
rm -rf *.o pcieman_client
configuration file local.conf is here:
MACHINE ??= 'imx7d-phyboard-zeta-001'
DISTRO ?= 'fsl-imx-x11'
PACKAGE_CLASSES ?= "package_rpm"
EXTRA_IMAGE_FEATURES = "debug-tweaks"
IMAGE_INSTALL_append=" xyzlayer"
IMAGE_INSTALL +="boost"
USER_CLASSES ?= "buildstats image-mklibs phytec-mirrors"
PATCHRESOLVE = "noop"
BB_DISKMON_DIRS = "\
STOPTASKS,${TMPDIR},1G,100K \
STOPTASKS,${DL_DIR},1G,100K \
STOPTASKS,${SSTATE_DIR},1G,100K \
STOPTASKS,/tmp,100M,100K \
ABORT,${TMPDIR},100M,1K \
ABORT,${DL_DIR},100M,1K \
ABORT,${SSTATE_DIR},100M,1K \
ABORT,/tmp,10M,1K"
PACKAGECONFIG_append_pn-qemu-native = " sdl"
PACKAGECONFIG_append_pn-nativesdk-qemu = " sdl"
ASSUME_PROVIDED += "libsdl-native"
CONF_VERSION = "1"
BB_NUMBER_THREADS = "8"
PARALLEL_MAKE = "-j 4"
DL_DIR ?= "/opt/PHYTEC_BSPs/yocto_dl"
ACCEPT_FSL_EULA = "1"
bblayer file bblayers.conf is here:
# LAYER_CONF_VERSION is increased each time build/conf/bblayers.conf
# changes incompatibly
POKY_BBLAYERS_CONF_VERSION = "2"
BBPATH = "${TOPDIR}"
BSPDIR := "${#os.path.abspath(os.path.dirname(d.getVar('FILE', True)) +
'/../..')}"
BBFILES ?= ""
BBLAYERS = " \
${BSPDIR}/sources/poky/meta \
${BSPDIR}/sources/poky/meta-poky \
\
${BSPDIR}/sources/meta-openembedded/meta-oe \
${BSPDIR}/sources/meta-openembedded/meta-multimedia \
\
${BSPDIR}/sources/meta-fsl-arm \
${BSPDIR}/sources/meta-fsl-arm-extra \
${BSPDIR}/sources/meta-fsl-demos \
${BSPDIR}/sources/meta-fsl-bsp-release/imx/meta-bsp \
${BSPDIR}/sources/meta-fsl-bsp-release/imx/meta-sdk \
\
${BSPDIR}/sources/meta-browser \
${BSPDIR}/sources/meta-openembedded/meta-gnome \
${BSPDIR}/sources/meta-openembedded/meta-networking \
${BSPDIR}/sources/meta-openembedded/meta-python \
${BSPDIR}/sources/meta-openembedded/meta-filesystems \
${BSPDIR}/sources/meta-qt5 \
\
${BSPDIR}/sources/meta-phytec \
${BSPDIR}/sources/meta-phytec/meta-phytec-fsl \
${BSPDIR}/sources/meta-xyzlayer \
${BSPDIR}/sources/meta-testlayer \
"
What I see missing in the arm-poky-linux-gnueabi-g++ command line is the "-I" option for include path. Since the bitbake environment variables override the Makefile variables, it maybe required to explicitly specify the include paths using the following (in your recipe file before the do_compile() task):
TARGET_CFLAGS += " -I${S}"
Assuming that the header files are in the same folder as the source files.
1. My file structure is:
build/
include/
-Sort.h
src/
-Sort.cpp
-main.cpp
2. My Makefile:
C++ = g++
SRCPATH := ./src
BUILDPATH := ./build
SORTINCPATH := ./include
TARGET := $(BUILDPATH)/sort
CPPFLAGS := -c -g -Wall -O0
INCPATH := -I./ -I$(SORTINCPATH)
CPPFILES += $(wildcard $(SRCPATH)/*.cpp)
CFILES += $(wildcard $(SRCPATH)/*.c)
HEADFILES += $(wildcard $(SORTINCPATH)/*.h)
CPPOBJS += $(CPPFILES:.cpp=.o)
COBJS += $(CFILES:.c=.o)
.PHONY : all
all: $(TARGET)
$(TARGET): $(CPPOBJS) $(COBJS)
$(C++) $(CPPFLAGS) -o $# $(CPPOBJS) $(COBJS)
%.o : %.c $(HEADFILES)
$(C++) $(CPPFLAGS) $(INCPATH) $< -o $#
%.O : %.cpp $(HEADFILES)
$(C++) $(CPPFLAGS) $(INCPATH) $< -o $#
.PHONY : clean
clean:
-rm $(TARGET) $(COBJS) $(CPPOBJS)
3. Sort.h
sort.h
4. Sort.cpp
sort-1.cpp
sort-2.cpp
5. When I run make, it shows the following:
g++ -c -g -Wall -O0 -c -o src/Sort.o src/Sort.cpp
and says "src/Sort.cpp:3:18: fatal error: Sort.h: no such file or directory".
I hope you can help me find out where the problem is.
Thank you so much!
I am currently trying to build Face Tracker (by Jason Saragih) with "make" in my Windows 7 x64, but all I'm getting is: "No rule to make target src/lib/IO.o, needed by bin/face_tracker".
Does anyone have any idea of what is happening, please?
This is the makefile (also available in Jason Saragih's page):
# Paths
OPENCV_PATH=/OpenCV246/
# Programs
CC=
CXX=g++
# Flags
ARCH_FLAGS=-arch x86_64
CFLAGS=-Wextra -Wall -pedantic-errors $(ARCH_FLAGS) -O3
LDFLAGS=$(ARCH_FLAGS)
DEFINES=
INCLUDES=-I$(OPENCV_PATH)/include -Iinclude/
LIBRARIES=-L$(OPENCV_PATH)/lib -lopencv_core -lopencv_highgui -lopencv_imgproc -lopencv_objdetect
# Files which require compiling
SOURCE_FILES=\
src/lib/IO.cc\
src/lib/PDM.cc\
src/lib/Patch.cc\
src/lib/CLM.cc\
src/lib/FDet.cc\
src/lib/PAW.cc\
src/lib/FCheck.cc\
src/lib/Tracker.cc
# Source files which contain a int main(..) function
SOURCE_FILES_WITH_MAIN=src/exe/face_tracker.cc
# End Configuration
SOURCE_OBJECTS=$(patsubst %.cc,%.o,$(SOURCE_FILES))
ALL_OBJECTS=\
$(SOURCE_OBJECTS) \
$(patsubst %.cc,%.o,$(SOURCE_FILES_WITH_MAIN))
DEPENDENCY_FILES=\
$(patsubst %.o,%.d,$(ALL_OBJECTS))
all: bin/face_tracker
%.o: %.cc Makefile
## Make dependecy file
$(CXX) -MM -MT $# -MF $(patsubst %.cc,%.d,$<) $(CFLAGS) $(DEFINES) $(INCLUDES) $<
## Compile
$(CXX) $(CFLAGS) $(DEFINES) $(INCLUDES) -c -o $# $<
-include $(DEPENDENCY_FILES)
bin/face_tracker: $(ALL_OBJECTS)
$(CXX) $(LDFLAGS) $(LIBRARIES) -o $# $(ALL_OBJECTS)
.PHONY: clean
clean:
#echo "Cleaning"
#for pattern in '*~' '*.o' '*.d' ; do \
find . -name "$$pattern" | xargs rm ; \
done
Thanks,
Fabio