Vista / Win 7 SDK bufferoverflowu.lib linking error - c++

I downloaded the Windows SDK 7.0A to explore some things I was reading about. I downloaded some samples that work with the SDK but when I try to compile them I get an error. I looked in the Lib directory of the SDK and couldn't find it. I also did a full system search and also did not find it.
I have read about this being a special link added at compile or the result of a version check in a pragma. I could not find any reference to the lib in the source or all the header files.
I'm running:
Vista Ultimate
VS 2010 Beta 2
Microsoft Windows SDK for Windows 7 and .NET Framework 3.5 Service Pack 1
My Error:
error LNK1104: cannot open file 'bufferoverflowu.lib'
I just reinstalled and am still getting the same issue.

What sample exactly are you trying to build - a little research shows that the bufferoverflowu.lib (and other related bufferoverflow*.lib files) were in previous SDKs to support building with compilers from before and after Microsoft added the ability for the compiler to generate buffer overflow checks (starting with the /GS option in VS 2003 - I think).
The libraries were in the SDK so that if the user built a Windows program with compiler that didn't support the buffer overflow checks, the SDK libraries that had been built that way would link to the code in the bufferoverflow*.lib to get the support. If the user was building with a newer compiler, everything would link to the C runtime library that had the buffer overflow support.
However, the Windows SDK v7.0 only supports building applications with VS 2005 SP1 or newer, so the buffer overflow checking code always comes from the C runtime - the bufferoverflow*.lib file should no longer be necessary.

Related

Where is cl.exe? (MS Build Tools ’13)

I just want the VC++ compiler, since some C++ graphics libraries (I'm planning to use and learn bgfx...) require it for compilation. For this I’ve downloaded and installed Ms. Build Tools ’13. However, I can’t find it.
My attempts:
1) I’ve ran Windows Command Prompt using the Batch input cl and it echoed 'cl'is not recognized as an internal or external command, operable program or batch file..
2) I’ve searched for a file with filename cl.exe on both "C:\Programs Files" and "C:\Programs Files (x86)" paths recursively and nothing. There’s no top folder related to MsVC++ or VC++ too, on the disk.
I cannot try to install Build Tools ’15 (nor VS) since the installer downloads at minimum 3 gygabytes and my network isn’t good.
Where can I find the compiler? Otherwise, is there any cross-platform graphics library (at least for Windows and Mac) that doesn’t need MSVC++ (e.g., just G++), please?
As a commenter mentioned, the Microsoft Build Tools 201x include tools to build managed apps (i.e. .Net apps), not native C++ apps. That's the answer to "where is cl.exe?" It's not there. It was never there.
That's true for the Microsoft Build Tools 2015 too, despite what you think and said. You're mixing up Microsoft Build Tools 2015 and Visual C++ 2015 Build Tools. Note the "C++" there (and the order of some of the words).
The Visual C++ Build Tools are the supported and recommended way by Microsoft to Build visual C++ projects without installing Visual Studio.
If your problem is internet connection get someone else to download it for you, seriously. You're really looking at it the wrong way.
Another alternative is the Enterprise WDK. It's "only" 1.9GB.
Otherwise, is there any cross-platform graphics library (at least for Windows and Mac) that doesn’t need MSVC++
Yes, you should be able to use modern OpenGL in a cross-platform way under Mingw using
GLFW (since it's a CMAKE compile-it-yourself library) and the excellent GLAD for handling loading of the modern openGL API on windows.

Visual Studio Build Tools 14 cannot find stdio.h

Ayo,
Now I have attempted other solutions to the problem that over people have had success in. But unfortunately, technology is not on my side today.
As the title says my C++ compiler says it cannot find 'stdio.h' then leaves with error status 3, Here is the stacktrace https://gyazo.com/d26d47054ee30f7e03524b7d8c0052a8
How would I be able to resolve this?
Thanks,
Duke.
Running C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat worked for me. See details on MSDN.
Microsoft now implements C run time library as a "Universal CRT", which is part of the OS. And to develop for it, you will need the SDK for the OS, a.k.a. Windows SDK.
CRT Library Features (Microsoft Docs)
However, there's a not-so-obvious component of the SDK installation that will install the minimum needed SDKCRT components (ca. 700MB).
It is called, appropriately, Windows Universal CRT SDK.
You can select it by installing the Build Tools component, which will in turn install the VS Installer. Then you modify the Build Tools to include the individual SDK component.
But you won't get far with this, unless you can scam Windows into running an app that doesn't depend on its' kernel, implying you will most likely need the full Windows SDK for the kernel32 library and its' dependencies.

Compile C++ program to run on windows 7 using VS2010 running on windows8

I use visual studio 2010 running on Windows 8.1
the program is in C++ and uses MFC library
when I compile it in my computer running windows 8, and then I run it on the destination computer running windows 7, the program stops unexpectedly.
how to compile it specifically for windows 7
Without using a newer SDK there is no special switch to set to compile a program for Windows 7.
Read aboutthe SDK versions and settings for the header files in the [MSDN][1]
Even if you use a newer SDK and it is a standard MFC program, than you shouldn't have a problem using it under Windows 7. In 99% of all cases using a newer SDK (with incompatible compiler settings) and run the program on an incompatible (older) OS, the program will not start. In such cases some DLL entry points of new function can't be found.
If you program stops unexectable you should use remote debugging to find the bug. Or use minidumps to do a post mortem analysis. I am sure you have a bug in your program. And that it runs on Windows 8 may be simply luck.
Check if the values of WINVER and/or _WIN32_WINNT in your project have been #defined as 0x0602 or higher -- see this MSDN article for a list of possible values
It might be an issue of the runtime libraries not being present on the Windows 7 machine. This can prevent the program from starting with a non-intuitive error message.
In that case, you can install the Visual C++ 2010 Redistributable Package on the Windows 7 machine and see if that helps. Alternatively you can deploy the application with the runtime library DLL files in the same directory as the .exe.
I have a dll project project in my solution, in which target OS version is not defined.
even have the following warning:
_WIN32_WINNT not defined. Defaulting to _WIN32_WINNT_MAXVER (see WinSDKVer.h)
this might be the problem. After testing it I will confirm the answer

Incorrect C++ runtime components

I have a vs 2008 c++x32 build and when I tried to run it on a fresh windows 7 vm install, I get the following error:
"WINDOWS 7 error The application has failed to start because the side
by side configuration is incorrect please see the application event
log or use the command line sxstrace.exe tool for more detail."
I have found the following resolution:
The machine is missing the correct C++ runtime components for your
type of system. (x86 or x64). Installing the following update resolves
the issue. Microsoft Visual C++ 2008 SP1 Redistributable Package (x86)
As details about the vs 2008 solutions: i use unicode, I don't use ATL or MFC just Standard Windows Libraries.
My question is: am I doing something wrong? is this normal or there is a way of overcoming this problem from the development phase. What must I do so that my program would run the first time.
All programs compiled from Visual Studio needs a runtime library (the library that actually contains the functions used by new, delete and other runtime support functions). This runtime library needs to be there when you run your program. Either by you installing the shared libraries, or by you making your project a statically linked project so the runtime is linked to your program.

Visual C++ 2010 Express: How to use with Qt?

I'm confused about getting Qt working with Visual Studio Express. Most of the searches online have turned up instructions for compiling Qt using instructions such as:
Install MSVC2005 or MSVC2008
Install the most recent Platform SDK (# MSDN: "Platform SDK for Windows
Server 2003 R2")
From the Platform SDK, you'll need to install at least the base +
internet options
Then, download and extract a recent snapshot or the preview release to
D:\Qt\4.x.x
Open up a console with the MSVC settings loaded (see MSVC Tools-menu)
and go to your Qt directory
Type "configure -platform win32-msvc2005" without the quotation
marks
That will build you the project files you'll need
After that, it's as simple as running "nmake" and drinking a lot of
coffee
Then, add D:\Qt\4.x.x\bin and
D:\Qt\4.x.x\lib to your path
environment variable, and you'll be
able to use this version of Qt from
everywhere on your system. The latter
could be added to the library section
in the options from MSVC as well.
(from http://www.qtcentre.org/threads/11710-Visual-Studio-2005-Express)
However, when I go to the download page of Qt (http://qt.nokia.com/downloads), there is a download for Visual Studio labeled:
"Qt libraries 4.7.1 for Windows (VS 2008, 228 MB)"
I'm confused, do I actually still need to build it? Or is it already built?
Using the downloadable exe from qt (http://get.qt.nokia.com/qt/source/qt-win-opensource-4.7.1-vs2008.exe) does not seem to work with Visual Studio 2010. I tried building a simple hello world program from the command line which would not run. I'll repeat my comment from a previous answer.
I tried the hello world example from
doc.qt.nokia.com/4.7/gettingstartedqt.html.
I was able to build the project and an
exe is generated. However, the exe
fails to run and generates a system
error dialog box about "side-by-side
configuration is incorrect...". I ran
SxsTrace and it says:
...
INFO: Begin assembly probing.
INFO: Did not find the assembly in WinSxS.
INFO: Attempt to probe manifest at C:\Windows\assembly\GAC_32\Microsoft.VC90.DebugCRT\ 9.0.21022.8__...\Microsoft.VC90.DebugCRT.DLL.
INFO: Attempt to probe manifest at C:\qthello\debug\Microsoft.VC90.DebugCRT.DLL.
INFO: Attempt to probe manifest at C:\qthello\debug\Microsoft.VC90.DebugCRT.MANIFEST.
INFO: Attempt to probe manifest at C:\qthello\debug\Microsoft.VC90.DebugCRT\Microsoft.VC90.DebugCRT.DLL.
INFO: Attempt to probe manifest at C:\qthello\debug\Microsoft.VC90.DebugCRT\Microsoft.VC90.DebugCRT.MANIFEST.
INFO: Did not find manifest for culture Neutral.
INFO: End assembly probing.
ERROR: Cannot resolve reference Microsoft.VC90.DebugCRT,processorArchitecture="x86", publicKeyToken="...",type="win32",version="9.0.21022.8".
ERROR: Activation Context generation failed.
End Activation Context Generation.
To me, it looks like its trying to use
VS2008 (which I don't have). It makes
sense I guess since the download is
for VS2008.
I was in the process of compiling qt 4.7.1 using the instructions in my question (using win32-msvc2010 as my platform target however) as I asked this SO question and the compilation finished. I rebuilt the hello world project and the exe runs. So it seems like the answer is in order to use with Visual Studio Express 2010 you currently do need to compile (at least until Qt releases a VS2010 download option). However, I believe if you are using VS2008 then you will not need to compile.
The Qt binaries provided by Nokia for Windows target either MinGW or Visual Studio 2008, both for compiling 32bit executables. If you need Qt binaries for VS 2005 (32bit), you may find them in their archives.
For everything else, you need to compile Qt yourself. Especially for:
Visual Studio 2008 64 bit
Visual Studio 2008 Express Edition 64 bit: You need the Windows SDK 7.0 which provides the 64 bit compilers and compile Qt with those.
Visual Studio 2010 32 bit and 64 bit
In general, you cannot link libraries compiled with different compilers, i.e. use the Qt binaries built with VC 9.0 (VS 2008) 32 bit and link them to an executable built with VC 10.0 (VS 2010) 32 bit.
Just a small update on this.
Downloading the QTSDK (and using cmake instead of qmake everything looks like working quite well. Except for the fact that the installer of QTSDK didn't update the path for qmake.exe and you've to do by hand.
Tested with QtSDK 4.8 and visual studio express 2010
http://qt.nokia.com/downloads has a link called qt-vs-addin-1.1.7.exe (57 MB)
You'll probably need that one as well . .
I don't think you need to compile the libraries since there is a download for them now . .
So get the 228 MB of libs and 57 MB plugin and you should be set.
DISCLAIMER: I don't use MSVC (yet?) so please let me know if it works.