Failed to build libmysql on windows using vc2008 - mysql

I want to build libmysql.dll, so I got source code mysql-connector-c-6.1.6-src.zip from http://dev.mysql.com/downloads/connector/c/.
Then cmake-gui.exe to configure and generate vc 2008 sln, leave all settings default.
Then got errors and warnings when building, like this:
mysql-connector-c-6.1.6-src\include\thr_cond.h(109) : error C2065: “ETIMEDOUT”: 未声明的标识符(an unspecified identifier)
mysql-connector-c-6.1.6-src\include\thr_rwlock.h(80) : warning C4013: “TryAcquireSRWLockShared” 未定义(not defined)
mysql-connector-c-6.1.6-src\include\thr_rwlock.h(102) : warning C4013: “TryAcquireSRWLockExclusive” 未定义(not defined)
I searched the source, and find ETIMEDOUT is defined in my_pthread.h, so I include this header in thr_cond.h, but still error.
And TryAcquireSRWLockShared and TryAcquireSRWLockExclusive seem only supported on Win7 and later !
Do I have done something wrong?
How can I build libmysql?
Any help will be appreciated.

Download the previous version (6.0.2), it doesn's use the TryAcquireSRWLockShared() API function.
With a few minor tweeks, it compiles clean with MSVC 2008.
Here are the modifications (based on the extracted zip file root):
Replace line 306 of include/config-win.h with:
// avoid annoying warning
#ifndef HAVE_COMPRESS
# define HAVE_COMPRESS
#endif
Comment lines 350-367 of CMakeLists.txt (CPack instructions cause CMake to fail)
Follow instructions in BUILD.win

Related

DBD::mysql error in ActivePerl 5.28 on Windws10 64bits, Can't load mysql.dll

I'm having an issue with the DBD::mysql module. This question has been asked before on this forum but a solution was not posted so I thought I would repost it. Sorry if this is not appropriate for this forum. This is my first post.
You can find the original post from bLIGU here:
Error using perl module DBD::mysql in ActivePerl 5.28 on Windws10 64bits
I have the exact same problem. I'm just upgrading my Active Perl version. Nothing else changed. I'm running the same MySql server version and this script ran fine before the update and it runs fine if I go back to version 5.20.2.2002 and use PPM to download the packages.
Note that ActiveState now requires you to build a custom version of ActivePerl with the modules online and generates an install file for you. PPM is no longer supported.
Here's the error:
install_driver(mysql) failed: Can't load 'C:/Perl64/site/lib/auto/DBD/mysql/mysql.dll' for module DBD::mysql: load_file:The specified module could not be found at C:/Perl64/lib/DynaLoader.pm line 193.
at (eval 11) line 3.
Compilation failed in require at (eval 11) line 3.
Perhaps a required shared library or dll isn't installed where expected
at C:\E22_TE~1\ICTDEV~1\Scripts\UPDATE~1.PL line 136.strong text
The file C:/Perl64/site/lib/auto/DBD/mysql/mysql.dll is present so I'm wondering if the DLL is trying to load something else and returns an error.

DAML Sand box error: Error: Registry key 'Software\JavaSoft\Java Runtime Environment'\CurrentVersion' has value '1.8', but '1.7' is required

Getting below error when I start sandbox. I think we need use jdk8 as per the DAML doc.
daml sandbox --scenario Main:setup .daml/dist/quickstart-0.0.1.dar
Error: Registry key 'Software\JavaSoft\Java Runtime Environment'\CurrentVersion'
has value '1.8', but '1.7' is required.
Error: could not find java.dll
Error: Could not find Java SE Runtime Environment.
daml-helper: Received ExitFailure 2 when running
Raw command: java -jar "C:\Users\santh\AppData\Roaming\daml\sdk\0.13.21\sandbox/sandbox.jar" --scenario Main:setup .daml/dist/quickstart-0.0.1.dar
During my initial setup, I have faced the similar issue. It may be because of an existing Java installation in your machine.
You can try the below options to fix this issue.
Option 1:
1. Check if you have more than one version of JAVA in machine.
2. If yes, uninstall everything and do the clean installation. Make sure your Environment Path variable(s) are got set properly.
or
Option 2:
1) Download the latest JDK in Zip format "jdk-12.0.2_windows-x64_bin.zip"
2) Extract it manually in your local drive.
3) Manually update your Environment Path variables (ref. https://javatutorial.net/set-java-home-windows-10).
I hope it will help you to fix your problem.
Cheers,
Augustine

Winexe installation in Linux

I am trying to compile and build winexe. I have downloaded the samba source and ran the following command to compile the winexe.
./waf configure --samba-dir=../../samba --samba-inc-dirs=../../samba/ --samba-lib-dirs=../../samba/
I am getting the following error. Please suggest me to resolve the error.
[3326/3810] Compiling default/source/smb_static/smb_static.objlist.empty.c
Waf: Leaving directory `/root/samba/bin'
Build failed: could not find 'source/smb_static/smb_static.objlist.empty.c' for
{task: cc smb_static.objlist.empty.c -> smb_static.objlist.empty_2.o}
Checking for library smb_static : not found
Build of static winexe : disabled
Cannot continue! Please either install Samba shared libraries and re-run waf, or download the Samba source code and re-run waf with the "--samba-dir" option.
(complete log in /root/winexe/source/build/config.log)
execfile is deprecated,
edit the file "smb_static/wscript",
remove the line with execfile and use exec(open("wscript").read()) instead

Php and Smarty3 - filemtime() [function.filemtime]: stat failed for

I'm migrating my WebAPP from Smarty2 to Smarty3. Every step is easy except one. When i display a Smarty Template ( tpl ) an Exception is thrown.
This line
Source: /path_to_file/smarty/libs/sysplugins/smarty_resource.php (773)
(this is the source coude $compiled->timestamp = #filemtime($compiled->filepath); )
raise this Exception when the file doesn't exists
filemtime() [function.filemtime]: stat failed for /path_to_templates/smarty/templates_c/219dfe732aae7bd7c0edab091e3c53f3ce86b058.file.index.tpl.php
Folder permissions:
Smarty template folder Permission : 775
Smarty Cache folder permission: 775
Folder Owners:
both ftp_user:webserver_user
I'm trying to implement different solutions but it seems not possibile to solve this issue whitout changhing Php Error Reporting or disabling my Error Handler .
How can i solve this problem without hacks ?
What you should do is not to downgrade to 3.1.1 but rather try to upgrade to 3.1.19 version. Many bugs are removed all the time so maybe in this version you won't have it.
The other thing is that you can use muteExpectedErrors method to hide file system warnings from Smarty (documentation for this function is not very clear but it affects file system warnings what is explained in error_reporting documentation). You can read at error_reporting documentation page:
Smarty 3.1.2 introduced the muteExpectedErrors() function. Calling
Smarty::muteExpectedErrors(); after setting up custom error handling
will ensure that warnings and notices (deliberately) produced by
Smarty will not be passed to other custom error handlers. If your
error logs are filling up with warnings regarding filemtime() or
unlink() calls, please enable Smarty's error muting.
Check the filesystem permission on /path_to_templates/smarty/templates_c/219dfe732aae7bd7c0edab091e3c53f3ce86b058.file.index.tpl.php
PHP does not seam to have read/write permission on that file.
Also check the permission in the /path_to_templates/smarty/templates_c/ folder. Is the PHP allowed to read list and write in there as well?

error installing octcdf-1.1.5

I Have in my Mac:
Octave-3.4.0
Gnuplot 4.2 - that I had to install because I had problems plotting - it wouldn't plot at all.
I need to load a netcdf file, the error that came was:
nc = netcdf('/users/matheuscortezi/Desktop/Pcse005/ocean_avg.nc', 'r')
error: `netcdf' undefined near line 9 column 6
So I think I don't have the netcdf comand installed, and tried installing by typing this on octave:
pkg install -global -forge octcdf
The error message that I receive from that is:
configure: error: in `/var/tmp/oct-t8XcYD/octcdf/src':
configure: error: C compiler cannot create executables
See `config.log' for more details.
the configure script returned the following error: checking for gcc... /usr/bin/gcc-4.2
checking whether the C compiler works... no
error: called from `pkg>configure_make' in file /Applications/Octave.app/Contents/Resources/share/octave/3.4.0/m/pkg/pkg.m near line 1325, column 9
error: called from:
error: /Applications/Octave.app/Contents/Resources/share/octave/3.4.0/m/pkg/pkg.m at line 783, column 5
error: /Applications/Octave.app/Contents/Resources/share/octave/3.4.0/m/pkg/pkg.m at line 354, column 9
I haven't the faintest idea about what I should do. How can I solve this problem with either:
fixing this error, or
installing a netcdf "comand pack" (i don't know the name for that) so I can use netcdf() as in the example given.
Hope I was clear enough.
It seems to me that you installed Octave from the Mac OSX App bundle. That is not recommended at all. You should install from one of the package managers as explained on Octave's wiki. As far as I know, there are 3 options for Mac (see previous link). Just search for one that also has the netcdf package.
Anyway, if you really don't want to install it through a package manager (but seems to me you really should), seems that your problem lies on gcc (the GNU C compiler). do you have it installed at all? Some packages have code in C++ or C and are also dependent on some external libraries.
EDIT using a package manager would have also solved your problem about plotting since it would install gnuplot at same time