Mysql with libmysql

Just starting out? Need help? Post your questions and find answers here.
mauriegio
New User
New User
Posts: 7
Joined: Fri Mar 02, 2018 9:48 am

Mysql with libmysql

Post 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
Bitblazer
Enthusiast
Enthusiast
Posts: 761
Joined: Mon Apr 10, 2017 6:17 pm
Location: Germany
Contact:

Re: Mysql with libmysql

Post 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?
Last edited by Bitblazer on Fri Mar 02, 2018 10:20 am, edited 2 times in total.
mauriegio
New User
New User
Posts: 7
Joined: Fri Mar 02, 2018 9:48 am

Re: Mysql with libmysql

Post by mauriegio »

Thanks for answer ,

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

Option compiler is ok ...

thanks for your help
infratec
Always Here
Always Here
Posts: 7583
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: Mysql with libmysql

Post by infratec »

Hi,

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

Bernd
mauriegio
New User
New User
Posts: 7
Joined: Fri Mar 02, 2018 9:48 am

Re: Mysql with libmysql

Post 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
infratec
Always Here
Always Here
Posts: 7583
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: Mysql with libmysql

Post 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?
mauriegio
New User
New User
Posts: 7
Joined: Fri Mar 02, 2018 9:48 am

Re: Mysql with libmysql

Post by mauriegio »

Sorry ,

thanks for the help

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

thank

Maurizio
infratec
Always Here
Always Here
Posts: 7583
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: Mysql with libmysql

Post 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.
mauriegio
New User
New User
Posts: 7
Joined: Fri Mar 02, 2018 9:48 am

Re: Mysql with libmysql

Post 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
Marc56us
Addict
Addict
Posts: 1600
Joined: Sat Feb 08, 2014 3:26 pm

Re: Mysql with libmysql

Post 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)
Post Reply