I am new to the mysql++ api, and I have run into a few problems with trying
to compile the exmaple simple1. The main issue that I see at this point has
to do with my linking. I have modeled my makefile after the Makefile.simple,
but not matter what I try I always end up with the same errrors.
Any help with this is greatly appreciated.
Here is my make file (I used bakefile to create):
# =========================================================================
# This makefile was generated by
# Bakefile 0.2.5 (http://www.bakefile.org)
# Do not modify, all changes will be overwritten!
# =========================================================================
# -------------------------------------------------------------------------
# These are configurable options:
# -------------------------------------------------------------------------
# C++ compiler
CXX = g++
# Standard flags for C++
CXXFLAGS ?=
# Standard preprocessor flags (common for CC and CXX)
CPPFLAGS ?=
# Standard linker flags
LDFLAGS ?=
# Set to 1 to build debug version [0,1]
DEBUG ?= 0
# -------------------------------------------------------------------------
# Do not modify the rest of this file!
# -------------------------------------------------------------------------
### Variables: ###
CPPDEPS = -MT$@ -MF`echo $@ | sed -e 's,\.o$$,.d,'` -MD -MP
MYSQLTEST_CXXFLAGS = $(____DEBUG_0_p) $(____DEBUG_1_2) $(____DEBUG_3) \
-Ilib -I/usr/include/mysql \
-I/usr/include/local/mysql++ $(CPPFLAGS) $(CXXFLAGS)
MYSQLTEST_OBJECTS = \
mysqlTest_mysqlTest.o
### Conditionally set variables: ###
ifeq ($(DEBUG),0)
____DEBUG_0_p = -DNDEBUG
endif
ifeq ($(DEBUG),1)
____DEBUG_0_p =
endif
ifeq ($(DEBUG),0)
____DEBUG_1_2 = -O2
endif
ifeq ($(DEBUG),1)
____DEBUG_1_2 = -O0
endif
ifeq ($(DEBUG),0)
____DEBUG_3 =
endif
ifeq ($(DEBUG),1)
____DEBUG_3 = -g
endif
### Targets: ###
all: mysqlTest
install:
uninstall:
clean:
rm -f ./*.o
rm -f ./*.d
rm -f mysqlTest
mysqlTest: $(MYSQLTEST_OBJECTS)
$(CXX) -o $@ $(MYSQLTEST_OBJECTS) $(____DEBUG_3) $(LDFLAGS)
-lmysqlpp_excommon -lmysqlpp -lmysqlclient
mysqlTest_mysqlTest.o: ./mysqlTest.cpp
$(CXX) -c -o $@ $(MYSQLTEST_CXXFLAGS) $(CPPDEPS) $<
.PHONY: all install uninstall clean
# Dependencies tracking:
-include ./*.d
These are the errors that I get.
**** Build of configuration Linux GCC for project mysqlTest ****
make all
mysqlTest.cpp:1:21: error: cmdline.h: No such file or directory
mysqlTest.cpp:2:23: error: printdata.h: No such file or directory
mysqlTest.cpp:4:22: error: mysql++.h: No such file or directory
g++ -c -o mysqlTest_mysqlTest.o -DNDEBUG -O2 -Ilib -I/usr/include/mysql
-I/usr/include/local/mysql++ -MTmysqlTest_mysqlTest.o -MF`echo
mysqlTest_mysqlTest.o | sed -e 's,\.o$,.d,'` -MD -MP mysqlTest.cpp
mysqlTest.cpp:45:2: warning: no newline at end of file
mysqlTest.cpp: In function 'int main(int, char**)':
mysqlTest.cpp:16: error: 'parse_command_line' was not declared in this scope
mysqlTest.cpp:21: error: 'mysqlpp' has not been declared
mysqlTest.cpp:21: error: expected `;' before 'conn'
mysqlTest.cpp:22: error: 'conn' was not declared in this scope
mysqlTest.cpp:25: error: 'mysqlpp' has not been declared
mysqlTest.cpp:25: error: expected `;' before 'query'
mysqlTest.cpp:26: error: 'mysqlpp' has not been declared
mysqlTest.cpp:26: error: expected `)' before 'res'
mysqlTest.cpp:28: error: 'mysqlpp' has not been declared
mysqlTest.cpp:28: error: expected `;' before 'it'
mysqlTest.cpp:29: error: 'it' was not declared in this scope
mysqlTest.cpp:29: error: 'res' was not declared in this scope
mysqlTest.cpp:30: error: 'mysqlpp' has not been declared
mysqlTest.cpp:30: error: expected `;' before 'row'
mysqlTest.cpp:31: error: 'row' was not declared in this scope
mysqlTest.cpp:35: error: 'query' was not declared in this scope
make: *** [mysqlTest_mysqlTest.o] Error 1