List:MySQL++« Previous MessageNext Message »
From:Mark Douglas Date:June 12 2013 3:49pm
Subject:Re: Help getting example to link - Ubuntu Raring
View as plain text  
Yes, I'm using a Makefile as per the document here:
http://tangentsoft.net/mysql++/doc/html/userman/incorporating.html#inc-unix

Not precisely sure how I'm "badly" using it as I've basically copy/pasted
from the documentation. Again, I'm trying to learn so any indication what
I'm doing wrong would be appreciated.

Anyway, as per Mickael's suggestion I tried to manually run this command
instead of using the Makefile - I think I understood correctly?

g++ -I/usr/include/mysql -I/usr/include/mysql++ hello.cpp -o hello
-L/usr/lib

This still generates the same linker errors. As for Warren's suggestion to
split LDFLAGS and LIBS into two lines in the Makefile, I receive the errors
doing that as well.

Thanks for the input so far, any further suggestions?


On Wed, Jun 12, 2013 at 8:52 AM, Warren Young <mysqlpp@stripped> wrote:

> 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
> --
> MySQL++ Mailing List
> For list archives: http://lists.mysql.com/plusplus
> To unsubscribe:    http://lists.mysql.com/plusplus
>
>

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