Project

General

Profile

Build Errors

Added by Pony Dazzler almost 6 years ago

Apologies in advance for such a basic question; I am a beginner and I have encountered issues with building wt4.0.3.

I have spent the past 3 days trying to get wt.4.0.3 to build but I run into issues when running make. The process runs until about 75% of the way and then it fails when building wtdbomysql (screen-shot is attached; error is also posted below). Most of the errors I encountered were due to mysql 8.0 redefining certain data structures, but I was able to resolve those. Unfortunately I have not been able to figure out the remaining errors. I would appreciate it if anyone could offer me any suggestions on how I could resolve this. Thanks in advanced!

My Environment

Ubuntu 16.0.4, standard install no other directo

Installed Packages

g 4:5.3.1-1ubuntu1

g--5 5.4.0-6ubuntu1~16.04.9

g--5-multilib 5.4.0-6ubuntu1~16.04.9

g-multilib 4:5.3.1-1ubuntu1

gcc 4:5.3.1-1ubuntu1

gcc-5 5.4.0-6ubuntu1~16.04.9

gcc-5-multilib 5.4.0-6ubuntu1~16.04.9

gcc-multilib 4:5.3.1-1ubuntu1

libwt-common 3.3.4+dfsg-6ubuntu1

libwt-dbg 3.3.4+dfsg-6ubuntu1

libwt-dev 3.3.4+dfsg-6ubuntu1

libwt-doc 3.3.4+dfsg-6ubuntu1

libwt38 3.3.4+dfsg-6ubuntu1

libwtdbo-dev 3.3.4+dfsg-6ubuntu1

libwtdbo38 3.3.4+dfsg-6ubuntu1

libwtdbofirebird-dev 3.3.4+dfsg-6ubuntu1

libwtdbofirebird38 3.3.4+dfsg-6ubuntu1

libwtdbomysql-dev 3.3.4+dfsg-6ubuntu1

libwtdbomysql38 3.3.4+dfsg-6ubuntu1

libwtdbopostgres-dev 3.3.4+dfsg-6ubuntu1

libwtdbopostgres38 3.3.4+dfsg-6ubuntu1

libwtdbosqlite-dev 3.3.4+dfsg-6ubuntu1

libwtdbosqlite38 3.3.4+dfsg-6ubuntu1

libwtext-dev 3.3.4+dfsg-6ubuntu1

libwtext38 3.3.4+dfsg-6ubuntu1

libwtfcgi-dev 3.3.4+dfsg-6ubuntu1

libwtfcgi38 3.3.4+dfsg-6ubuntu1

libwthttp-dev 3.3.4+dfsg-6ubuntu1

libwthttp38 3.3.4+dfsg-6ubuntu1

libwttest-dev 3.3.4+dfsg-6ubuntu1

libwttest8 3.3.4+dfsg-6ubuntu1

libxkbcommon0:amd64 0.5.0-1ubuntu2

mysql-apt-config 0.8.10-1

mysql-client 8.0.11-1ubuntu16.04

mysql-common 8.0.11-1ubuntu16.04

mysql-community-client 8.0.11-1ubuntu16.04

mysql-community-client-core 8.0.11-1ubuntu16.04

mysql-community-server 8.0.11-1ubuntu16.04

mysql-community-server-core 8.0.11-1ubuntu16.04

mysql-server 8.0.11-1ubuntu16.04

boosts is at 1.58

Error:

75%] Building CXX object src/Wt/Dbo/backend/CMakeFiles/wtdbomysql.dir/MySQL.C.o

/home/ken/Downloads/wt-4.0.3/src/Wt/Dbo/backend/MySQL.C: In constructor 'Wt::Dbo::backend::MySQLStatement::MySQLStatement(Wt::Dbo::backend::MySQL&, const string&)':

/home/ken/Downloads/wt-4.0.3/src/Wt/Dbo/backend/MySQL.C:131:34: error: expected primary-expression before 'struct'

(MYSQL_BIND )malloc(memset(struct st_mysql_bind) paramCount_);

^

/home/ken/Downloads/wt-4.0.3/src/Wt/Dbo/backend/MySQL.C:132:56: error: invalid application of 'sizeof' to incomplete type 'Wt::Dbo::backend::MySQLStatement::MySQLStatement(Wt::Dbo::backend::MySQL&, const string&)::st_mysql_bind'

std::memset(in_pars*, 0, sizeof(struct st_mysql_bind) * paramCount*);

^

/home/ken/Downloads/wt-4.0.3/src/Wt/Dbo/backend/MySQL.C: In member function 'virtual void Wt::Dbo::backend::MySQLStatement::bind(int, const time_point&, Wt::Dbo::SqlDateTimeType)':

/home/ken/Downloads/wt-4.0.3/src/Wt/Dbo/backend/MySQL.C:283:72: error: invalid application of 'sizeof' to incomplete type 'Wt::Dbo::backend::MySQLStatement::bind(int, const time_point&, Wt::Dbo::SqlDateTimeType)::st_mysql_time'

MYSQL_TIME* ts = (MYSQL_TIME*)malloc(sizeof(struct st_mysql_time));

^

/home/ken/Downloads/wt-4.0.3/src/Wt/Dbo/backend/MySQL.C: In member function 'virtual void Wt::Dbo::backend::MySQLStatement::bind(int, const std::chrono::duration<int, std::ratio<1l, 1000l> >&)':

/home/ken/Downloads/wt-4.0.3/src/Wt/Dbo/backend/MySQL.C:329:73: error: invalid application of 'sizeof' to incomplete type 'Wt::Dbo::backend::MySQLStatement::bind(int, const std::chrono::duration<int, std::ratio<1l, 1000l> >&)::st_mysql_time'

MYSQL_TIME* ts = (MYSQL_TIME *)malloc(sizeof(struct st_mysql_time));

^

/home/ken/Downloads/wt-4.0.3/src/Wt/Dbo/backend/MySQL.C: In member function 'void Wt::Dbo::backend::MySQLStatement::bind_output()':

/home/ken/Downloads/wt-4.0.3/src/Wt/Dbo/backend/MySQL.C:824:63: error: invalid application of 'sizeof' to incomplete type 'Wt::Dbo::backend::MySQLStatement::bind_output()::st_mysql_bind'

mysql_num_fields(result_) * sizeof(struct st_mysql_bind));

^

/home/ken/Downloads/wt-4.0.3/src/Wt/Dbo/backend/MySQL.C:826:58: error: invalid application of 'sizeof' to incomplete type 'Wt::Dbo::backend::MySQLStatement::bind_output()::st_mysql_bind'

mysql_num_fields(result_) * sizeof(struct st_mysql_bind));

^

/home/ken/Downloads/wt-4.0.3/src/Wt/Dbo/backend/MySQL.C:865:62: error: invalid application of 'sizeof' to incomplete type 'Wt::Dbo::backend::MySQLStatement::bind_output()::st_mysql_time'

out_pars_[i].buffer = malloc(sizeof(struct st_mysql_time));

^

/home/ken/Downloads/wt-4.0.3/src/Wt/Dbo/backend/MySQL.C:866:62: error: invalid application of 'sizeof' to incomplete type 'Wt::Dbo::backend::MySQLStatement::bind_output()::st_mysql_time'

out_pars_[i].buffer_length = sizeof(struct st_mysql_time);

^

src/Wt/Dbo/backend/CMakeFiles/wtdbomysql.dir/build.make:62: recipe for target 'src/Wt/Dbo/backend/CMakeFiles/wtdbomysql.dir/MySQL.C.o' failed

make[2]: * [src/Wt/Dbo/backend/CMakeFiles/wtdbomysql.dir/MySQL.C.o] Error 1

CMakeFiles/Makefile2:1147: recipe for target 'src/Wt/Dbo/backend/CMakeFiles/wtdbomysql.dir/all' failed

make[1]: * [src/Wt/Dbo/backend/CMakeFiles/wtdbomysql.dir/all] Error 2

Makefile:127: recipe for target 'all' failed

make: * [all] Error 2


Replies (5)

RE: Build Errors - Added by Mark Petryk almost 6 years ago

Pony, I'm wondering about the 'version' of the mysql lib.

Also, can you paste in here your build script? This is mine:

mark@lsus1:~$ cat ../serveradmin/bin/wt4-make.sh 
#
# To set up Wt build environment
#
# 1. install build tools;
#      build-essential
#      cmake
#      libboost-all-dev
#      doxygen
#      imagemagick
#      php5-imagick
#      graphicsmagick
#      libssl-dev
#      libgraphicsmagick++1-dev
#      libhpdf-dev
#      libpango1.0-dev
#      libghc-openglraw-dev
#      libpqxx3-dev
#      freeglut3-dev
#
# 2. install and build wt
#      mkdir ~/projects/wt
#      cd ~/projects
#      git clone git://github.com/kdeforche/wt.git
#      cd wt
#      mkdir build
#      cd build


cmake \
  -DCMAKE_INSTALL_PREFIX=/opt/Wt4 \
  -DWT_WRASTERIMAGE_IMPLEMENTATION=GraphicsMagick \
  -DCONNECTOR_FCGI=OFF \
  ..

RE: Build Errors - Added by Pony Dazzler almost 6 years ago

Hi Mark,

Thanks for responding! Your suggestion had me thinking regarding the mysql libs so out of curiosity I spun a virtual machine and installed ubuntu from scratch to get a clean set of libraries. I still ran into the same types of errors,

anyway here are the mysql lib packages installed on my system referenced from the first post.

ii libmysql-dev 3.2.2+pristine-1 amd64 MySQL C library bindings (development)

ii libmysql+3v5 3.2.2+pristine-1 amd64 MySQL C+ library bindings (runtime)

ii libmysqlclient-dev 8.0.11-1ubuntu16 amd64 MySQL development headers

ii libmysqlclient20:amd64 5.7.22-0ubuntu0. amd64 MySQL database client library

ii libmysqlclient21:amd64 8.0.11-1ubuntu16 amd64 MySQL shared client libraries

ii libmysqlcppconn-dev 1.1.7-0ubuntu1 amd64 MySQL Connector for C (development files)

ii libmysqlcppconn7v5 1.1.7-0ubuntu1 amd64 MySQL Connector for C (library)

As far as the build script goes, I didn't create a script per se, I used the installation instructions from Wt site and they were similar to what you posted.

all build tools were installed.

1.) download wt-4.0.3.tar.zip

2.) unzip and tar -xvf wt-4.0.3.tar

3.) cd wt-4.0.3

4.) mkdir build

5.) cd build

6.) cmake ..

cmake file is attached.

Thanks again for your help!

Makefile (40 KB) Makefile

RE: Build Errors - Added by Mark Petryk almost 6 years ago

Can you wipe your build folder and re-run cmake and paste that output here.

RE: Build Errors - Added by Pony Dazzler almost 6 years ago

Hi Mark!

I was able to install latest version of wt thanks to your suggestion. So here is what I found:

When I upgrade mysql server to version 8 from 5.7 a new <mysql.h> file was included. The newer version of the include file contained structural changes that caused compiling issues; see link below:

[[https://bugs.mysql.com/bug.php?id=87337\]]

So what I ended up doing on my vm setup was installing mysql 5.7 which included the older version of <mysql.h>. Once I installed mysql I and rebuilt Wt and everything was successful. I was able to run some of the exampmles.

Thanks again for your suggestion!

Pd

RE: Build Errors - Added by Roel Standaert almost 6 years ago

Wt::Dbo was indeed not compatible with MySQL 8 yet. I just fixed that in my latest push to GitHub.

Regards,

Roel

    (1-5/5)