3

I'm try to to build the stasm library on my mac and hopefully port it to the iphone. stasm download: http://www.milbo.users.sonic.net/stasm/download.html

I am using the makefile for linux provided. after some changes to header include paths for libjpeg and opencv, I am stuck with this error

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

the original makefile is uploaded here https://github.com/tsaizhenling/stuff/blob/master/makefile

i have tried changing the directory as trojanfoe suggested but still same error :(

I have opencv and opencv2 residing in /opt/local/include/

Update:

tried J-16 SDiZ's suggestion and this brought me forward. I had to remove the pedantic flag but i'm still stuck with the following error

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: * No rule to make target -lm', needed bystasm'. Stop.

makefile is updated

Update:

Finally got everything fixed with help from J-16 SDiZ.

had to update the linker flags because opencv changed the library names

makefile is updated in case anyone needs it

tzl
  • 1,540
  • 2
  • 20
  • 31
  • Looks like it's looking for OpenCV stuff in `/opt/local/include` and yet you have specified `/home/john/OpenCV-2.1.0/include`. Please post the `Makefile`, as it looks broken. – trojanfoe Oct 12 '12 at 10:58
  • the changed names helped me compile it on Ubuntu precise! – L7ColWinters Dec 05 '12 at 21:42
  • @tzl Hi, I am building stasm for iOS. Thanks for this question and your new Makefile, I generated a bundle of .o files and the binary executable files. But what I want is something like library or framework I can use in my Xcode project. Do you know how can I do it? Or what did you do after get all sources compiled on a Mac? Thank you for any information! – onevcat May 06 '13 at 13:40
  • hi, glad to know the makefile helped you out, I did not procced on beyong getting the executable to work on my mac because it was no longer required. you can checkout this question http://stackoverflow.com/questions/2734719/howto-compile-a-static-library-in-linux that tells you how to generate a static library from object files – tzl May 06 '13 at 15:07
  • Hi have you done with integrating STASM with IOS? How was the performance with real time video capture? Is it fast? Can you tell the speed in terms of FPS? – user2727765 Feb 14 '14 at 14:33
  • Hi, did you manage to import it to iOS? I'm trying to do it too, any luck? – Antonio MG Mar 04 '15 at 09:04
  • hi, sorry this was a really long time ago. If memory serves me right, we eventualy did not use it to build the application. – tzl Mar 06 '15 at 03:33

2 Answers2

2

Change

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

to

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

And you should not use ${LIB} in the dependency.

change

something: xxxxxx $(LIBS) $(OBJ)

to

something: xxxxxx $(OBJ)

I think you should learn how Makefile works, this is a makefile problem.

J-16 SDiZ
  • 26,473
  • 4
  • 65
  • 84
  • thanks this change brought me forward abit more. I had to remove a -pedantic flag. I have now run into another error make: *** No rule to make target `-lm', needed by `stasm'. Stop. – tzl Oct 12 '12 at 11:26
0

There are Mac/Linux build scripts for Stasm here: https://github.com/juan-cardelino/stasm

You can build for iOS easily using this: https://code.google.com/p/ios-cmake/wiki/HowTo

jacob
  • 2,762
  • 1
  • 20
  • 49