-
Notifications
You must be signed in to change notification settings - Fork 360
compiling issue #3
Comments
It turns out the -arch flag is specific to the Apple-specific version of gcc. The equivalent flag to compile in linux is either -m32 or -m64, depending on your architecture. I got it to compile by editing the Makefile, changing the line "ARCH_FLAGS= -arch x86_64'" to "ARCH_FLAGS=-m64", for 64 bits architecture. |
Thanks for the note. I modified the Makefile, and compiled all the C++ files to .o files. But now when generating bin/FaceTracker, I have a lot linking errors to opencv functions. My machine runs Ubuntu, and all the opencv library files can be found at /usr/local/lib. I don't know why g++ cannot find and link to them. My opencv sample programs can compile just fine. Have you tried compiling FaceTracker on Ubuntu ? Thanks, |
I built it in debian unstable, and I didn't get any other errors while In your case, it might be worth a shot recompiling OpenCV including any cheers, On Fri, Mar 15, 2013 at 8:20 PM, pc2013 notifications@github.com wrote:
|
After getting the same problem, some research into this issue revealed that starting from Ubuntu 11.10, libraries must be placed behind objects needing them. For example, g++ PathsOPENCV_PATH=/usr/local ProgramsCC= FlagsARCH_FLAGS=-m64 Files which require compilingSOURCE_FILES= Source files which contain a int main(..) functionSOURCE_FILES_WITH_MAIN=src/exe/face_tracker.cc End ConfigurationSOURCE_OBJECTS=$(patsubst %.cc,%.o,$(SOURCE_FILES)) ALL_OBJECTS= DEPENDENCY_FILES= all: bin/face_tracker %.o: %.cc Makefile -include $(DEPENDENCY_FILES) bin/face_tracker: $(ALL_OBJECTS) .PHONY: clean |
Thanks, I can compile it now. From: CptMonac notifications@github.com After getting the same problem, some research into this issue revealed that starting from Ubuntu 11.10, libraries must be placed behind objects needing them. For example, g++ pkg-config --cflags opencv easyprog.cpp pkg-config --libs opencv -o easyprog. I also attached the modified Makefile if you would find it useful: |
Hello
I am trying to install FaceTracker on Ubuntu 11.10. Following the instructions, the opencv was correctly installed.
When make FaceTracker, I got the following errors:
g++ -MM -MT src/lib/IO.o -MF src/lib/IO.d -Wextra -Wall -pedantic-errors -arch x86_64 -O3 -I/usr/local/include -Iinclude/ src/lib/IO.cc
g++: error: x86_64: No such file or directory
g++: error: unrecognized option ‘-arch’
make: *** [src/lib/IO.o] Error 1
If removing "-arch x86_64", there are many linking errors.
BTW, there seems to be a type in the readme.md file, "OPECV_PATH" may should be "OPENCV_PATH".
Thanks,
Peter
ARCH_FLAGS=-arch x86_64
The text was updated successfully, but these errors were encountered: