VS2010 Build Error at PuTTY Source - visual-studio-2010

i'm download putty source code from website.
and open putty.dsw file.
VS2010 auto convert that project files.
finally. just build only putty.
but i got this message.
Error 27 error C1189: #error : You must define one of SECURITY_WIN32, SECURITY_KERNEL, or c:\program files (x86)\microsoft sdks\windows\v7.0a\include\sspi.h 60 1 putty
Error 35 error C1189: #error : You must define one of SECURITY_WIN32, SECURITY_KERNEL, or c:\program files (x86)\microsoft sdks\windows\v7.0a\include\sspi.h 60 1 putty
Preprocessor Definitions
WIN32
_DEBUG
_WINDOWS
and Not Using Precompiled Headers.
i googled. so i found putty build from cygwin.
but just wondering about how to build putty at vs2010.

as Matthias said above, you need to add a line like
#define SECURITY_WIN32
to the putty.h file. Don't add/define SECURITY_KERNEL that's what caused additional errors.

Related

Trying to compile pgAgent. Get an error wx/setup.h: No such file or directory

On one of our servers pgAgent service does not start with the message "ERROR: Couldn't register event handle" (see DBA Question). So I decided to compile the binary from the source, to further investigate the problem.
I installed Visual Studio Community 2017 Edition. I downloaded pgagent source code 3.4.0 and extracted to F:\pgbuild\pgAgent-3.4.0. I downloaded the wxWidgets 2.8, unpacked into F:\pgbuild\wxWidgets and built with visual studio 2017. I pointed out the these variables
wxMSW=F:\pgbuild\wxWidgets
WXWIN=F:\pgbuild\wxWidgets
PGDIR=C:\Program Files\PostgreSQL\9.6
WIX=C:\Program Files (x86)\WiX Toolset v3.11\
Then I tried to compile the pgAgent. Visual studio could recognize the CMake Project of it. When I compile the cmake project, I get an error:
Severity Code Description Project File Line Suppression State
Error C1083 Cannot open include file: '../../../lib/vc_lib/mswd/wx/setup.h': No such file or directory F:\pgbuild\pgAgent-3.4.0\CMakeLists.txt F:\pgbuild\wxWidgets\include\msvc\wx\setup.h 123
There are lots of urls around the problem on the net, but I cannot get a handle on it.
It looks to me that this code needs to be updated:
#ifdef wxSUFFIX
#define wxSETUPH_PATH \
wxCONCAT6(../../../lib/, wxLIB_SUBDIR, /, wxTOOLKIT_PREFIX, wxSUFFIX, /wx/setup.h)
#else // suffix is empty
#define wxSETUPH_PATH \
wxCONCAT5(../../../lib/, wxLIB_SUBDIR, /, wxTOOLKIT_PREFIX, /wx/setup.h)
#endif
I built wxWidgets using wx_vc15.sln in F:\pgbuild\wxWidgets\build\msw. I was trying to build pgAgent as CMake project, although the building instructions say that I need to use the GUI version of CMake.
I was following instructions to build pgAdmin, but now I am wondering whether I need to build pgAdmin (don't mix it up vs. pgAgent) at all.
Any suggestions how?
Update:
I installed CMake for Windows and created a solution file to F:/pgbuild/pgAgent-3.4.0/build. Got some errors lines back:
Then clicked on configure, then on gnerate. This created the visual studio project file. Tried to build it, got the error above (wx/setup.h: No such file or directory). The exact error is
Severity Code Description Project File Line Suppression State
Error C1083 Cannot open include file: '../../../lib/vc_dll/mswd/wx/setup.h': No such file or directory pgagent f:\pgbuild\wxwidgets\include\msvc\wx\setup.h 123

Migrating code from VS 2005 to 2013 causes error LNK1104 error?

I'm attempting to migrate a solution file from VS 2005 to VS 2013. The majority of the projects within the solutions rebuilt just fine.
However, some of the projects are coming up with the error:
error LINK1104: cannot open file 'mfc80.lib'
I have searched for mfc80.lib on my computer and it does not exist.
I cannot follow the solution from here fatal error LNK1104: cannot open file 'gdi32.lib' because the file does not exist, therefore I cannot add its path in "Additional Library Directories".
I have:
Deleted all the .obj and .lib files for the problematic project
Ensured Visual C++ MFC MBCS Library for Visual Studio 2013 is installed
Followed Error LNK1104 cannot open file ';.obj'
What else do I need to check?
Thanks.
It appears your project is attempting to include mfc80.lib explicitly. This is the version that VS2005 used; you need mfc120.lib.
Also, double-check that none of your source has a declaration like the following: #define _MFC_FILENAME_VER

How to Compile Ruby on Windows?

linking miniruby.exe
win32.obj : error LNK2001: unresolved external symbol __imp____pioinfo
miniruby.exe : fatal error LNK1120: 1 unresolved externals
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\cl.EXE"' : return code '0x2'
Stop.rel
This is the error in cmd while compiling the package using Development cmd for VS2015.
What is wrong?
I ran into the same error (minus some printed output differences) when trying to compile Ruby 2.5.1 on Windows using Visual Studio 2015 Express. I thought that all I needed to do was to add the bin directory to my PATH. So I did this and then tried building but I failed:
$> cd <path_to_ruby_download>
$> set PATH=C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin;%PATH%
$> win32\configure.bat
I was able to get past this problem thanks to some insight from this attempt. The main hint (from jules_a) is:
Looks like cl.exe cannot be found. You should use vcvarsall.bat to
configure your path properly.
I tried searching for this vcvarsall batch file but couldn't find it in my Visual Studio installation directory. However, thanks to this article, I found another way. Turns out that all I needed to do was to build from a developer console.
On my computer, I could start this dev console by going to Start -> All Programs -> Visual Studio 2015 -> Visual Studio Tools -> Developer Command Prompt for VS2015. Alternatively, you can launch VsDevCmd.bat, located in Common7\Tools\ directory of your Visual Studio installation.
And then everything worked! Note that I did not need to bother with RubyInstaller or any of that jazz!
You want to compile it or install it? Because you don't need to compile it if you just want to install it. Check the binaries
http://rubyinstaller.org/
For downloading ruby
I am not sure if you still need the answer, I also see that rubyinstaller does not have new ruby release also. After asking around for a while I found that they are posting new release at github. I downloaded 2.4.1 and it work for me.
https://github.com/oneclick/rubyinstaller2/releases
For compiling ruby
Please read this link so you will have info. they change to use msys2 and mingw now
https://github.com/oneclick/rubyinstaller2/

Running MSBuild from command prompt with OpenCV

I want to create a batch file that builds several Visual Studio 2010 projects. My project property sheet is setup to use opencv, and building from Visual Studio works fine, but when I run the MSBuild command from cmd, it doesn't find the OpenCV header files. I get many of the following messages:
c:\proj\libproj\cvtrack.cpp(26): fatal error C1083: Cannot open include file: 'cv.h': No such file or directory [C:\proj\libproj\libproj.vcxproj]
Any ideas?
I fixed this by adding the following parameter to the MSBuild command, /p:Configuration=Release
, and then changein the project's Release properties.

Still nmake problem with Unicode-Map-0.112 after trying vcvarsall.bat [duplicate]

This question already has answers here:
How do I use MS C++ Express 2008 to build Perl Unicode::Map on Windows?
(2 answers)
Closed 6 years ago.
Many thanks to ephemient for recommending to try vcvarsall.bat.
In DOS successfully ran vcvarsall.bat, which was part of MS C++ Express 2008
Next I continued to try to follow the PerlMonks advice by using ppm, i.e. http://www.perlmonks.org/?node_id=434813
So I tried to make, really nmake Unicode-Map-0.112 again. I received one more issue:
C:\perl\lib\core\win32.h (61) : fatal error C1083: Cannot open include
file: 'windows.h': No such file or directory.
NMAKE: fatal error U1077: 'C:\Program Files\Microsoft Visual Studio
9.0\VC\Bin\Cl.exe: return code '0x2'
Stop
I turns out that I do have the Windows.h file:
Windows.h is located in C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include
I'm guessing I just also need to Windows.h to the PATH as well.
Does this sound correct or is there another route I should be traveling as I'm stumbling ahead?
Thanks again.
The problem with going down this route is that your perl was compiled using a different compiler. You are much better off downloading the package and installing it via ppm as I described in How do I use MS C++ Express 2008 to build Perl Unicode::Map on Windows?.
As for the compilation to work, you need to invoke the SetEnv.cmd script which you can find in the Bin directory of your platform SDK installation after the vcvarsall.bat script.
You need to do all of your calls to nmake from an environment that is initialized with the variables for the SDK version you're using. (v6.0A in your case).
In your start menu, go to the 'Microsoft Windows SDK *' menu folder, and start the CMD shell from there.
Inside that CMD shell, cd to your code directory and run nmake from there.

Resources