我一直在使用Cygwin使用NDK的ndk-build脚本和Cygwin的make工具来构建我的Android库.它开始给我一些拉丁非英语字符的错误.将文本复制到Google时,它被粘贴为希伯来语(我可以阅读).有没有办法强迫它输出英文错误?知道为什么会这样吗?
我想要做的是使用Cygwin成功编译本机代码.当我运行键入我的目录到终端中的ndk-build时,我得到的错误消息是
错误:找不到'make'程序.请安装Cygwin make package或定义GNUMAKE变量以指向它.
这就是我在Cygwin终端输入的内容:
C:/用户/奎西/桌面/ Android的NDK-R8/NDK建造
我的构建路径是:C:\ cygwin\bin; C:\ Users\Kwesi\Desktop\android-ndk-r8 \ndk-build;
我使用这个youtube视频教程安装了make,所以我很确定它安装正确. http://www.youtube.com/watch?v=jqJGxJJq87w&list=FL2bdE2OcpySONpqzf5OsWNQ&index=1&feature=plpp_video
请帮忙.
如何使用以下命令创建一个简单的Makefile?
g++ -Wall -I/usr/include/opencv -I/usr/include/opencv2 -L/usr/lib/ -g -o exe sourc1.cpp sourc2.cpp sourc3.cpp -lopencv_core -lopencv_imgproc -lopencv_highgui -lopencv_ml -lopencv_video -lopencv_features2d -lopencv_calib3d -lopencv_objdetect -lopencv_contrib -lopencv_legacy -lv4l1 -lv4l2 -lv4lconvert -pthread
Run Code Online (Sandbox Code Playgroud)
我引用了这个链接,但我感到困惑.
我曾多次尝试,但make告诉我n不应该在那里.
我的简单makefile:
all:
for n in $(ALL_FILES); do\
echo $$n; \
done
Run Code Online (Sandbox Code Playgroud)
错误输出:
n不应该在那里.
更新:
感谢你们!当我在linux中运行它时,没关系.我发现Windows不支持for-syntax!
使用Makefile进行编译时,出现错误
/tmp/ccQ0q0g5.o:(.eh_frame+0x11): undefined reference to `__gxx_personality_v0'
collect2: ld returned 1 exit status
Run Code Online (Sandbox Code Playgroud)
似乎缺少一些.so或.a文件,但我怎么知道这样的错误报告缺少哪一个?
Makefile文件:
CFLAGS = -Iinclude/
CFLAGS += -m32
LDFLAGS = -Llib -llits -lrt -lpthread -Wl,-R,'lib'
server:server.cc
gcc -o server $(CFLAGS) $(LDFLAGS) server.cc
Run Code Online (Sandbox Code Playgroud) 我编写了一个 Makefile,它用另一个应用程序编译我的 mini-os。我必须使用-nostdioc和-nostdlib编译它们,但问题是,该应用程序正在使用 stdio/stdlib 函数,当我运行我的 Makefile 时,我收到错误消息,指出无法找到我的应用程序使用的函数。
我试图删除,-nostdlib -nostdioc但没有奏效。
如果有人想看一看,这里是 Makefile。
我目前正在学习C.我试图创建一个makefile,但由于某种原因,它不起作用.当我在控制台中输入"make"时,控制台中会显示以下警告:
makefile.c:1:1: warning: type specifier missing, defaults to 'int'
[-Wimplicit-int]
CFLAGS=-Wall -g
^~~~~~
makefile.c:1:9: error: use of undeclared identifier 'Wall'
CFLAGS=-Wall -g
^
makefile.c:1:15: error: use of undeclared identifier 'g'
CFLAGS=-Wall -g
^
makefile.c:4:13: error: expected ';' after top level declarator
rm -f ex1
Run Code Online (Sandbox Code Playgroud)
这是makefile的代码:
CFLAGS=-Wall -g
clean:
rm -f ex1
Run Code Online (Sandbox Code Playgroud)
代码应该编译ex1.c文件.为什么我的makefile不起作用?
我在c中编写了一个程序,我在windows上的cygwin中使用make文件来编译文件.在Visual Studio中执行完全正常,但是当我尝试使用我的make文件时,会发生以下情况:
错误:
$ make
gcc -c -o mathTable.o mathTable.c
mathTable.c:1:1: error: stray ‘\377’ in program
??# i n c l u d e < s t d l i b . h >
^
mathTable.c:1:2: error: stray ‘\376’ in program
??# i n c l u d e < s t d l i b . h >
^
mathTable.c:1:3: error: stray ‘#’ in program
??# i n c l u d e < s t d l i …Run Code Online (Sandbox Code Playgroud) 我的makefile看起来如下
apps = app1 app2 app3
all: dir app1 app2 app3 zip cleanup
现在我想在appsvarible 列表上做一些循环,
就像是
`loop on apps
endloop`
Run Code Online (Sandbox Code Playgroud)
是否有可能在makefile上循环,我需要在appsvarible列表上进行循环
更新
可以说,该变量(apps是)生成由我中的程序make文件,它提供了应用程序的每个项目不同势值,有时其apps= app1 app2有时其apps= app1有时可以是20个应用程式或更多apps= app1 app2 appN
我如何迭代apps变量并做一些事情,例如在每次迭代中打印如下:
now im in `app1`
now im in `app2`
etc
Run Code Online (Sandbox Code Playgroud)
尝试以下时
.PHONY: foo
all: foo
APPS = app1 app2 app3 app4
foo : $(APPS)
for $$f in $(APPS); do echo $$f is here; done …Run Code Online (Sandbox Code Playgroud) 现在我有这个命令:rm -f *.x *.o,它通过调用make clean我的shell 删除所有目标文件和可执行文件.但我有一个特定的目标文件,说a.o我不想删除.如果不对其进行硬编码,我怎么能这样做呢?请注意,我只能在C90下实现它,因为这是一个赋值.