小编Ema*_*uoy的帖子

无法识别 makefile 文件格式

我做错了什么?您能否发送一些有用的链接,让我的 makefile 工作更轻松、更好?

get_next_line.o: file not recognized: File format not recognized
collect2: error: ld returned 1 exit status
Makefile:27: recipe for target 'gnl' failed
make: *** [gnl] Error 1
Run Code Online (Sandbox Code Playgroud)

+++

SRC = gnl.c
OBJ = $(SRC:.c=.o)
INCLUDES = gnl.h
NAME = gnl
CFLAGS = -Wall -Werror -Wextra
CC = gcc
DIR = LIBFT

%.o: %.c $(SRC) $(INCLUDES)
        $(CC) $(CFLAGS) -c $<

all: $(NAME)

$(NAME): $(OBJ)
        make -C $(DIR)
        $(CC) $(CFLAGS) -o $(NAME) $(OBJ) -L. $(DIR)/libft.a
clean:
        make clean -C $(DIR) …
Run Code Online (Sandbox Code Playgroud)

c makefile

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

为什么我不能接受变量的地址?

伙计们!为什么我不能接受"t" - 变量的地址?

flygs->type == 'X' ? t = a_ib_u(u->us, 16) : (a_lowcasealph(&(t = a_ib_u(u->us, 16))));
\\a_ib_u returns *char, a_lowcasealph take **char argument 
Run Code Online (Sandbox Code Playgroud)

错误:无法获取'char*'类型的右值的地址

c variables

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

将变量与if语句中的值列表进行比较的更易读的方法是什么?

如何将变量与if语句中相同类型的值列表进行比较并使其可读且干净?

例如,我有以下内容,但有很多值,我想让它更具可读性.

if ((lst->type == 'p' || lst->type == 'x' || lst->type == 'X' ||
    lst->type == 'o' || lst->type == 'O' || (lst->type == 'd' ||
    lst->type == 'i' || lst->type == 'D'))
Run Code Online (Sandbox Code Playgroud)

c variables if-statement

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

标签 统计

c ×3

variables ×2

if-statement ×1

makefile ×1