[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Compiling mysql-ruby-2.8 problems

Alex 2k8

1/28/2009 10:18:00 PM

Hello,

I am trying to compile mysql-ruby-2.8
(http://rubyforge.org/frs/?gro...) 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
--
Posted via http://www.ruby-....

5 Answers

Alex 2k8

1/29/2009 1:45:00 AM

0

I have compiled it (had wrong environment), but still don't understand
how have_library works. So explanations are welcome :-)
--
Posted via http://www.ruby-....

Alex 2k8

1/29/2009 1:52:00 PM

0

Alex 2k8 wrote:
> 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.
--
Posted via http://www.ruby-....

Kz Byz

4/6/2009 12:15:00 AM

0

Alex 2k8 wrote:
> 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

--
Posted via http://www.ruby-....

Raveendran Jazzez

4/6/2009 6:15:00 AM

0

Kz Byz wrote:


> 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

Hi Kz,

In case you are working in Windows then do this.

1. Download the attachment dll from
http://www.dll-files.com/dllindex/dll-files.shtm...
2.SAVE that file into c:\ruby\bin3. gem install mysql
4. CHECK your code now..


Regards,
P.Raveendran
http://raveendran.wor...
--
Posted via http://www.ruby-....

Alex 2k8

4/6/2009 9:50:00 AM

0

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
--
Posted via http://www.ruby-....