先自我介绍一下,小编浙江大学毕业,去过华为、字节跳动等大厂,目前阿里P7
深知大多数程序员,想要提升技能,往往是自己摸索成长,但自己不成体系的自学效果低效又漫长,而且极易碰到天花板技术停滞不前!
因此收集整理了一份《2024年最新Golang全套学习资料》,初衷也很简单,就是希望能够帮助到想自学提升又不知道该从何学起的朋友。
既有适合小白学习的零基础资料,也有适合3年以上经验的小伙伴深入学习提升的进阶课程,涵盖了95%以上Go语言开发知识点,真正体系化!
由于文件比较多,这里只是将部分目录截图出来,全套包含大厂面经、学习笔记、源码讲义、实战项目、大纲路线、讲解视频,并且后续会持续更新
如果你需要这些资料,可以添加V获取:vip1024b (备注go)
正文
3. 使用visual studio来编译项目
创建一个空项目
把文件都添加进去,如下图所示
点击调试->开始执行(不调试)
结果如下图所示
和前面的结果是一样的。
上面用了在Windows上常见的几种编译C语言项目的方法,可以发现用gcc和Makefile来编译项目是最灵活的,但是有一些使用门槛。而使用编译器可以更加方便快捷的来编译项目。两种方法各有优劣,大家则需选择,建议两种方法都要会用。
此外上面我们演示的是编译生成可执行文件的例子,但很多时候,我们的项目只需要编译打包成库文件提供给别人使用,因此我们要生成的就不是可执行文件,而是库文件。
那么库文件又是什么呢?
上面使用Makefile编译的时候,编译生成可执行文件其实是分成了两步。
第一步将每一个.c文件及其包含的.h文件编译生成.o文件(也叫目标文件)。
然后将所有的.o文件链接起来生成可执行文件。
将一个或多个目标文件打包起来就是库文件(目标文件的仓库)。
库文件也分为静态库和动态库,具体区别可自己查询。
4. 下面演示一下用gcc命令行来生成静态库和动态库。
在我们之前项目的基础上,假如我么要增加一个乘法功能,我们想使用一个乘法开源库。(实际上我们是可以直接用乘法的,这边知识为了演示的方便所以选择了一个简单的开源库,方便说清楚)
这个乘法开源库只有两个文件(一般开源库是不会这么简单的,这里我们是为了演示的方便)
-----mult.c
-----mult.h
文件内容为:
mult.c
#include <stdio.h>
#include “data.h”
#include “mult.h”
int mult(int a, int b) {
printf(“do mult\n”);
return a*b;
}
mult.h
#ifndef _MULT_H
#define _MULT_H
int mult(int a, int b);
#endif
下面我们要尝试将这个演示用的开源库(mult.c mult.h)编译成静态库和动态库文件。
使用gcc编译开源库成库文件同样可以使用Makefile,但因为这边源文件较少,我们就直接用gcc命令行来编译该开源库。
生成静态库:
命令行中依次输入
gcc -c mult.c //会生成mult.o文件
ar rcs libmult.a mult.o //将mult.o打包成libmult.a静态库文件
生成动态库:
命令行中依次输入
gcc -fpic -shared mult.c -o dllmult.so //生成dllmult.so动态库文件
静态库和动态库文件的使用
在编译好静态库或者动态库之后,我们只需要将库文件加头文件给需要使用这个开源库的项目就可以,那么我们之前的项目要怎么使用这个演示用的开源库呢?
静态库文件的使用
当我们把libmult.a和mult.h文件拿到之后,我们通过mult.h文件可以知道这个库向外提供的接口(函数),我们发现正好有我们需要的乘法功能,接口为int mult(int a, int b);
我们修改main.c文件成下图所示
#include <stdio.h>
#include “add.h”
#include “sub.h”
#include “data.h”
#include “mult.h”
extern int i;
extern int j;
int main(){
printf(“i + j = %d\n”,add(i,j));
printf(“i - j = %d\n”,sub(i,j));
printf(“i * j = %d\n”,mult(i,j));//增加该行
return 0;
}
要使用静态库,直接把libmult.a加入链接即可。
命令行中输入
gcc -c main.c add.c sub.c //生成main.o add.o sub.o目标文件
gcc main.o add.o sub.o libmult.a -o a.exe//将上面生成的目标文件和静态库链接起来,生成可执行文件
./a.exe //执行可执行文件,输出结果如下所示
do add
i + j = 3
do sub
i - j = -1
do mult
i * j = 2
动态库文件的使用
命令行中输入
gcc main.o add.o sub.o dllmult.so -o a.exe
./a.exe //输出结果如下所示
do add
i + j = 3
do sub
i - j = -1
do mult
i * j = 2
5. 顺便我们来用DEVC++和VisualStudio来演示一下如何生成库文件。
DEVC++生成静态库
新建项目,可以看到存在static library和DLL选项,分别对应静态库和动态库。
将开源库文件mult.c和mult.h加入到项目中
点击编译一下,就可以在项目目录下发现.a静态库文件啦。
此外我们还可以看看编译静态库文件的Makefile文件是怎样的,如下图
Project: 项目3
Makefile created by Dev-C++ 5.11
CPP = g++.exe
CC = gcc.exe
WINDRES = windres.exe
OBJ = mult.o
LINKOBJ = mult.o
LIBS = -L"D:/Dev-Cpp/MinGW64/lib" -L"D:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/lib" -static-libgcc
INCS = -I"D:/Dev-Cpp/MinGW64/include" -I"D:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include" -I"D:/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/4.9.2/include"
CXXINCS = -I"D:/Dev-Cpp/MinGW64/include" -I"D:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include" -I"D:/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/4.9.2/include" -I"D:/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/4.9.2/include/c++"
BIN = 项目3.a
CXXFLAGS = $(CXXINCS)
CFLAGS = $(INCS)
RM = rm.exe -f
.PHONY: all all-before all-after clean clean-custom
all: all-before $(BIN) all-after
clean: clean-custom
${RM} $(OBJ) $(BIN)
$(BIN): $(LINKOBJ)
ar r $(BIN) $(LINKOBJ)
ranlib $(BIN)
mult.o: mult.c
$(CPP) -c mult.c -o mult.o $(CXXFLAGS)
DEVC++使用静态库
6. VisualStudio创建静态库和VisualStudio使用静态库
这方面的内容我就不直接演示了,直接分享写的比较好的博客吧。
在自己的项目中调用别人的库的方法(static lib库,dynamic lib库以及dll动态库)
3. 找几个开源库来实战演练一下
优秀的C语言开源库有不少,因此这篇文章我也会一直更新,每次遇到有意思的C语言开源库的编译使用都会放在这里。
1. zlog的编译使用
项目GitHub地址:zlog
中文手册:手册
zlog在Windows上的移植:WinZlog
将zlog的源码下载下来,打开,可以看到目录结果如下图所示
一般来说,对于一个C语言项目,最重要的就是其源码和编译规则。
对应到上面目录中的文件就是src目录和makefiel,src目录中就是源代码文件,makefile就是编译规则,我们只需要根据makefile就可以编译出我们想要的库文件。
下面是该开源库带的makefile:
zlog makefile
Copyright © 2010-2012 Hardy Simpson HardySimpson1984@gmail.com
This file is released under the LGPL 2.1 license, see the COPYING file
OBJ=
buf.o
category.o
category_table.o
conf.o
event.o
format.o
level.o
level_list.o
mdc.o
record.o
record_table.o
rotater.o
rule.o
spec.o
thread.o
zc_arraylist.o
zc_hashtable.o
zc_profile.o
zc_util.o
zlog.o
BINS=zlog-chk-conf
LIBNAME=libzlog
ZLOG_MAJOR=1
ZLOG_MINOR=2
Fallback to gcc when $CC is not in $PATH.
CC:=$(shell sh -c 'type $(CC) >/dev/null 2>/dev/null && echo ( C C ) ∣ ∣ e c h o g c c ′ ) O P T I M I Z A T I O N ? = − O 2 W A R N I N G S = − W a l l − W s t r i c t − p r o t o t y p e s − f w r a p v D E B U G ? = − g − g g d b R E A L C F L A G S = (CC) || echo gcc') OPTIMIZATION?=-O2 WARNINGS=-Wall -Wstrict-prototypes -fwrapv DEBUG?= -g -ggdb REAL_CFLAGS= (CC)∣∣echogcc′)OPTIMIZATION?=−O2WARNINGS=−Wall−Wstrict−prototypes−fwrapvDEBUG?=−g−ggdbREALCFLAGS=(OPTIMIZATION) -fPIC -pthread $(CFLAGS) $(WARNINGS) ( D E B U G ) R E A L L D F L A G S = (DEBUG) REAL_LDFLAGS= (DEBUG)REALLDFLAGS=(LDFLAGS) -pthread
DYLIBSUFFIX=so
STLIBSUFFIX=a
DYLIB_MINOR_NAME=
(
L
I
B
N
A
M
E
)
.
(LIBNAME).
(LIBNAME).(DYLIBSUFFIX).
(
Z
L
O
G
M
A
J
O
R
)
.
(ZLOG_MAJOR).
(ZLOGMAJOR).(ZLOG_MINOR)
DYLIB_MAJOR_NAME=
(
L
I
B
N
A
M
E
)
.
(LIBNAME).
(LIBNAME).(DYLIBSUFFIX).
(
Z
L
O
G
M
A
J
O
R
)
D
Y
L
I
B
N
A
M
E
=
(ZLOG_MAJOR) DYLIBNAME=
(ZLOGMAJOR)DYLIBNAME=(LIBNAME).
(
D
Y
L
I
B
S
U
F
F
I
X
)
D
Y
L
I
B
M
A
K
E
C
M
D
=
(DYLIBSUFFIX) DYLIB_MAKE_CMD=
(DYLIBSUFFIX)DYLIBMAKECMD=(CC) -shared -Wl,-soname,$(DYLIB_MINOR_NAME) -o $(DYLIBNAME)
(
L
D
F
L
A
G
S
)
S
T
L
I
B
N
A
M
E
=
(LDFLAGS) STLIBNAME=
(LDFLAGS)STLIBNAME=(LIBNAME).$(STLIBSUFFIX)
STLIB_MAKE_CMD=ar rcs $(STLIBNAME)
Installation related variables
PREFIX?=/usr/local
INCLUDE_PATH=include
LIBRARY_PATH=lib
BINARY_PATH=bin
INSTALL_INCLUDE_PATH=
(
P
R
E
F
I
X
)
/
(PREFIX)/
(PREFIX)/(INCLUDE_PATH)
INSTALL_LIBRARY_PATH=
(
P
R
E
F
I
X
)
/
(PREFIX)/
(PREFIX)/(LIBRARY_PATH)
INSTALL_BINARY_PATH=
(
P
R
E
F
I
X
)
/
(PREFIX)/
(PREFIX)/(BINARY_PATH)
Platform-specific overrides
uname_S := $(shell sh -c ‘uname -s 2>/dev/null || echo not’)
compiler_platform :=
(
s
h
e
l
l
s
h
−
c
′
(shell sh -c '
(shellsh−c′(CC) --version|grep -i apple’)
ifeq ($(uname_S),SunOS)
REAL_LDFLAGS+= -ldl -lnsl -lsocket
DYLIB_MAKE_CMD=$(CC) -G -o $(DYLIBNAME) -h $(DYLIB_MINOR_NAME) $(LDFLAGS)
INSTALL= cp -r
endif
For Darwin builds, check the compiler platform above is not empty. The covers cross compilation on Linux
ifneq (
(
c
o
m
p
i
l
e
r
p
l
a
t
f
o
r
m
)
,
)
D
Y
L
I
B
S
U
F
F
I
X
=
d
y
l
i
b
D
Y
L
I
B
M
I
N
O
R
N
A
M
E
=
(compiler_platform),) DYLIBSUFFIX=dylib DYLIB_MINOR_NAME=
(compilerplatform),)DYLIBSUFFIX=dylibDYLIBMINORNAME=(LIBNAME).
(
Z
L
O
G
M
A
J
O
R
)
.
(ZLOG_MAJOR).
(ZLOGMAJOR).(ZLOG_MINOR).
(
D
Y
L
I
B
S
U
F
F
I
X
)
D
Y
L
I
B
M
A
J
O
R
N
A
M
E
=
(DYLIBSUFFIX) DYLIB_MAJOR_NAME=
(DYLIBSUFFIX)DYLIBMAJORNAME=(LIBNAME).
(
Z
L
O
G
M
A
J
O
R
)
.
(ZLOG_MAJOR).
(ZLOGMAJOR).(DYLIBSUFFIX)
DYLIB_MAKE_CMD=$(CC) -dynamiclib -install_name
(
I
N
S
T
A
L
L
L
I
B
R
A
R
Y
P
A
T
H
)
/
(INSTALL_LIBRARY_PATH)/
(INSTALLLIBRARYPATH)/(DYLIB_MINOR_NAME) -o $(DYLIBNAME) $(LDFLAGS)
REAL_CFLAGS+= -D_DARWIN_C_SOURCE
endif
ifeq ($(uname_S),AIX)
this logic of minor major is not relevant on AIX or at least not widely used
not to mention dynamic linker .a preference…
DYLIB_MAKE_CMD=$(CC) -shared -Wl,-G,-b64 -maix64 -pthread -o $(DYLIBNAME) $(LDFLAGS)
REAL_CFLAGS+= -maix64
STLIB_MAKE_CMD=OBJECT_MODE=64 ar rcs $(STLIBNAME) $(DYLIB_MAJOR_NAME)
endif
all: $(DYLIBNAME) $(BINS)
Deps (use make dep to generate this)
buf.o: buf.c zc_defs.h zc_profile.h zc_arraylist.h zc_hashtable.h
zc_xplatform.h zc_util.h buf.h
category.o: category.c fmacros.h category.h zc_defs.h zc_profile.h
zc_arraylist.h zc_hashtable.h zc_xplatform.h zc_util.h thread.h event.h
buf.h mdc.h rule.h format.h rotater.h record.h
category_table.o: category_table.c zc_defs.h zc_profile.h zc_arraylist.h
zc_hashtable.h zc_xplatform.h zc_util.h category_table.h category.h
thread.h event.h buf.h mdc.h
conf.o: conf.c fmacros.h conf.h zc_defs.h zc_profile.h zc_arraylist.h
zc_hashtable.h zc_xplatform.h zc_util.h format.h thread.h event.h buf.h
mdc.h rotater.h rule.h record.h level_list.h level.h
event.o: event.c fmacros.h zc_defs.h zc_profile.h zc_arraylist.h
zc_hashtable.h zc_xplatform.h zc_util.h event.h
format.o: format.c zc_defs.h zc_profile.h zc_arraylist.h zc_hashtable.h
zc_xplatform.h zc_util.h thread.h event.h buf.h mdc.h spec.h format.h
level.o: level.c zc_defs.h zc_profile.h zc_arraylist.h zc_hashtable.h
zc_xplatform.h zc_util.h level.h
level_list.o: level_list.c zc_defs.h zc_profile.h zc_arraylist.h
zc_hashtable.h zc_xplatform.h zc_util.h level.h level_list.h
mdc.o: mdc.c mdc.h zc_defs.h zc_profile.h zc_arraylist.h zc_hashtable.h
zc_xplatform.h zc_util.h
record.o: record.c zc_defs.h zc_profile.h zc_arraylist.h zc_hashtable.h
zc_xplatform.h zc_util.h record.h
record_table.o: record_table.c zc_defs.h zc_profile.h zc_arraylist.h
zc_hashtable.h zc_xplatform.h zc_util.h record_table.h record.h
rotater.o: rotater.c zc_defs.h zc_profile.h zc_arraylist.h zc_hashtable.h
zc_xplatform.h zc_util.h rotater.h
rule.o: rule.c fmacros.h rule.h zc_defs.h zc_profile.h zc_arraylist.h
zc_hashtable.h zc_xplatform.h zc_util.h format.h thread.h event.h buf.h
mdc.h rotater.h record.h level_list.h level.h spec.h
spec.o: spec.c fmacros.h spec.h event.h zc_defs.h zc_profile.h
zc_arraylist.h zc_hashtable.h zc_xplatform.h zc_util.h buf.h thread.h
mdc.h level_list.h level.h
thread.o: thread.c zc_defs.h zc_profile.h zc_arraylist.h zc_hashtable.h
zc_xplatform.h zc_util.h event.h buf.h thread.h mdc.h
zc_arraylist.o: zc_arraylist.c zc_defs.h zc_profile.h zc_arraylist.h
zc_hashtable.h zc_xplatform.h zc_util.h
zc_hashtable.o: zc_hashtable.c zc_defs.h zc_profile.h zc_arraylist.h
zc_hashtable.h zc_xplatform.h zc_util.h
zc_profile.o: zc_profile.c fmacros.h zc_profile.h zc_xplatform.h
zc_util.o: zc_util.c zc_defs.h zc_profile.h zc_arraylist.h zc_hashtable.h
zc_xplatform.h zc_util.h
zlog-chk-conf.o: zlog-chk-conf.c fmacros.h zlog.h
zlog.o: zlog.c fmacros.h conf.h zc_defs.h zc_profile.h zc_arraylist.h
zc_hashtable.h zc_xplatform.h zc_util.h format.h thread.h event.h buf.h
mdc.h rotater.h category_table.h category.h record_table.h
record.h rule.h
$(DYLIBNAME): $(OBJ)
$(DYLIB_MAKE_CMD) $(OBJ) $(REAL_LDFLAGS)
for use in test folder - linux and requirement for aix runtime
resolving
cp -f $(DYLIBNAME) $(DYLIB_MAJOR_NAME)
cp -f $(DYLIBNAME) $(DYLIB_MINOR_NAME)
$(STLIBNAME): $(OBJ)
$(STLIB_MAKE_CMD) $(OBJ)
dynamic: $(DYLIBNAME)
static: $(STLIBNAME)
Binaries:
zlog-chk-conf: zlog-chk-conf.o $(STLIBNAME) $(DYLIBNAME)
$(CC) -o $@ zlog-chk-conf.o -L. -lzlog $(REAL_LDFLAGS)
.c.o:
$(CC) -std=c99 -pedantic -c $(REAL_CFLAGS) $<
clean:
rm -rf $(DYLIBNAME) $(STLIBNAME) $(BINS) *.o *.gcda *.gcno *.gcov $(DYLIB_MINOR_NAME) $(DYLIB_MAJOR_NAME)
dep:
$(CC) -MM *.c
Installation target
ifeq ($(uname_S),SunOS)
INSTALL?= cp -r
endif
ifeq ($(uname_S),AIX)
INSTALL?= cp -r
endif
INSTALL?= cp -a
install: $(DYLIBNAME) $(STLIBNAME)
mkdir -p $(INSTALL_INCLUDE_PATH) $(INSTALL_LIBRARY_PATH) $(INSTALL_BINARY_PATH)
$(INSTALL) zlog.h $(INSTALL_INCLUDE_PATH)
$(INSTALL) zlog-chk-conf $(INSTALL_BINARY_PATH)
$(INSTALL) $(DYLIBNAME)
(
I
N
S
T
A
L
L
L
I
B
R
A
R
Y
P
A
T
H
)
/
(INSTALL_LIBRARY_PATH)/
(INSTALLLIBRARYPATH)/(DYLIB_MINOR_NAME)
cd $(INSTALL_LIBRARY_PATH) && ln -sf $(DYLIB_MINOR_NAME) $(DYLIB_MAJOR_NAME)
cd $(INSTALL_LIBRARY_PATH) && ln -sf $(DYLIB_MAJOR_NAME) $(DYLIBNAME)
$(INSTALL) $(STLIBNAME) $(INSTALL_LIBRARY_PATH)
32bit:
@echo “”
@echo “WARNING: if this fails under Linux you probably need to install libc6-dev-i386”
@echo “”
$(MAKE) CFLAGS=“-m32” LDFLAGS=“-m32”
gprof:
$(MAKE) CFLAGS=“-pg” LDFLAGS=“-pg”
gcov:
$(MAKE) CFLAGS=“-fprofile-arcs -ftest-coverage” LDFLAGS=“-fprofile-arcs”
coverage: gcov
make check
mkdir -p tmp/lcov
lcov -d . -c -o tmp/lcov/hiredis.info
genhtml --legend -o tmp/lcov/report tmp/lcov/hiredis.info
noopt:
$(MAKE) OPTIMIZATION=“”
.PHONY: all clean dep install 32bit gprof gcov noopt
可以看出,这个makefile比我们之前写的要复杂很多,而且用到了很多linux上的命令,因此在Windows下直接编译是会报错的。如下图所示
PS E:\wenjian\cs\code\zlog\zlog\src> make
process_begin: CreateProcess(NULL, sh -c “type cc >/dev/null 2>/dev/null && echo cc || echo
gcc”, …) failed.
process_begin: CreateProcess(NULL, sh -c “uname -s 2>/dev/null || echo not”, …) failed.
process_begin: CreateProcess(NULL, sh -c " --version|grep -i apple", …) failed.
std=c99 -pedantic -c -O2 -fPIC -pthread -Wall -Wstrict-prototypes -fwrapv -g -ggdb buf.c
‘std’ 不是内部或外部命令,也不是可运行的程序
或批处理文件。
makefile:154: recipe for target ‘buf.o’ failed
make: [buf.o] Error 1 (ignored)
std=c99 -pedantic -c -O2 -fPIC -pthread -Wall -Wstrict-prototypes -fwrapv -g -ggdb category.c
‘std’ 不是内部或外部命令,也不是可运行的程序
或批处理文件。
makefile:154: recipe for target ‘category.o’ failed
make: [category.o] Error 1 (ignored)
std=c99 -pedantic -c -O2 -fPIC -pthread -Wall -Wstrict-prototypes -fwrapv -g -ggdb category_table.c
‘std’ 不是内部或外部命令,也不是可运行的程序
或批处理文件。
makefile:154: recipe for target ‘category_table.o’ failed
make: [category_table.o] Error 1 (ignored)
std=c99 -pedantic -c -O2 -fPIC -pthread -Wall -Wstrict-prototypes -fwrapv -g -ggdb conf.c
‘std’ 不是内部或外部命令,也不是可运行的程序
或批处理文件。
makefile:154: recipe for target ‘conf.o’ failed
make: [conf.o] Error 1 (ignored)
std=c99 -pedantic -c -O2 -fPIC -pthread -Wall -Wstrict-prototypes -fwrapv -g -ggdb event.c
‘std’ 不是内部或外部命令,也不是可运行的程序
或批处理文件。
makefile:154: recipe for target ‘event.o’ failed
make: [event.o] Error 1 (ignored)
std=c99 -pedantic -c -O2 -fPIC -pthread -Wall -Wstrict-prototypes -fwrapv -g -ggdb format.c’std’ 不是内部或外部命令,也不是可运行的程序
或批处理文件。
makefile:154: recipe for target ‘format.o’ failed
make: [format.o] Error 1 (ignored)
std=c99 -pedantic -c -O2 -fPIC -pthread -Wall -Wstrict-prototypes -fwrapv -g -ggdb level.c
‘std’ 不是内部或外部命令,也不是可运行的程序
或批处理文件。
makefile:154: recipe for target ‘level.o’ failed
make: [level.o] Error 1 (ignored)
std=c99 -pedantic -c -O2 -fPIC -pthread -Wall -Wstrict-prototypes -fwrapv -g -ggdb level_list.c
‘std’ 不是内部或外部命令,也不是可运行的程序
或批处理文件。
makefile:154: recipe for target ‘level_list.o’ failed
make: [level_list.o] Error 1 (ignored)
std=c99 -pedantic -c -O2 -fPIC -pthread -Wall -Wstrict-prototypes -fwrapv -g -ggdb mdc.c
‘std’ 不是内部或外部命令,也不是可运行的程序
或批处理文件。
makefile:154: recipe for target ‘mdc.o’ failed
make: [mdc.o] Error 1 (ignored)
std=c99 -pedantic -c -O2 -fPIC -pthread -Wall -Wstrict-prototypes -fwrapv -g -ggdb record.c’std’ 不是内部或外部命令,也不是可运行的程序
或批处理文件。
makefile:154: recipe for target ‘record.o’ failed
make: [record.o] Error 1 (ignored)
std=c99 -pedantic -c -O2 -fPIC -pthread -Wall -Wstrict-prototypes -fwrapv -g -ggdb record_table.c
‘std’ 不是内部或外部命令,也不是可运行的程序
或批处理文件。
makefile:154: recipe for target ‘record_table.o’ failed
make: [record_table.o] Error 1 (ignored)
std=c99 -pedantic -c -O2 -fPIC -pthread -Wall -Wstrict-prototypes -fwrapv -g -ggdb rotater.c
‘std’ 不是内部或外部命令,也不是可运行的程序
或批处理文件。
makefile:154: recipe for target ‘rotater.o’ failed
make: [rotater.o] Error 1 (ignored)
std=c99 -pedantic -c -O2 -fPIC -pthread -Wall -Wstrict-prototypes -fwrapv -g -ggdb rule.c
‘std’ 不是内部或外部命令,也不是可运行的程序
或批处理文件。
makefile:154: recipe for target ‘rule.o’ failed
make: [rule.o] Error 1 (ignored)
std=c99 -pedantic -c -O2 -fPIC -pthread -Wall -Wstrict-prototypes -fwrapv -g -ggdb spec.c
‘std’ 不是内部或外部命令,也不是可运行的程序
或批处理文件。
makefile:154: recipe for target ‘spec.o’ failed
make: [spec.o] Error 1 (ignored)
std=c99 -pedantic -c -O2 -fPIC -pthread -Wall -Wstrict-prototypes -fwrapv -g -ggdb thread.c’std’ 不是内部或外部命令,也不是可运行的程序
或批处理文件。
makefile:154: recipe for target ‘thread.o’ failed
make: [thread.o] Error 1 (ignored)
std=c99 -pedantic -c -O2 -fPIC -pthread -Wall -Wstrict-prototypes -fwrapv -g -ggdb zc_arraylist.c
‘std’ 不是内部或外部命令,也不是可运行的程序
或批处理文件。
makefile:154: recipe for target ‘zc_arraylist.o’ failed
make: [zc_arraylist.o] Error 1 (ignored)
std=c99 -pedantic -c -O2 -fPIC -pthread -Wall -Wstrict-prototypes -fwrapv -g -ggdb zc_hashtable.c
‘std’ 不是内部或外部命令,也不是可运行的程序
或批处理文件。
makefile:154: recipe for target ‘zc_hashtable.o’ failed
make: [zc_hashtable.o] Error 1 (ignored)
std=c99 -pedantic -c -O2 -fPIC -pthread -Wall -Wstrict-prototypes -fwrapv -g -ggdb zc_profile.c
‘std’ 不是内部或外部命令,也不是可运行的程序
或批处理文件。
makefile:154: recipe for target ‘zc_profile.o’ failed
make: [zc_profile.o] Error 1 (ignored)
std=c99 -pedantic -c -O2 -fPIC -pthread -Wall -Wstrict-prototypes -fwrapv -g -ggdb zc_util.c
‘std’ 不是内部或外部命令,也不是可运行的程序
或批处理文件。
makefile:154: recipe for target ‘zc_util.o’ failed
make: [zc_util.o] Error 1 (ignored)
std=c99 -pedantic -c -O2 -fPIC -pthread -Wall -Wstrict-prototypes -fwrapv -g -ggdb zlog.c
‘std’ 不是内部或外部命令,也不是可运行的程序
或批处理文件。
makefile:154: recipe for target ‘zlog.o’ failed
make: [zlog.o] Error 1 (ignored)
shared -Wl,-soname,libzlog.so.1.2 -o libzlog.so buf.o category.o category_table.o conf.o event.o format.o level.o level_list.o mdc.o record.o record_table.o rotater.o rule.o spec.o thread.o zc_arraylist.o zc_hashtable.o zc_profile.o zc_util.o zlog.o -pthread
process_begin: CreateProcess(NULL, shared -Wl,-soname,libzlog.so.1.2 -o libzlog.so buf.o category.o category_table.o conf.o event.o format.o level.o level_list.o mdc.o record.o record_table.o rotater.o rule.o spec.o thread.o zc_arraylist.o zc_hashtable.o zc_profile.o zc_util.o zlog.o -pthread, …) failed.
make (e=2):
makefile:137: recipe for target ‘libzlog.so’ failed
make: [libzlog.so] Error 2 (ignored)
for use in test folder - linux and requirement for aix runtime
process_begin: CreateProcess(NULL, # for use in test folder - linux and requirement for aix
runtime, …) failed.
make (e=2):
makefile:137: recipe for target ‘libzlog.so’ failed
make: *** [libzlog.so] Error 2
网上学习资料一大堆,但如果学到的知识不成体系,遇到问题时只是浅尝辄止,不再深入研究,那么很难做到真正的技术提升。
需要这份系统化的资料的朋友,可以添加V获取:vip1024b (备注Go)
一个人可以走的很快,但一群人才能走的更远!不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!
.o zc_profile.o zc_util.o zlog.o -pthread, …) failed.
make (e=2):
makefile:137: recipe for target ‘libzlog.so’ failed
make: [libzlog.so] Error 2 (ignored)
for use in test folder - linux and requirement for aix runtime
process_begin: CreateProcess(NULL, # for use in test folder - linux and requirement for aix
runtime, …) failed.
make (e=2):
makefile:137: recipe for target ‘libzlog.so’ failed
make: *** [libzlog.so] Error 2
网上学习资料一大堆,但如果学到的知识不成体系,遇到问题时只是浅尝辄止,不再深入研究,那么很难做到真正的技术提升。
需要这份系统化的资料的朋友,可以添加V获取:vip1024b (备注Go)
[外链图片转存中…(img-fMWDM119-1713295343661)]
一个人可以走的很快,但一群人才能走的更远!不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!