I recently inherited some OpenCV code. I installed openCV on my Mac, built into Xcode, and then compiled and successfully executed my first openCV hello world program.
Now I'm trying to run the code that was provided to me, but I get errors that make me believe that this is a problem with the source code that runs on a 32-bit Windows system and mine on a 64-bit Mac.
When I run the makefile by typing "make"
CC = g++ CFLAGS = LDFLAGS = -I/usr/local/include/opencv -lm -lopencv_core -lopencv_highgui -lopencv_video ALL = vision all: $(ALL) vision: vision.o $(CC) $(LDFLAGS) -o $@ $^ vision.o: vision.cpp $(CC) $(LDFLAGS) -c $< .PHONY: clean clean: rm -rf *.o core* $(ALL)
I get the following output ...
g++ -I/usr/local/include/opencv -lm -lopencv_core -lopencv_highgui -lopencv_video -o vision vision.o Undefined symbols for architecture x86_64: "cv::equalizeHist(cv::Mat const&, cv::Mat&)", referenced from: _main in vision.o "cv::threshold(cv::Mat const&, cv::Mat&, double, double, int)", referenced from: _main in vision.o ld: symbol(s) not found for architecture x86_64 collect2: ld returned 1 exit status make: *** [vision] Error 1
I'm confused; Does this mean that my OpenCV installation is incorrect, does the code (these methods specifically) need to be changed, or something else?
Note. When I comment on problem methods from vision.cpp code, everything compiles just fine.
c ++ opencv g ++ 32bit-64bit macos
Warpling
source share