Compiling mysql-ruby-2.8 problems

A

Alex 2k8

Hello,

I am trying to compile mysql-ruby-2.8
(http://rubyforge.org/frs/?group_id=4550) on windows, but 'ruby
extconf.rb' reports such error:

- - - - -
checking for main() in libmysql.lib... no
- - - - -

The mkmf.log has:
- - - - -
checked program was:
/* begin */
1: #define WIN32_LEAN_AND_MEAN
2: #include <winsock2.h>
3: #include <windows.h>
4:
5: /*top*/
6: int main() { return 0; }
7: int t() { void ((*volatile p)()); p = (void ((*)()))main; return 0; }
/* end */
- - - - -

I see no mysql related headers to be included. I guess they are required
to declare 'main' symbol?


In extconf.rb I see:
- - - - -
require 'mkmf'

if /mswin32/ =~ RUBY_PLATFORM
inc, lib = dir_config('mysql')
exit 1 unless have_library("libmysql")
elseif ...
- - - - -

have_library("libmysql") specified only the library name but the headers
parameter is missed. So how it expected to know which mysql headers to
#include?

Also, this 'main' function checked... What is it? Why so odd symbol
name?

I am so confused... May be some one can clarify things :)

Thanks,
- Alex
 
A

Alex 2k8

I have compiled it (had wrong environment), but still don't understand
how have_library works. So explanations are welcome :)
 
A

Alex 2k8

Alex said:
I have compiled it (had wrong environment), but still don't understand
how have_library works. So explanations are welcome :)

Getcha. 'main' stands for 'int main()' and actually does nothing here,
as main is always present. The real check for library presense comes
from linker.
 
K

Kz Byz

Alex said:
I have compiled it (had wrong environment), but still don't understand
how have_library works. So explanations are welcome :)

Hello Alex

I m very knew to Ruby, and I m also having similar issue. i.e.
checking for main() in libmysql.lib... no

Can you please advise on the resolution

Thanks
Kraz
 
J

jazzez ravi

A

Alex 2k8

Hello, Kraz

The steps to get NMAKE was:

1. Start > Visual Studio 2008 > Visual Studio Tools > Visual Studio
Command Prompt

2. ruby extconf.rb
--with-mysql-include=C:\PROGRA~1\MYSQL\MYSQLS~1.1\INCLUDE
--with-mysql-lib=C:\PROGRA~1\MYSQL\MYSQLS~1.1\LIB\OPT\

Regards,
- Alex
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,968
Messages
2,570,152
Members
46,697
Latest member
AugustNabo

Latest Threads

Top