Page 1 of 1

Mysql with libmysql

Posted: Fri Mar 02, 2018 9:52 am
by mauriegio
Hello at all,

i can't load a library for example ..

Ret = OpenLibrary(#PB_Any, "libmysql.dll")

Debug Ret

Return 0

the libmysql.dll is in the same directory of the program and 64 bit version as
purebasic and windows 10.

The libmysql.dll version is 6.1 ..

what is the problem

thanks

Re: Mysql with libmysql

Posted: Fri Mar 02, 2018 10:10 am
by Bitblazer
check compiler options and there the compile/run tab

Whenever relative paths fail, you should use an absolute path to make sure the location is not the problem (or use PB commands to check the local path at execution time with GetCurrentDirectory() since it depends on your compiler settings). It could be an architecture problem (32/64 bit) but you said you checked that. Anyway i wonder why you try to load mysql like that, have you looked into help and "database" and does the "database.pb" example work for you?

Re: Mysql with libmysql

Posted: Fri Mar 02, 2018 10:17 am
by mauriegio
Thanks for answer ,

yes i tryed with absolute path but nothing to do ...

Option compiler is ok ...

thanks for your help

Re: Mysql with libmysql

Posted: Fri Mar 02, 2018 9:47 pm
by infratec
Hi,

have you checked this thread?
http://www.purebasic.fr/english/viewtop ... 12&t=56390

Bernd

Re: Mysql with libmysql

Posted: Thu Mar 08, 2018 4:02 pm
by mauriegio
Yes, i tryed it

but nothing to do ...

I working with windows 10 Home, and the error is on open library ....

I believe is a bug..

thanks

Maurizio

Re: Mysql with libmysql

Posted: Thu Mar 08, 2018 4:04 pm
by infratec
Hi,

the lib is there opened. So it is not a problem of PB.

Do you use PB x64? Is the dll for x64?

Re: Mysql with libmysql

Posted: Thu Mar 08, 2018 4:43 pm
by mauriegio
Sorry ,

thanks for the help

but the openlibrary return 0 and documentation tell me
that is an error.

thank

Maurizio

Re: Mysql with libmysql

Posted: Thu Mar 08, 2018 9:37 pm
by infratec
0 is an error.

That's why I asked for your PB version and your dll version.
You can not open a 23 bit dll with a x64 PB and vice versa.

Re: Mysql with libmysql

Posted: Fri Mar 09, 2018 9:00 am
by mauriegio
Sorry ,

i founded error my libmysql.dll was 32 bit in directory exe,
in windows the lib was x64 ...

Argh ..

Exscuse me for the error, thank for help ....

Purebasic is Great...

bye

Maurizio

Re: Mysql with libmysql

Posted: Fri Mar 09, 2018 10:53 am
by Marc56us
mauriegio wrote:Sorry ,
i founded error my libmysql.dll was 32 bit in directory exe,
in windows the lib was x64 ...
Dynamic-Link Library Search Order
https://msdn.microsoft.com/en-us/librar ... s.85).aspx
Purebasic is Great...
Yes 8)