-
Notifications
You must be signed in to change notification settings - Fork 124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Makefile无法正常工作 #1
Comments
用Unity 把算法 依葫芦画瓢的搞了一个下来,makefile文盲可以来试试看 |
@wurui1994 感觉这是平台的问题。例子代码都只使用了 C99 标准库。 |
I had a similar issue because of a small mistake in the makefile : |
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
在Manjaro上会报错:
[wurui@computer light2d]$ make
cc basic.c -o basic
/tmp/ccb1Fj9Q.o:在函数‘circleSDF’中:
basic.c:(.text+0x104e):对‘sqrtf’未定义的引用
/tmp/ccb1Fj9Q.o:在函数‘sample’中:
basic.c:(.text+0x1189):对‘sinf’未定义的引用
basic.c:(.text+0x119e):对‘cosf’未定义的引用
/tmp/ccb1Fj9Q.o:在函数‘main’中:
basic.c:(.text+0x1264):对‘fminf’未定义的引用
collect2: 错误:ld 返回 1
make: *** [<内置>:basic] 错误 1
必须要改成这样,才能正常工作:
TARGETS=basic csg
OUTPUTS=$(addsuffix .png, $(TARGETS))
all: $(TARGETS)$(TARGETS) $ (OUTPUTS)
test:
%: %.c$@ $ <
gcc -lm -Wall -O3 -o
%.png: %
sh -c "time ./$<"
clean:
rm $(TARGETS) *.png
The text was updated successfully, but these errors were encountered: