0

Would you give me a hand to solve problems related to Makefile working on(Linux, Cygwin). I want to make binary files by using Makefile. I've currently conducted a project about 3d reconstruction. I've use Linux(Ubuntu) and Cygwin(Windows). There are some problems when i used Makefile included with source codes.(I received from online). I entered 'make' on command line and I got errors related to Make. Here these are.

[Type1]

make[1]: Entering directory `/home/curtis/bundlersrc/lib/5point'
make[1]: Nothing to be done for `all'.
make[3]: Entering directory `/home/curtis/bundlersrc/lib/ann_1.1_char/src'
make[3]: Nothing to be done for `targets'.
make[1]: Entering directory `/home/curtis/bundlersrc/lib/imagelib'
make[1]: Nothing to be done for `all'.

[Type2]

BundlerApp.h:620:32: error: cannot call constructor ‘SkeletalApp::BundlerApp’ directly [-fpermissive]
BundlerApp::BundlerApp();                              ^
BundlerApp.h:620:32: error:   for a function-style cast, remove the     redundant ‘::BundlerApp’ [-fpermissive]
BundlerApp.cpp: In member function ‘virtual void     BundlerApp::ProcessOptions(int, char**)’:

[Type3]

make[1]: Leaving directory `/home/curtis/bundlersrc/src'
make: *** [default] Error 2

One of Make file contains like these shell code

LIB = lib5point.a

TARGET = $(LIB)
OBJS = 5point.o poly1.o poly3.o

CC=gcc
OPTFLAGS=-O3
OTHERFLAGS=-Wall

MATRIX_PATH=../matrix
IMAGELIB_PATH=../imagelib

CPPFLAGS = $(OTHERFLAGS) $(OPTFLAGS) -I$(MATRIX_PATH) -I$(IMAGELIB_PATH)

all: $(TARGET)

$(TARGET): $(OBJS)
    ar r $@ $(OBJS)
    cp $@ ..

clean: 
    rm -f $(TARGET) *.o *~

I couldn't understand why errors came up and about (.a)file. Is there a something wrong?


Top level Makefile contains these code

ANN_TARGET = linux-g++-shared

OS = $(shell uname -o)
ifeq ($(OS), Cygwin)
ANN_TARGET = win32-g++-shared
endif

default:
# Make libraries
    cd lib/5point; $(MAKE)
    cd lib/ann_1.1_char; $(MAKE) $(ANN_TARGET)
    cd lib/imagelib; $(MAKE)
    cd lib/matrix; $(MAKE)
    cd lib/sba-1.5; $(MAKE)
    cd lib/sfm-driver; $(MAKE)
# Auxiliary libraries
    cd lib/lapack; $(MAKE)
    cd lib/minpack; $(MAKE)
    cd lib/blas; $(MAKE)
    cd lib/cblas; $(MAKE)
    cd lib/f2c; $(MAKE)
# Main program
    cd src; $(MAKE)


clean:
    cd lib/5point; $(MAKE) clean
    cd lib/ann_1.1_char; $(MAKE) clean
    cd lib/imagelib; $(MAKE) clean
    cd lib/matrix; $(MAKE) clean
    cd lib/sba-1.5; $(MAKE) clean
    cd lib/sfm-driver; $(MAKE) clean
    cd lib/lapack; $(MAKE) clean
    cd lib/minpack; $(MAKE) clean
    cd lib/blas; $(MAKE) clean
    cd lib/cblas; $(MAKE) clean
    cd lib/f2c; $(MAKE) clean
    cd src; $(MAKE) clean
    rm -f bin/bundler bin/KeyMatchFull
    rm -f lib/*.a`

Thanks for reading my question,

publy
  • 3
  • 3

1 Answers1

0

All of these are not make errors. Let's see what we have:

  • make[1]: Nothing to be done for all

To be an effective tool, make looks if the target files are already present and if they are up-to-date (Last modification time). If all of your targets are present and up-to-date you do not have to run the commands specified and make will report Nothing to be done for $target

  • make: *** [default] Error 2

This means that one command make issued exited with code 2 (which is not 0 and therefore considered a failure). To fix this, you have to look at your command, gcc. You see in Type 2 what is wrong, a programming mistake, which is not easy to resolve if you don't provide the code.

  • Entering/Leaving directory $dir

Nothing to worry about here, too. It's just an info message to tell you what make is currently doing.

Your Makefiles look fine to me. Just fix your code (BundlerApp) and you should be fine. Just by looking at the gcc errors, maybe this can help: C++ Cannot call constructor ' ' directly But as I said, without actual code it's just guessing.

Community
  • 1
  • 1
flowit
  • 1,382
  • 1
  • 10
  • 36