如何编译c99到c89转换器铛? [英] How to compile c99-to-c89 convertor with clang?
问题描述
我试图在VisualStudio中编译ffmpeg,其中一步是编译 c99 -to-c89 代码,根据 this post。我设法创建clang.exe,但我怎么编译c99-to-c89代码?
I'm trying to compile ffmpeg in windows for VisualStudio and one of the step is to compile c99-to-c89 code with clang according to this post. I managed to create clang.exe but how I compile c99-to-c89 code with it?
我改变了一点点c99到c89的makefile,所以 CC
变量现在指向clang.exe编译器而不是cl.exe
I changed a little bit the makefile in c99-to-c89 so CC
variable points now to clang.exe compiler and not cl.exe
EXT=.exe
all: c99conv$(EXT) c99wrap$(EXT)
CLANGDIR=C:/build
CC=C:/build/bin/Release/clang.exe
CFLAGS=-nologo -Z7 -D_CRT_SECURE_NO_WARNINGS=1 -Dpopen=_popen -Dunlink=_unlink -Dstrdup=_strdup -Dsnprintf=_snprintf -I. -I$(CLANGDIR)/tools/clang/include
LDFLAGS=-nologo -Z7 $(CLANGDIR)/lib/Release/libclang.lib
clean:
rm -f c99conv$(EXT) c99wrap$(EXT) convert.o compilewrap.o
rm -f unit.c.c unit2.c.c
test1: c99conv$(EXT)
$(CC) -P unit.c -Fiunit.prev.c
./c99conv unit.prev.c unit.post.c
diff -u unit.{prev,post}.c
test2: c99conv$(EXT)
$(CC) -P unit2.c -Fiunit2.prev.c
./c99conv unit2.prev.c unit2.post.c
diff -u unit2.{prev,post}.c
test3: c99conv$(EXT)
$(CC) $(CFLAGS) -P -Ficonvert.prev.c convert.c
./c99conv convert.prev.c convert.post.c
diff -u convert.{prev,post}.c
c99conv$(EXT): convert.o
$(CC) -Fe$@ $< $(LDFLAGS) $(LIBS)
c99wrap$(EXT): compilewrap.o
$(CC) -Fe$@ $< $(LDFLAGS)
%.o: %.c
$(CC) $(CFLAGS) -Fo$@ -c $<
但是当我运行 make
clang:error:不支持使用内部gcc -Z选项'-Z7'
。我想在 CFLAGS
和 LDFLAGS
中的问题,但我不知道如何解决它,因为缺乏知识makefile和clang。
but when I run make
command I get clang: error: unsupported use of internal gcc -Z option '-Z7'
. I guess the problem in CFLAGS
and LDFLAGS
but I don't know how to fix it because the lack of knowledge in makefile and clang.
推荐答案
如果有人还需要,libav的家伙给我提供了此链接下载二进制文件 c99conv.exe
, c99wrap.exe
, makedef
If someone still needs, the guys from libav provided me with this link to download the binaries c99conv.exe
, c99wrap.exe
, makedef
这篇关于如何编译c99到c89转换器铛?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!