Not found for CancelIoEx in Windows xp - sockets

Socket TCP, in C++ with QT, compiled in MinGW 32 bits for pc windows XP service pack 1.
Error : not found for CancelIoEx "No se encuentra el punto de
entrada del procedimiento CancelIoEx en la biblioteca de vinculos
dinamicos kernel.32.dll"

The CancelIoEx function wasn't added until Windows Vista:
Requirements
Minimum supported client: Windows Vista [desktop apps | UWP apps]
That is why you cannot find it in Windows XP.

Related

Facing issue while running my first C program in VS Code

I have written my first C program and while running facing problem,Below is the code.
#include<stdio.h>
void main()
{
printf("Hello World");
}
While running the program getting below warning in terminal.
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.
Try the new cross-platform PowerShell https://aka.ms/pscore6
Warning: PowerShell detected that you might be using a screen reader and has disabled PSReadLine for compatibility purposes. If you want to re-enable it, run 'Import-Module PSReadLine'.
PS D:\C_Program> & 'c:\Users\azhar.vscode\extensions\ms-vscode.cpptools-1.11.5-win32-x64\debugAdapters\bin\WindowsDebugLauncher.exe' '--stdin=Microsoft-MIEngine-In-kultbrgv.bxw' '--stdout=Microsoft-MIEngine-Out-tvw2mt1p.wdr' '--stderr=Microsoft-MIEngine-Error-lhguvkjt.xrj' '--pid=Microsoft-MIEngine-Pid-vho11bhr.z5a' '--dbgExe=C:\MinGW\bin\gdb.exe' '--interpreter=mi'
PS D:\C_Program>
enter image description here

error al instalar gema de ruby2d en linux

An error occurred while installing ruby2d (0.11.3), and Bundler cannot
continue.
In Gemfile:
ruby2d

Redirect stderr to file on network driver is very slow since VC++ 2015 / 14.0

We experience a strange performance issue when using Visual C++ 2013 (also known as Visual C++ 12.0) compared to more recent versions like Visual C++ 2015 (also known as Visual C++ 14.0):
The same C code is much slower when writing to stderr and redirecting this stream to a file on a network drive (Server is Linux Debian 8 / Samba).
C:\tmp> myprog.exe 2>X:\devel\fgl\tests\zz
When redirecting to a file on the local disk, or when redirecting to nul, the execution is fast.
We have also tested with VC++ 2017 / 15.0, same problem.
The reason seams to be the /MD option (link with MSVCRT.LIB), I could reproduce with a simple program:
#include <stdio.h>
int main(int argc, char **argv)
{
int n;
system("echo %TIME%");
for (n=0; n<200; n++) {
fprintf(stderr,"aaaaaaaaaaaaaaaaaaaaaaaaaaaa %d\n", n);
}
system("echo %TIME%");
return 0;
}
Then compile with and without /MD option:
C:\tmp>cl /O1 myprog.c
Microsoft (R) C/C++ Optimizing Compiler Version 19.11.25507.1 for x64
Copyright (C) Microsoft Corporation. All rights reserved.
myprog.c
Microsoft (R) Incremental Linker Version 14.11.25507.1
Copyright (C) Microsoft Corporation. All rights reserved.
/out:myprog.exe
myprog.obj
C:\tmp>myprog.exe 2>X:\devel\fgl\tests\zz
9:32:27.96
9:32:27.97
C:\tmp>cl /O1 /MD myprog.c
Microsoft (R) C/C++ Optimizing Compiler Version 19.11.25507.1 for x64
Copyright (C) Microsoft Corporation. All rights reserved.
myprog.c
Microsoft (R) Incremental Linker Version 14.11.25507.1
Copyright (C) Microsoft Corporation. All rights reserved.
/out:myprog.exe
myprog.obj
C:\tmp>myprog.exe 2>X:\devel\fgl\tests\zz
9:32:37.15
9:32:40.12
C:\tmp>myprog.exe 2>c:\tmp\zz
9:32:47.15
9:32:47.20
Is there any known issue related to stderr / network drives with VC++?
Notes:
No problem when writing to stdout
No problem when using /MDd option (MSVCRTD.lib)
No problem with Visual C++ 2013 (Visual C++ 12.0, cl version 18.00.40629)
Thanks for reading!
Er, we have been experiencing the same issue with our C++ code so I added my comment using C++, initially. Sorry about that.
For C, the same "remedy" would look like this:
char buf[4096];
setvbuf(stderr, _IOLBF/*or _IOFBF*/, buf, sizeof(buf));
Initial response:
Try this at the beginning of your program:
static char buf[16384];
cerr.rdbuf()->pubsetbuf(buf, sizeof(buf));
cerr.unsetf(std::ios_base::unitbuf);
You can decrease the buffer size (to 4096 or less) and still see the speed boost -- the thing is that cerr is completely unbuffered by default, and having unitbuf set on it causes even more slowdown by implicit flush operations injected after each output to the stream.

Error when using a newly installed module with Perl 5.26

I have just installed Strawberry Perl 5.26 on a Win32 machine (XP), and installed Device::ParallelPort (with cpanm, and the installation is OK).
When I try to use the module, I have :
Device::ParallelPort unabel to create driver auto (see Device::ParallelPort::drv::auto for further information) - Device::ParallelPort::
drv::auto (auto detect) error
failed to load win32 - Can't locate Device/ParallelPort/drv/win32.pm in #INC (you may need to install the Device::ParallelPort::drv::win
32 module) (#INC contains: Q:/APPS/Perl-5.26/perl/site/lib/MSWin32-x86-multi-thread-64int Q:/APPS/Perl-5.26/perl/site/lib Q:/APPS/Perl-5
.26/perl/vendor/lib Q:/APPS/Perl-5.26/perl/lib) at (eval 3) line 2.
BEGIN failed--compilation aborted at (eval 3) line 2.
. Make sure you have loaded and installed Device::ParallelPort::drv::win32 from CPAN. Install Device::ParallelPort::drv::(linux|parport|
win32) and try again at (eval 2) line 3.
at Q:\VirtualDiskII\Perl\testlpt.pl line 25.
So I have installed Device::ParallelPort::drv::win32 (and the installation is OK). When trying to use the module, I have :
Device::ParallelPort unabel to create driver auto (see Device::ParallelPort::drv::auto for further information) - Device::ParallelPort::
drv::auto (auto detect) error
failed to load win32 - Failed to load inpout32.dll - Can't create Inp32 2 - Une requÛte d'envoi ou de rÚception de donnÚes n'a pas ÚtÚ a
utorisÚe car le socket n'est pas connectÚ et (lors de l'envoi sur un socket datagramme en utilisant un appel sendto) aucune adresse n'a
ÚtÚ fournie. at Q:/APPS/Perl-5.26/perl/site/lib/Device/ParallelPort/drv/win32.pm line 75.
. Make sure you have loaded and installed Device::ParallelPort::drv::win32 from CPAN. Install Device::ParallelPort::drv::(linux|parport|
win32) and try again at (eval 2) line 3.
at Q:\VirtualDiskII\Perl\testlpt.pl line 25.
Any ideas ?
Thank you by advance !
According to the Device::ParallelPort::drv::win32 docs...
Standard installation, but you also need "inpout32.dll" which may require either putting into your windows System directory, or at the location of your executable.
inpout32.dll actually comes from a 3rd party source and is freely available.
http://www.logix4u.net/inpout32.htm
Unfortunately that site appears to no longer work. You'll have to find another source.
If you wanted to get ambitious, you could patch the module to handle this automatically and, if the DLL's license allows, ship with the DLL. Or write an Alien wrapper module.

Tuning Primer - No Valid Socket File

I am trying to run Tuning Primer using Cygwin on my Windows 7 computer to check some of my databases.
Whenever I try to run it, It gives me the following error:
No valid socket file "" found!
/cygdrive/c/Users/MID-PC/Downloads/tuning-primer.sh: line 109: tput: comando não encontrado
The mysqld process is not running or it is installed in a custom location.
/cygdrive/c/Users/MID-PC/Downloads/tuning-primer.sh: line 109: tput: comando não encontrado
If you are sure mysqld is running, execute script in "prompt" mode or set
/cygdrive/c/Users/MID-PC/Downloads/tuning-primer.sh: line 109: tput: comando não encontrado
the socket= variable at the top of this script
/cygdrive/c/Users/MID-PC/Downloads/tuning-primer.sh: line 109: tput: comando não encontrado
Any Idea of how can I manually set this socket?
(Yes, I do have MySQL running on this machine)