为mac编译stasm

时间:2012-10-12 10:52:52

标签: ios linux macos opencv

我正在尝试在我的mac上构建stasm库,并希望将其移植到iphone。 stasm下载:http://www.milbo.users.sonic.net/stasm/download.html

我正在使用提供的linux的makefile。 在对标题的一些更改包括libjpeg和opencv的路径之后,我遇到了这个错误

g++ -c ../stasm/violajones.cpp -O3 -Wall -pedantic -I/home/john/OpenCV-2.1.0/include/opencv -I../gsl -I../gsl/gsl -I../image -I../jpeg -I../mat -I../rowley -I../stasm -I../tasm 
In file included from ../stasm/violajones.cpp:24:
/opt/local/include/opencv/cv.h:63:33: error: opencv2/core/core_c.h: No such file or directory 
/opt/local/include/opencv/cv.h:64:33: error: opencv2/core/core.hpp: No such file or directory
/opt/local/include/opencv/cv.h:65:39: error: opencv2/imgproc/imgproc_c.h: No such file or directory
/opt/local/include/opencv/cv.h:66:39: error: opencv2/imgproc/imgproc.hpp: No such file or directory
/opt/local/include/opencv/cv.h:67:38: error: opencv2/video/tracking.hpp: No such file or directory
/opt/local/include/opencv/cv.h:68:45: error: opencv2/features2d/features2d.hpp: No such file or directory
/opt/local/include/opencv/cv.h:69:35: error: opencv2/flann/flann.hpp: No such file or directory 
/opt/local/include/opencv/cv.h:70:39: error: opencv2/calib3d/calib3d.hpp: No such file or directory
/opt/local/include/opencv/cv.h:71:43: error: opencv2/objdetect/objdetect.hpp: No such file or directory
/opt/local/include/opencv/cv.h:72:37: error: opencv2/legacy/compat.hpp: No such file or directory
/opt/local/include/opencv/cv.h:79:37: error: opencv2/core/internal.hpp: No such file or directory In file included
from ../stasm/violajones.cpp:25:
/opt/local/include/opencv/highgui.h:47:39: error: opencv2/highgui/highgui_c.h: No such file or directory
/opt/local/include/opencv/highgui.h:48:39: error: opencv2/highgui/highgui.hpp: No such file or directory

原始makefile在此处上传https://github.com/tsaizhenling/stuff/blob/master/makefile

我试过改变目录,因为trojanfoe建议 但仍然是同样的错误:(

我有opencv和opencv2驻留在/ opt / local / include /

更新

尝试了J-16 SDiZ的建议,这让我前进了。我不得不删除迂腐的旗帜,但我仍然坚持以下错误

  

g ++ -c ../stasm/tab.cpp -O3 -Wall -I / opt / local / include / opencv   -I / opt / local / include -I ../ gsl -I ../ gsl / gsl -I ../ image -I ../ jpeg -I ../ mat -I ../ rowley -I .. / stasm -I ../ tasm make: * 没有规则可以使目标-lm', needed by stasm'。停止。

makefile已更新

更新

最后在J-16 SDiZ的帮助下解决了所有问题。

必须更新链接器标志,因为opencv更改了库名

如果有人需要,

makefile会更新

2 个答案:

答案 0 :(得分:2)

更改

INCL=\
    -I$(OPENCV_HOME)/include/opencv\
    -I../gsl\

INCL=\
    -I$(OPENCV_HOME)/include/opencv\
    -I$(OPENCV_HOME)/include \
    -I../gsl\

您不应在依赖项中使用${LIB}

变化

something: xxxxxx $(LIBS) $(OBJ)

something: xxxxxx $(OBJ)

我认为您应该了解Makefile的工作原理,这是一个makefile问题。

答案 1 :(得分:0)

这里有Stasm的Mac / Linux构建脚本: https://github.com/juan-cardelino/stasm

您可以使用以下内容轻松构建iOS: https://code.google.com/p/ios-cmake/wiki/HowTo