You are not logged in.

#1 2009-11-16 15:12:54

Bloged
Member
From: Bergschenhoek, Netherlands
Registered: 2008-11-11
Posts: 18

[solved] MySQL Connector C++ 1.0.5

Hello everyone,

I'm trying to connect to a MySQL db via C++. MySQL has the connector and API available for this. In the process of building this I've run into some troubles/questions.

First off is that MySQL states that MySQL Workbench uses this connector:

MySQL wrote:

Note that MySQL Workbench is successfully using MySQL Connector/C++.

source (at the bottom of the page) but I can't seem to find any files which are created by the connector itself.

Second is that when I create a package file it contains files that - I think - shouldn't be included (or at least not in those directories).
PKGBUILD used:

pkgname=mysql-connector-c++
pkgver=1.0.5
pkgrel=1
pkgdesc="MySQL Connector/C++ is a MySQL database connector for C++"
arch=(i686)
url="http://dev.mysql.com/doc/refman/5.1/en/connector-cpp.html"
license=('gpl')
depends=('mysql-clients')
makedepends=('cmake>=2.4' 'glibc>=2.2.3')
source=(http://download.softagency.net/MySQL/Downloads/Connector-C++/$pkgname-$pkgver.tar.gz)
md5sums=('f0ad6655f3ea7db8df3215fa928cba03') #generate with 'makepkg -g'

build() {
  cd "$srcdir/$pkgname-$pkgver"
  
  # remove file that is included in release but should be generated by cmake
  rm cppconn/config.h
  # remove some possible old cmake cache
  rm CMakeCache.txt
  
  # patch for use with gcc-4.4
  patch -p0 < ${startdir}/mysql-connector-cpp-1.0.5-gcc44.patch

  cmake -G "Unix Makefiles" .

  make clean
  make || return 1
  make DESTDIR="$pkgdir/" install
}

# vim:set ts=2 sw=2 et:

output of pacman -Qlp mysql-connector-c++-1.0.5-1-i686.pkg.tar.gz

mysql-connector-c++ /usr/
mysql-connector-c++ /usr/local/
mysql-connector-c++ /usr/local/ANNOUNCEMENT
mysql-connector-c++ /usr/local/COPYING
mysql-connector-c++ /usr/local/README
mysql-connector-c++ /usr/local/include/
mysql-connector-c++ /usr/local/include/cppconn/
mysql-connector-c++ /usr/local/include/cppconn/build_config.h
mysql-connector-c++ /usr/local/include/cppconn/config.h
mysql-connector-c++ /usr/local/include/cppconn/connection.h
mysql-connector-c++ /usr/local/include/cppconn/datatype.h
mysql-connector-c++ /usr/local/include/cppconn/driver.h
mysql-connector-c++ /usr/local/include/cppconn/exception.h
mysql-connector-c++ /usr/local/include/cppconn/metadata.h
mysql-connector-c++ /usr/local/include/cppconn/parameter_metadata.h
mysql-connector-c++ /usr/local/include/cppconn/prepared_statement.h
mysql-connector-c++ /usr/local/include/cppconn/resultset.h
mysql-connector-c++ /usr/local/include/cppconn/resultset_metadata.h
mysql-connector-c++ /usr/local/include/cppconn/statement.h
mysql-connector-c++ /usr/local/include/cppconn/warning.h
mysql-connector-c++ /usr/local/include/mysql_connection.h
mysql-connector-c++ /usr/local/include/mysql_driver.h
mysql-connector-c++ /usr/local/lib/
mysql-connector-c++ /usr/local/lib/libmysqlcppconn-static.a
mysql-connector-c++ /usr/local/lib/libmysqlcppconn.so
mysql-connector-c++ /usr/local/lib/libmysqlcppconn.so.1
mysql-connector-c++ /usr/local/lib/libmysqlcppconn.so.1.0.5

The files bothering me are:
/usr/local/ANNOUNCEMENT
/usr/local/COPYING
/usr/local/README

Anyone who can enlighten me?:rolleyes:

Thanks in advance,

Arjan Gelderblom

Last edited by Bloged (2009-11-17 09:27:49)


I think computer viruses should count as life. Maybe it says something about human nature, that the only form of life we have created so far is purely destructive. Talk about creating life in our own image.
-- Stephen Hawking

Offline

#2 2009-11-16 16:16:16

wonder
Developer
From: Bucharest, Romania
Registered: 2006-07-05
Posts: 5,941
Website

Re: [solved] MySQL Connector C++ 1.0.5

MySQL Workbench tarball has its own connecter in ext/ folder. is compiling from there and then, i think, links statically and that's why there is no mysql connector in mysql-workbench package. i think in the future, i'll use your build.

P.S use cmake -D CMAKE_INSTALL_PREFIX=/usr .  to be conform with arch standards

COPYING file you have to move it from there to  $pkgdir/usr/share/licenses/$pkgname/

Last edited by wonder (2009-11-16 16:24:14)


Give what you have. To someone, it may be better than you dare to think.

Offline

#3 2009-11-17 07:30:25

Bloged
Member
From: Bergschenhoek, Netherlands
Registered: 2008-11-11
Posts: 18

Re: [solved] MySQL Connector C++ 1.0.5

Thanks wonder for your reply.

How do I move files using PKGBUILD? I've found an install -D command but that looks at best at copying the file:

install -D COPYING $pkgdir/usr/share/licenses/$pkgname/COPYING

Another question is that the patch that is executed is only for gcc-4.4 is there a way to have an if statement for that?

Thanks in advance,

Arjan Gelderblom

Edit: a simple solution is to copy them using install -D and then remove them... is this the correct sollution?

Last edited by Bloged (2009-11-17 08:27:38)


I think computer viruses should count as life. Maybe it says something about human nature, that the only form of life we have created so far is purely destructive. Talk about creating life in our own image.
-- Stephen Hawking

Offline

#4 2009-11-17 09:22:01

wonder
Developer
From: Bucharest, Romania
Registered: 2006-07-05
Posts: 5,941
Website

Re: [solved] MySQL Connector C++ 1.0.5

Bloged wrote:

Thanks wonder for your reply.

How do I move files using PKGBUILD? I've found an install -D command but that looks at best at copying the file:

install -D COPYING $pkgdir/usr/share/licenses/$pkgname/COPYING

Another question is that the patch that is executed is only for gcc-4.4 is there a way to have an if statement for that?

no. we don't have any other version in our repo and that patch will work also with older gcc

Edit: a simple solution is to copy them using install -D and then remove them... is this the correct sollution?

yes. and remove the others two files as well.


Give what you have. To someone, it may be better than you dare to think.

Offline

#5 2009-11-17 09:27:23

Bloged
Member
From: Bergschenhoek, Netherlands
Registered: 2008-11-11
Posts: 18

Re: [solved] MySQL Connector C++ 1.0.5

Thanks for your help this one is solved right now... I will upload the patch + PKGBUILD to AUR asap.

Grtz,

Arjan Gelderblom

Edit: See http://aur.archlinux.org/packages.php?ID=32065 for package

Last edited by Bloged (2009-11-17 09:33:59)


I think computer viruses should count as life. Maybe it says something about human nature, that the only form of life we have created so far is purely destructive. Talk about creating life in our own image.
-- Stephen Hawking

Offline

Board footer

Powered by FluxBB