Hi,
I get this error when compiling :
43: error: 'Transaction' is not a member of 'mysqlpp'
I don't understand why.
In the corresponding cpp file, line 43, I declare :
mysqlpp::Transaction trans(con); // con is a Connection I constructed before
In the .h, I have
#include <mysql++/mysql++.h>
using namespace mysqlpp;
As I use the 'using namespace mysqlpp' directive, I know I should not need
to declare trans as a mysqlpp::Transaction. Transaction should be enough.
Here is what happens if I remove the 'mysqlpp::'.
43: error: 'Transaction' was not declared in this scope
Honestly I don't understand what's happening. I have the feeling g++ thinks
mysqlpp is not a namespace but a class. Could you help me please?
Regards,
Christophe-Marie Duquesne
PS :
Less interesting, but for information, here are my compilation options in my
Makefile :
#The important part
MYSQLINCFLAGS = -I/usr/include/mysql -I/usr/include/mysql++
MYSQLLNFLAGS = -L/usr/lib/mysql -L/usr/local/lib/mysql++ -lmysqlpp
#just in case you want to check if there is something odd
EXEC = projet
LDFLAGS = $(MYSQLLNFLAGS) $(otherlinkflags)
CXXFLAGS = $(MYSQLINCFLAGS) $(otherincludeflags)
SRC = $(wildcard *.cpp)
OBJ = $(SRC:.cpp=.o)
all: $(EXEC)
projet: $(OBJ)
$(CPP) -o $@ $^ $(LDFLAGS)
%.o: %.cpp
$(CPP) -o $@ -c $< $(CXXFLAGS)