List:MySQL++« Previous MessageNext Message »
From:Warren Young Date:June 12 2013 2:52pm
Subject:Re: Help getting example to link - Ubuntu Raring
View as plain text  
On Jun 11, 2013, at 7:53 PM, Mark Douglas <dmarkd@stripped> wrote:

> My makefile:
> 
> CXX := g++
> CXXFLAGS := -I/usr/include/mysql -I/usr/include/mysql++
> LDFLAGS := -L/usr/lib -lmysqlpp -lmysqlclient_r
> EXECUTABLE := hello
> 
> all: $(EXECUTABLE)
> 
> clean:
>        rm -f $(EXECUTABLE) *.o

I think Mickael has identified the main problem, which is that the -l flags need to follow
the -o $(EXECUTABLE) bit.  He has merely missed the fact that GNU make ships with many
default rules, and you're using them implicitly.

I suspect you can fix your problem by splitting LDFLAGS:

LDFLAGS := -L/usr/lib
LIBS := -lmysqlpp -lmysqlclient_r
Thread
Help getting example to link - Ubuntu RaringMark Douglas12 Jun
  • Re: Help getting example to link - Ubuntu RaringMickael Wolff12 Jun
  • Re: Help getting example to link - Ubuntu RaringWarren Young12 Jun
    • Re: Help getting example to link - Ubuntu RaringMark Douglas12 Jun
      • Re: Help getting example to link - Ubuntu RaringMickael Wolff12 Jun
      • Re: Help getting example to link - Ubuntu RaringJonathan Wakely12 Jun
        • Re: Help getting example to link - Ubuntu RaringMark Douglas12 Jun
          • Re: Help getting example to link - Ubuntu RaringJonathan Wakely12 Jun
            • Re: Help getting example to link - Ubuntu RaringJonathan Wakely12 Jun
            • Re: Help getting example to link - Ubuntu RaringMark Douglas12 Jun
              • Re: Help getting example to link - Ubuntu RaringJonathan Wakely12 Jun
              • Re: Help getting example to link - Ubuntu RaringWarren Young12 Jun