<image>.h - 这个 -e 从哪里来?
<image>.h - Where is this -e coming from?
当我尝试构建这个项目时,我得到以下问题:
drazisil@Lightning:~/comical$ make -C src
make: Entering directory '/home/drazisil/comical/src'
Converting firstpage.png
...
make[1]: Entering directory `/home/travis/build/drazisil/comical/src'
`wx-config --cxx` `wx-config --cxxflags` -O2 -Wall -pipe -D_UNIX -I../unrar -I../unzip -c -o ComicalApp.o ComicalApp.cpp
In file included from ComicalFrame.h:43:0,
from ComicalManager.h:32,
from ComicalApp.h:32,
from ComicalApp.cpp:28:
firstpage.h:2:1: error: stray ‘#’ in program
原因似乎是因为在生成的。h文件的开头和结尾都插入了一个-e:
#ifndef _firstpage_png_h
-e #define _firstpage_png_h
static const unsigned char firstpage_png[] = {
...
...
...
-e };
#endif
因为我不确定这个过程的哪个步骤是导致这个,我不确定如何删除它,或者它甚至意味着什么。搜索-e的效果不太好。
ETA: Makefile: https://github.com/drazisil/comical/blob/dev/Makefile
我该如何修复它?
问题是src/Makefile
文件中的这个目标。
%.h : %.png
@echo "Converting" $<
@echo "#ifndef _"$*"_png_h" > $@
@echo -e "#define _"$*"_png_hn" >> $@
@echo "static const unsigned char "$*"_png[] = {" >> $@
@hexdump -e "13/1 "0x%02X, " "n"" $< | sed 's/0x ,//g' >> $@
@echo -e "};nn#endif" >> $@
具体来说,这两行使用echo -e
,试图在回显输出的末尾放置一个额外的换行符。
echo -e
,然而,是非标准的,你的shell/版本的echo
显然不理解它。
如果将这些行重写为
,效果会更好。@printf '#define _$*_png_hnn' >> $@
@printf '};nn#endifn' >> $@
对该目标的其他改进也是可能的,但超出了此问题的范围(主要是使用单个shell命令和单个重定向而不是五个)。
相关文章:
- 请解释这句话(cout<<1+int((a<b)^((b-a)&1) )<<endl
- 呼叫运营商<<临时
- 如何防止clang格式在流运算符调用之间添加换行符<<
- <<操作员在下面的行中工作
- 以线程安全的方式调用"QQuickPaintedItem::updateImage(const QImage&image)"(no QThread)
- Inference pytorch C++ with alexnet and cv::imread image
- 如何在QTextEdit中添加URL或IMAGE-URL
- JNA 将 HICON 转换为 Java Image
- 如何显式调用运算符<<
- 如何在c++中将image.jpg转换为image.ppm
- Magick++ Blob to Image Error
- 将带有零的 Mat 内核填充到 Image 的大小
- 运行"OpenPose C++ API Tutorial - Example 3 - Body from image"失败
- 模板操作员&lt;未打电话
- C / CUDA中的模板方法是3个角括号(&lt;&lt;&lt;)
- C - 创建矢量&lt; vector&lt; double&gt;&gt;矩阵具有分配而不是inizializ
- 错误:调用"std::vector<:vector<int>>::p ush_back(std::vector<std::__cxx11::basic_string<
- magick 对magick :: image :: columns的未定义引用
- 通过QT WebSocket将OpenCV Mat Image发送到HTML客户端
- C 建造者Clang STD :: Sill,找不到超载的操作员&lt;