Code Monkey home page Code Monkey logo

Comments (5)

paulomuggler avatar paulomuggler commented on September 24, 2024

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.

from facetracker.

pc2013 avatar pc2013 commented on September 24, 2024

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,

from facetracker.

paulomuggler avatar paulomuggler commented on September 24, 2024

I built it in debian unstable, and I didn't get any other errors while
building besides that. Though I did have a build of OpenCV compiled without
video capture support, so it took me a couple of tries to figure it out and
recompile OpenCV correctly.

In your case, it might be worth a shot recompiling OpenCV including any
additional features that seem related to your missing libraries. I like to
use cmake-gui to make the building process less painful, you can find it in
the ubuntu repos with a search for cmake. Hard to tell more without looking
at your Makefile and the error output from make, though.

cheers,

On Fri, Mar 15, 2013 at 8:20 PM, pc2013 [email protected] wrote:

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,


Reply to this email directly or view it on GitHubhttps://github.com//issues/3#issuecomment-14979878
.

from facetracker.

CptMonac avatar CptMonac commented on September 24, 2024

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:

Paths

OPENCV_PATH=/usr/local

Programs

CC=
CXX=g++

Flags

ARCH_FLAGS=-m64
CFLAGS=-Wextra -Wall -pedantic-errors $(ARCH_FLAGS) -O3
LDFLAGS=$(ARCH_FLAGS)
DEFINES=
INCLUDES=-I$(OPENCV_PATH)/include -Iinclude/
#LIBRARIES=-L$(OPENCV_PATH)/lib -lopencv_core -lopencv_highgui -lopencv_imgproc -lopencv_objdetect
LIBRARIES=pkg-config --libs opencv

Files which require compiling

SOURCE_FILES=
src/lib/IO.cc
src/lib/PDM.cc
src/lib/Patch.cc
src/lib/CLM.cc
src/lib/FDet.cc
src/lib/PAW.cc
src/lib/FCheck.cc
src/lib/Tracker.cc

Source files which contain a int main(..) function

SOURCE_FILES_WITH_MAIN=src/exe/face_tracker.cc

End Configuration

SOURCE_OBJECTS=$(patsubst %.cc,%.o,$(SOURCE_FILES))

ALL_OBJECTS=
$(SOURCE_OBJECTS)
$(patsubst %.cc,%.o,$(SOURCE_FILES_WITH_MAIN))

DEPENDENCY_FILES=
$(patsubst %.o,%.d,$(ALL_OBJECTS))

all: bin/face_tracker

%.o: %.cc Makefile
@# Make dependecy file
$(CXX) -MM -MT $@ -MF $(patsubst %.cc,%.d,$<) $(CFLAGS) $(DEFINES) $(INCLUDES) $<
@# Compile
$(CXX) $(CFLAGS) $(DEFINES) $(INCLUDES) -c -o $@ $<

-include $(DEPENDENCY_FILES)

bin/face_tracker: $(ALL_OBJECTS)
$(CXX) $(LDFLAGS) -o $@ $(ALL_OBJECTS) $(LIBRARIES)

.PHONY: clean
clean:
@echo "Cleaning"
@for pattern in '~' '.o' '*.d' ; do
find . -name "$$pattern" | xargs rm ;
done

from facetracker.

pc2013 avatar pc2013 commented on September 24, 2024

Thanks, I can compile it now.


From: CptMonac [email protected]
To: kylemcdonald/FaceTracker [email protected]
Cc: pc2013 [email protected]
Sent: Tuesday, March 19, 2013 10:59 PM
Subject: Re: [FaceTracker] compiling issue (#3)

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:
Paths
OPENCV_PATH=/usr/local
Programs
CC=
CXX=g++
Flags
ARCH_FLAGS=-m64
CFLAGS=-Wextra -Wall -pedantic-errors $(ARCH_FLAGS) -O3
LDFLAGS=$(ARCH_FLAGS)
DEFINES=
INCLUDES=-I$(OPENCV_PATH)/include -Iinclude/
#LIBRARIES=-L$(OPENCV_PATH)/lib -lopencv_core -lopencv_highgui -lopencv_imgproc -lopencv_objdetect
LIBRARIES=pkg-config --libs opencv
Files which require compiling
SOURCE_FILES=
src/lib/IO.cc
src/lib/PDM.cc
src/lib/Patch.cc
src/lib/CLM.cc
src/lib/FDet.cc
src/lib/PAW.cc
src/lib/FCheck.cc
src/lib/Tracker.cc
Source files which contain a int main(..) function
SOURCE_FILES_WITH_MAIN=src/exe/face_tracker.cc
End Configuration
SOURCE_OBJECTS=$(patsubst %.cc,%.o,$(SOURCE_FILES))
ALL_OBJECTS=
$(SOURCE_OBJECTS)
$(patsubst %.cc,%.o,$(SOURCE_FILES_WITH_MAIN))
DEPENDENCY_FILES=
$(patsubst %.o,%.d,$(ALL_OBJECTS))
all: bin/face_tracker
%.o: %.cc Makefile
@# Make dependecy file
$(CXX) -MM -MT $@ -MF $(patsubst %.cc,%.d,$<) $(CFLAGS) $(DEFINES) $(INCLUDES) $<
@# Compile
$(CXX) $(CFLAGS) $(DEFINES) $(INCLUDES) -c -o $@ $<
-include $(DEPENDENCY_FILES)
bin/face_tracker: $(ALL_OBJECTS)
$(CXX) $(LDFLAGS) -o $@ $(ALL_OBJECTS) $(LIBRARIES)
.PHONY: clean
clean:
@echo "Cleaning"
@for pattern in '~' '.o' '*.d' ; do
find . -name "$$pattern" | xargs rm ;
done

Reply to this email directly or view it on GitHub.

from facetracker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.