LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 02-09-2009, 01:42 PM   #1
rylan76
Senior Member
 
Registered: Apr 2004
Location: Potchefstroom, South Africa
Distribution: Fedora 17 - 3.3.4-5.fc17.x86_64
Posts: 1,475

Rep: Reputation: 87
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]$
The offending lines look like this:

Code:
static struct my_option my_long_options[] =
{
.
.
93: {"connect_timeout", OPT_CONNECT_TIMEOUT, "", (gptr*) &opt_connect_timeout,
   (gptr*) &opt_connect_timeout, 0, GET_ULONG, REQUIRED_ARG, 0, 0, 3600*12, 0,
   0, 1},

  {"select_limit", OPT_SELECT_LIMIT, "", (gptr*) &select_limit,
   (gptr*) &select_limit, 0, GET_ULONG, REQUIRED_ARG, 1000L, 1, ~0L, 0, 1, 0},
  
  {"net_buffer_length", OPT_NET_BUFFER_LENGTH, "",
   (gptr*) &my_net_buffer_length, (gptr*) &my_net_buffer_length, 0, GET_ULONG,
   REQUIRED_ARG, 16384, 1024, 512*1024*1024L, 0, 1024, 0},

  {"max_allowed_packet", OPT_MAX_ALLOWED_PACKET, "",
   (gptr*) &my_max_allowed_packet, (gptr*) &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.",
   (gptr*) &opt_local_infile,
   (gptr*) &opt_local_infile, 0, GET_BOOL, OPT_ARG, 0, 0, 0, 0, 0, 0},

  {"max_join_size", OPT_MAX_JOIN_SIZE, "", (gptr*) &max_join_size,
   (gptr*) &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'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?

This

Code:
93: {"connect_timeout", OPT_CONNECT_TIMEOUT, "", (gptr*) &opt_connect_timeout,
   (gptr*) &opt_connect_timeout, 0, GET_ULONG, REQUIRED_ARG, 0, 0, 3600*12, 0,
   0, 1},
is considered -wrong- by g++ 4.3.2, rejected with

Code:
src/main.cpp:93: error: ‘gptr’ was not declared in this scope
src/main.cpp:93: error: expected primary-expression before ‘)’ token
So how can I fix the
Code:
src/main.cpp:93: error: expected primary-expression before ‘)’ token
error? What must the definition statement look like to have a "primary-expression" beforre "')'" token?

ANY help or ideas appreciated!

Thanks,

Last edited by rylan76; 02-09-2009 at 01:44 PM.
 
Old 02-09-2009, 02:27 PM   #2
rylan76
Senior Member
 
Registered: Apr 2004
Location: Potchefstroom, South Africa
Distribution: Fedora 17 - 3.3.4-5.fc17.x86_64
Posts: 1,475

Original Poster
Rep: Reputation: 87
Well I've discovered that this

Code:
static ulong gptr*;

static struct my_option my_long_options[] =
{
.
.
93: {"connect_timeout", OPT_CONNECT_TIMEOUT, "", (gptr*) &opt_connect_timeout,
   (gptr*) &opt_connect_timeout, 0, GET_ULONG, REQUIRED_ARG, 0, 0, 3600*12, 0,
   0, 1},
.
.
.
}
should look like this

Code:
//static ulong gptr*; <<<---- remove this

static struct my_option my_long_options[] =
{
.
.
93: {"connect_timeout", OPT_CONNECT_TIMEOUT, "", (ulong*) &opt_connect_timeout,
   (ulong*) &opt_connect_timeout, 0, GET_ULONG, REQUIRED_ARG, 0, 0, 3600*12, 0,
   0, 1},
.
.
.
}
That solves some of the compile errors under g++ 4.3.2 - on to the rest...

Last edited by rylan76; 02-09-2009 at 02:34 PM.
 
Old 02-09-2009, 02:33 PM   #3
rylan76
Senior Member
 
Registered: Apr 2004
Location: Potchefstroom, South Africa
Distribution: Fedora 17 - 3.3.4-5.fc17.x86_64
Posts: 1,475

Original Poster
Rep: Reputation: 87
Fixing some more errors has revealed that this:

Code:
static struct my_option my_long_options[] =
{
.
.
93: {"connect_timeout", OPT_CONNECT_TIMEOUT, "", (ulong*) &opt_connect_timeout,
   (gptr*) &opt_connect_timeout, 0, GET_ULONG, REQUIRED_ARG, 0, 0, 3600*12, 0,
   0, 1},
.
.
.
}
should be

Code:
static struct my_option my_long_options[] =
{
.
.
93: {"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},
.
.
.
}
Almost there...
 
Old 02-09-2009, 02:59 PM   #4
rylan76
Senior Member
 
Registered: Apr 2004
Location: Potchefstroom, South Africa
Distribution: Fedora 17 - 3.3.4-5.fc17.x86_64
Posts: 1,475

Original Poster
Rep: Reputation: 87
No luck.

This

Code:
static struct my_option my_long_options[] =
{
.
.
93: {"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},
.
.
.
} //<<<<--- this is line 118.
Just keeps on giving

Code:
src/main.cpp:118: error: invalid conversion from ‘int’ to ‘void*’
Weird - so the entire structure is now valid, but the compiler breaks on the } on the line closing the structure... DAMN!

Anybody have any ideas?
 
Old 02-09-2009, 03:16 PM   #5
rylan76
Senior Member
 
Registered: Apr 2004
Location: Potchefstroom, South Africa
Distribution: Fedora 17 - 3.3.4-5.fc17.x86_64
Posts: 1,475

Original Poster
Rep: Reputation: 87
Post

Got It - sorta.

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?

Thanks

Last edited by rylan76; 02-09-2009 at 03:18 PM.
 
Old 07-02-2010, 12:52 PM   #6
tcordes
LQ Newbie
 
Registered: Jan 2005
Location: Winnipeg, MB, Canada
Distribution: FC3
Posts: 4

Rep: Reputation: 0
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.
 
Old 07-02-2010, 01:17 PM   #7
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 13,522

Rep: Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503
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

There is also an SRC.RPM, gmysqlcc-0.3.0-3mdv2009.1.src.rpm
http://ftp.linux.org.tr/mandriva/cur...2009.1.src.rpm
The files have a time stamp 'February 2008'.

-----------------------------------------------
...... 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.)
-----------------------------------------------
..

Last edited by knudfl; 07-02-2010 at 03:42 PM.
 
  


Reply

Tags
before, c++, expected, g++, token


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[ubuntu] Mysqlcc Flippje Linux - Newbie 1 11-20-2005 06:39 PM
Mysqlcc connection denied BlackHatRob Linux - Software 1 09-15-2005 09:34 PM
mysqlcc on windows error thack111 Linux - Newbie 4 10-23-2003 07:23 AM
mysqlcc tutorial noshellswill Linux - Software 5 09-09-2003 09:35 AM
MySQLCC rivang Linux - Software 2 06-07-2003 10:11 PM


All times are GMT -5. The time now is 01:35 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration