Trying to compile mysqlcc-0.9.8 - please help - FC10 with g++ 4.3.2
ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Trying to compile mysqlcc-0.9.8 - please help - FC10 with g++ 4.3.2
Hi guys
I'm trying to compile mysqlcc-0.9.8 from source but compilation breaks in main.cpp:
Code:
src/main.cpp:93: error: ‘gptr’ was not declared in this scope
src/main.cpp:93: error: expected primary-expression before ‘)’ token
src/main.cpp:94: error: ‘gptr’ was not declared in this scope
src/main.cpp:94: error: expected primary-expression before ‘)’ token
src/main.cpp:97: error: ‘gptr’ was not declared in this scope
src/main.cpp:97: error: expected primary-expression before ‘)’ token
src/main.cpp:98: error: ‘gptr’ was not declared in this scope
src/main.cpp:98: error: expected primary-expression before ‘)’ token
src/main.cpp:101: error: ‘gptr’ was not declared in this scope
src/main.cpp:101: error: expected primary-expression before ‘)’ token
src/main.cpp:101: error: ‘gptr’ was not declared in this scope
src/main.cpp:101: error: expected primary-expression before ‘)’ token
src/main.cpp:105: error: ‘gptr’ was not declared in this scope
src/main.cpp:105: error: expected primary-expression before ‘)’ token
src/main.cpp:105: error: ‘gptr’ was not declared in this scope
src/main.cpp:105: error: expected primary-expression before ‘)’ token
src/main.cpp:110: error: ‘gptr’ was not declared in this scope
src/main.cpp:110: error: expected primary-expression before ‘)’ token
src/main.cpp:111: error: ‘gptr’ was not declared in this scope
src/main.cpp:111: error: expected primary-expression before ‘)’ token
src/main.cpp:113: error: ‘gptr’ was not declared in this scope
src/main.cpp:113: error: expected primary-expression before ‘)’ token
src/main.cpp:114: error: ‘gptr’ was not declared in this scope
src/main.cpp:114: error: expected primary-expression before ‘)’ token
src/main.cpp:118: error: invalid conversion from ‘int’ to ‘void*’
src/main.cpp: In function ‘my_bool get_one_option(int, const my_option*, char*)’:
src/main.cpp:158: warning: deprecated conversion from string constant to ‘char*’
make: *** [tmp/main.o] Error 1
[rylan@StefanLinux mysqlcc-0.9.8]$
I'm in Fedore Core 10, trying to compile with g++ 4.3.2 that came with the distro.
I've looked around and this seems to be a simple semantic issue with g++ 4.3.2. I remember compiling this same program fine with the g++ that came with Fedora Core 6.
Two questions then:
1. What type of pointer must qptr be?
I guess
Code:
static ulong qptr*;
??
2. What are the semantics that are wrong?
How can I specify structure members correctly so g++ 4.3.2 will accept the definition?
Eventually, all that I could do was to comment out the entire section out of the declaration. I guess this gives me a bit of a broken mysqlcc, but it DOES work:
In main.cpp, change
Code:
static my_option my_long_options[] =
{
{"compress", 'C', "Use compression in server/client protocol.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"blocking_queries", 'b', "Use blocking queries.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"syntax", 'y', "Enable syntax highlighting and completion.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"database", 'd', "Database to use.", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"host", 'h', "Connect to host", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"user", 'u', "User for login if not current user.", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"password", 'p',
"Password to use when connecting to server. If password is not given, MySQL Control Center will prompt for the password.",
0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
{"port", 'P', "Port number to use for connection.", 0, 0, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#ifndef WIN32
{"socket", 'S', "Socket file to use for connection.", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#endif
{"connection_name", 'c', "This is a synonym for --server.", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"server", 's', "MySQL Control Center connection name.", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"query", 'q', "Open a query window on startup.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"register", 'r', "Open the 'Register Server' dialog on startup.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"help", '?', "Display this help and exit.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"syntax_file", 'Y', "Syntax file for completion.", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"history_size", 'H', "History size for the query window.", 0, 0, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"translations_path", 'T', "Path to the directory where MySQL Control Center translations are located.",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"plugins_path", 'g', "Path to the directory where MySQL Control Center plugins are located.",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"version", 'V', "Print version information and exit.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"connect_timeout", OPT_CONNECT_TIMEOUT, "", (uchar**) &opt_connect_timeout,
(uchar**) &opt_connect_timeout, 0, GET_ULONG, REQUIRED_ARG, 0, 0, 3600*12, 0,
0, 1},
{"select_limit", OPT_SELECT_LIMIT, "", (uchar**) &select_limit,
(uchar**) &select_limit, 0, GET_ULONG, REQUIRED_ARG, 1000L, 1, ~0L, 0, 1, 0},
{"net_buffer_length", OPT_NET_BUFFER_LENGTH, "",
(uchar**) &my_net_buffer_length, (uchar**) &my_net_buffer_length, 0, GET_ULONG,
REQUIRED_ARG, 16384, 1024, 512*1024*1024L, 0, 1024, 0},
{"max_allowed_packet", OPT_MAX_ALLOWED_PACKET, "",
(uchar**) &my_max_allowed_packet, (uchar**) &my_max_allowed_packet, 0, GET_ULONG,
REQUIRED_ARG, 16 *1024L*1024L, 4096, 512*1024L*1024L, 0,
1024, 0},
{"local-infile", OPT_LOCAL_INFILE, "Enable/disable LOAD DATA LOCAL INFILE.",
(uchar**) &opt_local_infile,
(uchar**) &opt_local_infile, 0, GET_BOOL, OPT_ARG, 0, 0, 0, 0, 0, 0},
{"max_join_size", OPT_MAX_JOIN_SIZE, "", (uchar**) &max_join_size,
(uchar**) &max_join_size, 0, GET_ULONG, REQUIRED_ARG, 1000000L, 1, ~0L, 0, 1,
0},
{ 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
};
to
Code:
static my_option my_long_options[] =
{
{"compress", 'C', "Use compression in server/client protocol.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"blocking_queries", 'b', "Use blocking queries.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"syntax", 'y', "Enable syntax highlighting and completion.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"database", 'd', "Database to use.", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"host", 'h', "Connect to host", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"user", 'u', "User for login if not current user.", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"password", 'p',
"Password to use when connecting to server. If password is not given, MySQL Control Center will prompt for the password.",
0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
{"port", 'P', "Port number to use for connection.", 0, 0, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#ifndef WIN32
{"socket", 'S', "Socket file to use for connection.", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#endif
{"connection_name", 'c', "This is a synonym for --server.", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"server", 's', "MySQL Control Center connection name.", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"query", 'q', "Open a query window on startup.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"register", 'r', "Open the 'Register Server' dialog on startup.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"help", '?', "Display this help and exit.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"syntax_file", 'Y', "Syntax file for completion.", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"history_size", 'H', "History size for the query window.", 0, 0, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"translations_path", 'T', "Path to the directory where MySQL Control Center translations are located.",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"plugins_path", 'g', "Path to the directory where MySQL Control Center plugins are located.",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"version", 'V', "Print version information and exit.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
/*
{"connect_timeout", OPT_CONNECT_TIMEOUT, "", (uchar**) &opt_connect_timeout,
(uchar**) &opt_connect_timeout, 0, GET_ULONG, REQUIRED_ARG, 0, 0, 3600*12, 0,
0, 1},
{"select_limit", OPT_SELECT_LIMIT, "", (uchar**) &select_limit,
(uchar**) &select_limit, 0, GET_ULONG, REQUIRED_ARG, 1000L, 1, ~0L, 0, 1, 0},
{"net_buffer_length", OPT_NET_BUFFER_LENGTH, "",
(uchar**) &my_net_buffer_length, (uchar**) &my_net_buffer_length, 0, GET_ULONG,
REQUIRED_ARG, 16384, 1024, 512*1024*1024L, 0, 1024, 0},
{"max_allowed_packet", OPT_MAX_ALLOWED_PACKET, "",
(uchar**) &my_max_allowed_packet, (uchar**) &my_max_allowed_packet, 0, GET_ULONG,
REQUIRED_ARG, 16 *1024L*1024L, 4096, 512*1024L*1024L, 0,
1024, 0},
{"local-infile", OPT_LOCAL_INFILE, "Enable/disable LOAD DATA LOCAL INFILE.",
(uchar**) &opt_local_infile,
(uchar**) &opt_local_infile, 0, GET_BOOL, OPT_ARG, 0, 0, 0, 0, 0, 0},
{"max_join_size", OPT_MAX_JOIN_SIZE, "", (uchar**) &max_join_size,
(uchar**) &max_join_size, 0, GET_ULONG, REQUIRED_ARG, 1000000L, 1, ~0L, 0, 1,
0},
*/
{ 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
};
i. e. comment all lines with (uchar**) references, so they don't get compiled and
at last doing THAT made the
Code:
src/main.cpp:118: error: invalid conversion from ‘int’ to ‘void*’
go away, and the program finished compiling and seems to work.
Anybody got any idea why, putting the commented lines above in the declaration, make g++ 4.3.2 fail?
Hi, thanks for your post. My mysqlcc install recently broke with an update to Fedora 12. I got errors about mismatched mysql lib versions. Trying to compile from source I got the same errors as you. You comment solution worked great, I'm not good enough at C++ to try to find the proper solution.
Not sure why no one maintains this program, it's the best quick field editor out there that I've found so far.
Distribution: pclos2010.12, Slack1337 DebSqueeze, +50+ other Linux OS, for test only.
Posts: 9,312
Rep:
Post 6 , @ tcordes
May be try out the Debian patches for gmysqlcc
( I don't know, if gmysqlcc does the same as mysqlcc.) http://packages.debian.org/sid/gmysqlcc
→ → [gmysqlcc_0.3.0-2.diff.gz] http://ftp.de.debian.org/debian/pool....3.0-2.diff.gz
1) zcat gmysqlcc_0.3.0-2.diff.gz | patch -p1
2) patch -p0 debian/patches/dont_override_cflags.patch
3) patch -p0 debian/patches/no_encoding_at_desktop.patch
-----------------------------------------------
...... And later I found this :
'Niels Horn's Blog' about mysqlcc ( 17 - June 2010 ) http://blog.nielshorn.net/2010/06/ge...mysql-headers/
Includes a patch. ( To use gcc-4.4.4 it seems.)
-----------------------------------------------
..
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.