小编mar*_*eks的帖子

clang:警告:-l*:'链接器'输入未使用

当我使用GNU Make编译代码时,我会收到多个警告:

clang: warning: -lGui: 'linker' input unused
Run Code Online (Sandbox Code Playgroud)

这可能是因为我在Makefile(下面)中弄乱了一些东西.任何人都能指出我的问题吗?

CXX=g++
CC=g++
CXXFLAGS=-g -Wall -W -Wshadow -Wcast-qual -Wwrite-strings $(shell root-config --cflags --glibs)
CPPFLAGS+=-MMD -MP
LDFLAGS=-g $(shell root-config --ldflags)
LDLIBS=$(shell root-config --libs)

xSec_x: xSec_x.o xSec.o Analysis.o
-include xSec_x.d xSec.d Analysis.d

xSec.o: xSec.cpp xSec.h Analysis.h Analysis.cpp

xSec_x.o: xSec_x.cpp xSec.h Analysis.h

clean:
    rm -f @rm -f $(PROGRAMS) *.o *.d
Run Code Online (Sandbox Code Playgroud)

makefile gnu-make

16
推荐指数
2
解决办法
3万
查看次数

使用grep管道错误消息

我有一个失败的脚本,因为缺少一些文件.

运行脚本并将其管道连接到grep

$ ./adder | grep Error
Run Code Online (Sandbox Code Playgroud)

产生以下输出:

Error in <TFile::ReadBuffer>: error reading all requested bytes from file v2.2_V3_194424_194712/output_853.root, got 0 of 300
Error in <TFile::Init>: v2.2_V3_194424_194712/output_853.root not a ROOT file
Run Code Online (Sandbox Code Playgroud)

和不同文件的类似输出

我想v2.2_V3_194424_194712/output_853.root从这个输出中提取根文件,但是做./adder | grep Error | grep .root不起作用.

这是为什么?

grep stderr piping

2
推荐指数
1
解决办法
4141
查看次数

使用shell脚本进行搜索和替换

我需要一个shell脚本来查找和替换类似的文本:

For each line in a file
  find equation mark "="
  remove everything up to the equation mark on that line and replace it with the string cuts[Counter] where Counter counts how many times such substitutions have been made.
Run Code Online (Sandbox Code Playgroud)

开始使用这样的脚本可以帮助我吗?

bash shell awk sed

1
推荐指数
1
解决办法
447
查看次数

标签 统计

awk ×1

bash ×1

gnu-make ×1

grep ×1

makefile ×1

piping ×1

sed ×1

shell ×1

stderr ×1