Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

tdbc with mysql can't load library libmysql.dll

456 views
Skip to first unread message

sled...@gmail.com

unread,
Apr 19, 2017, 3:20:12 AM4/19/17
to
Several others posted issues with older versions. None in 2016\2017 time frame so surprised to find it with 8.6.4. The older resolutions don't seem relevant.

Using windows 10, 64bit, though using activestate 32 bit version.

Ran teacup install and have tdbc in the \lib as well as in teapot.


package require tdbc::mysql
couldn't load library "libmysql.dll.15": this library or a dependent library could not be found in library path

Any assistance would be appreciated.

Rick

Harald Oehlmann

unread,
Apr 19, 2017, 4:33:56 AM4/19/17
to
Not an expert, never tried, but the library must probably be provided by
another mysql driver package.

After a little web search, it might be part of the package:
http://stackoverflow.com/questions/7944991/using-libmysql-dll-on-windows-7

sled...@gmail.com

unread,
Apr 19, 2017, 1:44:52 PM4/19/17
to
Thank you...

Did the download.
Copied libmysql.dll and libmysql.lib from the mysql directory to tcl\bin
...and taking no chances
Updated the system PATH environment to include the location of these mods in the mysql dir. the tcl directory was already present in the path...

just executed package require tdbc::mysql and it returned the package level as it should...

thanks...

Too bad a user has to do this kind of thing...have been using tcl for about 6 years, and it is having to deal with this kind of fragmentation that turns a lot of prospective users off...

Luis Alejandro Muzzachiodi

unread,
Apr 19, 2017, 9:00:30 PM4/19/17
to
Well,that's explained in the link quoted by Harald: copy libmysql.dll in your system32 directory (i.e. c\windows\system32) and try (on Win7 it works for me).
Really this an old problem of confusing warning, as noted in:
http://core.tcl.tk/tdbcmysql/info/9f4ac0fa07554fdd35c5dad246c71214522dbd00
and
https://groups.google.com/forum/#!topic/comp.lang.tcl/6r3B48CkhaY

Alejandro

Harald Oehlmann

unread,
Apr 20, 2017, 2:46:43 AM4/20/17
to
Great to hear that it works !

I would appreciate a remark on wiki.tcl.tk/mysql about the steps to make
it work.

Thank you,
Harald

sled...@gmail.com

unread,
Apr 20, 2017, 10:13:12 PM4/20/17
to
Actually, I think a lot of us - or maybe just me - didn't read the msg as carefully as we might have.

It seems, in retrospect, it was a dependent module that was missing rather than libmysql.dll. The error msg does suggest that.

And I believe the missing puppy was 'libmysql.lib'...

Which, I believe is why, though libmysql.dll was placed in several folders (and on my cell phone, car multimedia system and my dogs identification chip embedded subcutaneously) that the message kept appearing...

As noted, Harald's suggestion was followed and both modules became present and only when both were placed in the tcl directory, did tdbc work as hoped.

sled...@gmail.com

unread,
Apr 20, 2017, 10:23:11 PM4/20/17
to
I look at those links and they, like, me were focused on a missing libmysql.dll as the cause. Note: the message makes reference to the dll but also considers dependent modules - e.g. libmysql.lib!

There was no consideration that I could find for the .lib module.

And that is where the problem, as least for me, lay.

However, looking at the issue from the 30,000ft level - tdbc is now incorporated into the ActiveState distribution. It seems fair that, it if the modules are not going to be included as well, then at the very least - in the docs - this dependency should be mention.

thanks, btw, for taking the time to respond.

sled...@gmail.com

unread,
Apr 20, 2017, 10:29:33 PM4/20/17
to
Hi,

The requested remark is in place...but it was you that made it happen!!

Luis Alejandro Muzzachiodi

unread,
Apr 21, 2017, 12:30:12 AM4/21/17
to
Are you sure you need a .lib file in order to run your script ?.
As far i know, you don't need a static library (.lib), except when you want to compile source code for example.
In my experience, it's enough copying the .dll in some (important!) "visible" path.
Maybe someone else can explain it better ...

Alejandro

sled...@gmail.com

unread,
Apr 21, 2017, 4:07:23 PM4/21/17
to
Well...I am not sure of anything any more.

Before posting, the dll had been placed just about everywhere I could think of and all PATHs updated.

Then followed Harald suggestion and both file were present. So, just moved both to the \lib \bin ... Again, just putting them everywhere possible.

And then did the package require for tdbc::mysql, and for the first time received no msg.

So, was the dll that I had been using corrupt or invalid - don't think so cause it came from the mysql folder.

Or was the one unzipped identical, but the .lib is required...

The next unknown related to compiling into an exe with the .dll. Does the tcl code load it or the system. Which means do I include it in the DevKit list of files or not...

So, given what had transpired and the lack of doc with regard to the care and feeding of the dll, I did what anyone who prefers certainty did - move on to tcldobc....

And boy is it an improvement in virtually every respect.

BTW: any insight with regard to the compilation question is welcomed.

Rick


Harald Oehlmann

unread,
Apr 23, 2017, 5:18:46 AM4/23/17
to
> The next unknown related to compiling into an exe with the .dll. Does the tcl code load it or the system. Which means do I include it in the DevKit list of files or not...

If you speak about starkits :
- the DLL's directly loaded by TCL (by the load command) may be added to
the starkit. On each startup of the starkit, those files are copied out
of the exe to the tmp folder and are loaded from there.

- any file where those dll's depend on or loaded by other mechanism must
be handled manually.

In practice, I put all the dependent libraries in the same folder as the
exe.

So in your case:
- tdbc -> to the exe
- mysql.dll, mysql.lib -> same folder as the exe

Hope this helps,
Harald

0 new messages