Yes, I'm using a Makefile as per the document here:
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
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
> 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