List:MySQL++« Previous MessageNext Message »
From:Christophe-Marie Duquesne Date:July 10 2008 7:27am
Subject:Need help for compiling : ‘Transac tion’ is not a member of ‘mysqlpp’
View as plain text  
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)

Thread
Need help for compiling : ‘Transac tion’ is not a member of ‘mysqlpp’Christophe-Marie Duquesne10 Jul
  • Re: Need help for compiling : ‘Trans action’ is not a member of ‘mysqlpp’Christophe-Marie Duquesne10 Jul
    • Re: Need help for compiling : ‘Trans action’ is not a member of ‘mysqlpp’Christophe-Marie Duquesne10 Jul
      • Re: Need help for compiling : ‘Trans action’ is not a member of ‘mysqlpp’Christophe-Marie Duquesne10 Jul
        • Re: Need help for compiling : ‘Transaction’ is not a member of ‘mysqlpp’Warren Young10 Jul
          • Re: Need help for compiling : ‘Trans action’ is not a member of ‘mysqlpp’Christophe-Marie Duquesne10 Jul