{Makefile Error}“命令在第一目标之前开始。停止“。 [英] {Makefile Error} "commands commence before first target. Stop."

查看:2063
本文介绍了{Makefile Error}“命令在第一目标之前开始。停止“。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图生成一个makefile用于我的树莓派,打算使用Pi的相机板用opencv检测面孔。但是我面对自己的以下错误:

I'm trying to produce a makefile for use with my Raspberry Pi, the intention is to use the Pi's camera board to detect faces with opencv. However I keep facing myself with the following error:

Makefile:12: *** commands commence before first target.  Stop.

我使用以下makefile:

I use the following makefile:

FLAGS = 'pkg-config --cflags opencv --libs opencv'
CC = g++
HOME = /home/pi
LDFLAGS_CAMCV = -L$(HOME)/git/robidouille/raspicam_cv -lraspicamcv
LDFLAGS_USER =-L$(HOME)/git/raspberrypi/userland/build/lib -lmmal_core -lmmal -$
LDFLAGS_FACE = -l$(HOME)/git/emobot/libfacere0.04
LDFLAGS = $(LDFLAGS_CAMCV) $(LDFLAGS_USER)  $(LDFLAGS_FACE)
INCLUDE = -I$(HOME)/git/robidouille/raspicam_cv
        $(CC) -o emobot_test.exe:  main.cpp $(INCLUDE) $(LDFLAGS)

raspicamcv库需要code> LDFLAGS_CAMCV 和 LDFLAGS_USER ,而 INCLUDE 相关联的头文件。 需要LDFLAGS_FACE 来检测opencv2.3中的面孔,因为2.4目前不受Pi支持。

LDFLAGS_CAMCV and LDFLAGS_USER are required for the raspicamcv library and INCLUDE is the associated header file. LDFLAGS_FACE is needed to detect faces in opencv2.3 as 2.4 is currently unsupported by the Pi.

确定这个错误是令人难以置信的微不足道然而清楚的文档关于makefile是很少和远处之间如果任何人可以提供一个解决方案,我将不胜感激。

I'm certain this error is incredibly trivial however clear documentation about makefiles is few and far between if anyone can provide a solution I would be grateful.

推荐答案

Smth like:

Smth like:


FLAGS = 'pkg-config --cflags opencv --libs opencv'
CC = g++
HOME = /home/pi
LDFLAGS_CAMCV = -L$(HOME)/git/robidouille/raspicam_cv -lraspicamcv
LDFLAGS_USER =-L$(HOME)/git/raspberrypi/userland/build/lib -lmmal_core -lmmal -$
LDFLAGS_FACE = -l$(HOME)/git/emobot/libfacere0.04
LDFLAGS = $(LDFLAGS_CAMCV) $(LDFLAGS_USER)  $(LDFLAGS_FACE)
INCLUDE = -I$(HOME)/git/robidouille/raspicam_cv

all: emobot_test

emobot_test:
tab$(CC) -o emobot_test.exe  main.cpp $(INCLUDE) $(LDFLAGS)

< tab>是一个文字按键,donna如何将其插入答案字段。

说明:

$(CC)-o emobot_test ... 是应在目标调用时执行的命令。

Explanation:
$(CC) -o emobot_test... is a command which should be executed upon a target invocation.

所有是当你只需运行 make 没有参数。

all is the default target which is executed when you simply run make without parameters.

所有取决于 emobot_test target
emobot_test 不依赖于任何目标,但总是运行 $(CC)-o emobot_test ... 完成

all depends on emobot_test target emobot_test doesn't depend on any target but always runs $(CC) -o emobot_test... for completion

这篇关于{Makefile Error}“命令在第一目标之前开始。停止“。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆