List:MySQL++« Previous MessageNext Message »
From:guido-mysqlpp Date:September 3 2012 4:29pm
Subject:Mysql++ won't compile on CentOS 6 (patch included)
View as plain text  
Hi,

I have just tried to compile MySQL++ 3.1.0 on CentOS 6, using rpmbuild and the 
included spec file. Unfortunately, the compilation failed because one of the 
cpp file (ssx/genv2.cpp) failed to include the C header "string.h" when it 
needed to:

=============
g++ -c -o ssqlsxlat_genv2.o -Ilib      -I/usr/include/mysql -O2 -g 
./ssx/genv2.cpp
./ssx/genv2.cpp: In function 'bool generate_ssqls2(const char*, const 
ParseV2*)':
./ssx/genv2.cpp:70: error: 'strcmp' was not declared in this scope
make: *** [ssqlsxlat_genv2.o] Error 1
make: *** Waiting for unfinished jobs....
error: Bad exit status from /var/tmp/rpm-tmp.AbkTZr (%build)


RPM build errors:
    Bad exit status from /var/tmp/rpm-tmp.AbkTZr (%build)
=============

Here is a patch that will include the needed header:


=============
diff -ur mysql++-3.1.0-orig/ssx/genv2.cpp mysql++-3.1.0/ssx/genv2.cpp
--- mysql++-3.1.0-orig/ssx/genv2.cpp    2010-06-03 19:59:23.000000000 +0200
+++ mysql++-3.1.0/ssx/genv2.cpp 2012-09-03 18:11:49.705151656 +0200
@@ -32,6 +32,8 @@
 
 #include "parsev2.h"
 
+#include <string.h>
+
 #include <iostream>
 #include <fstream>
 #include <typeinfo>
=============

And here's a patch for the spec file to make sure it will actually use the 
patch above:

=============
--- mysql++-3.1.0-orig/mysql++.spec     2010-06-03 19:59:36.000000000 +0200
+++ rpmbuild/SPECS/mysql++.spec 2012-09-03 18:19:40.488155405 +0200
@@ -1,11 +1,12 @@
 Summary:    C++ wrapper for the MySQL C API
 Name:       mysql++
 Version:    3.1.0
-Release:    1%{?dist}
+Release:    2%{?dist}
 License:    LGPL
 Group:      Development/Libraries
 URL:        http://tangentsoft.net/mysql++/
 Source0:    http://tangentsoft.net/mysql++/releases/mysql++-%{version}.tar.gz
+Patch1:     mysql++-include-string.h.patch
 BuildRoot:  %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
 BuildRequires: mysql-devel
 
@@ -35,6 +36,7 @@
 
 %prep
 %setup -q
+%patch1 -p1
 
 # Fakery for nodoc case
 if [ ! -e doc/README-devel-RPM.txt ]
=============

Regards,
	Guido
Thread
Mysql++ won't compile on CentOS 6 (patch included)guido-mysqlpp3 Sep
  • Re: Mysql++ won't compile on CentOS 6 (patch included)Warren Young4 Sep
    • Re: Mysql++ won't compile on CentOS 6 (patch included)Guido Winkelmann4 Sep
      • Re: Mysql++ won't compile on CentOS 6 (patch included)Martin Gallwey4 Oct