To build WinDBG debugger extensions, must we use the Build utility that comes with the WDK, or can we use Visual Studio?
(In particular, I'd be interested in VS2010 SP1.)
According to the documentation of Debugging Tools for Windows, the only option should be the Build utility:
Windows Debugging | Debugger Engine and Extension API | Introduction
All debugger extensions should be compiled and built by using the
Build utility. The Build utility is included in the Windows Driver Kit
(WDK).
...but maybe the doc is not updated?
Moreover, why would the Build utility the only option for building WinDBG extensions?
What "gotchas" are hidden there?
Nothing particularly special in the case of WinDBG extensions - just build a DLL, with the right set of function names and calling convention, and off you go. So Visual Studion should be able to do that perfectly fine.
You do need to produce your own .def file for the DLL to export the functions.
This page describes how you do it using nmake. The same steps should be perfectly possible to do in VS.
http://www.codeproject.com/Articles/6522/Debug-Tutorial-Part-4-Writing-WINDBG-Extensions
Related
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.
I am using Qt 5.1 with Visual Studio 2010. I can compile and run C++ projects with Qt, but when I try to place breakpoints and then debug, I am getting the following error:
no debugger set up
How should I set up the debugger? I would like to make it clear that I have been using Visual Studio 2010 with Qt 5.1.
From the official "Setting up Debugger" QtCreator documentation:
when using the Microsoft tool chain the Microsoft Console Debugger
CDB, is needed.
See this part of the documentation here inline as well:
Debugging tools for Windows To use this engine, you must install the Debugging tools for Windows. You can download them from Download and Install Debugging Tools for Windows. Note: Visual Studio does not include the Debugging tools needed, and therefore, you must install them separately.
The pre-built Qt SDK for Windows makes use of the library if it is present on the system. When manually building Qt Creator using the Microsoft Visual C++ Compiler, the build process checks for the required files in "%ProgramFiles%\Debugging Tools for Windows".
It is highly recommended that you add the Symbol Server provided by Microsoft to the symbol search path of the debugger. The Symbol Server provides you with debugging informaton for the operating system libraries for debugging Windows applications. For more information, see Setting the Symbol Server in Windows.
The documentation basically refers to the following MSDN url for downloading the native CDB debugger:
http://msdn.microsoft.com/en-us/windows/hardware/gg463009/
You can also set up the symbol server or Windows if you wish to go that far:
To obtain debugging information for the operating system libraries for
debugging Windows applications, add the Symbol Server provided by
Microsoft to the symbol search path of the debugger: Select Tools >
Options > Debugger > CDB. In the Symbol paths field, open the Insert
menu and select Symbol Server. Select a directory where you want to
store the cached information and click OK. Use a subfolder in a
temporary directory, such as C:\temp\symbolcache. Note: Populating the
cache might take a long time on a slow network connection. Note: The
first time you start debugging by using the Debugging tools for
Windows, Qt Creator prompts you to add the Symbol Server.
You need to install Microsoft Console Debugger (cdb) (that is part "Debugging Tools for Windows" in wdk/sdk, make sure you select it if you install the wdk/sdk or it can be found as a standalone install in the link above)
I want to use Notepad and invoke the compiler and linker from the command prompt.
No IDE no make , nmake or anything like similar because I want to know the exact syntax required to do the following:
1. create a static library
2. create a dll
Yes, I have browsed the MSDN site but the examples I saw assume one is using the IDE which does a lot of setup behind the scenes
Pls Note: I know how to compile executables using cl also setting up the env using vcvarsall.bat. My question is about compiling static libraries and dlls.
I am using Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 15.00.30729.01 for 80x86.
Suggestions on to use some other compiler ( gcc, mingw, intel etc.) will not be helpful at the moment.
The C++ compiler is named cl. The compiler options are well-documented on MSDN. The linker is named link. The linker options are also well-documented on MSDN.
You'll need to run vcvarsall.bat to be able to build with the Visual C++ toolchain; this batch file sets up all the required environment variables and such. If you've installed Visual Studio, you should have a shortcut on your Start Menu entitled "Visual Studio Command Prompt." This shortcut will get you a command prompt and run that batch file.
For DLLs, pass the /c flag to cl.exe (which compiles but doesn't link), and pass the /DLL flag to link.exe. Instead of making an executable, it makes a DLL.
For static libraries, use the lib.exe program.
There are multiple approaches, all of which are handily documented in one place:
Visual C++ Concepts: Building a C/C++ Program
Building on the Command Line
Note that the build system completely changed between VC++ 2008 (which you're using) and VC++ 2010 (which is the current release).
A couple of minor things to add.
Personally I wouldn't use Windows batch files.
I would use nmake http://msdn.microsoft.com/en-us/library/dd9y37ha(v=vs.71).aspx building outside of visual studio is nmake's day job and that's the standard way to build visual studio projects for release say on a build machine, rather than in a development environment.
The other thing in nmake's favour is that if cross-platform is important to you then cmake ( http://www.cmake.org/ ) is a brilliant tool for dynamically creating Windows nmake files and non-Windows make files and it comes with ctest for running your unittests and selftests.
Advert over.
I am trying to get started with an existing open source project (QuantLib) using Linux operating system. However it seems that most developers use Visual Studio (judging from the project files committed with the source).
Which Linux C++ IDE would be most compatible with VS project files? Is there a way to import/export them, so that I don't have to create my own projects from scratch (and update them every time someone adds a new file)?
EDIT: Its all unmanaged code
In my experience, the best method for doing dual-development on Linux & Windows is to throw away the existing Visual Studio project files and, instead, use CMake to generate the platform-specific build environment. It's capable of outputting Nmake makefiles (for command-line Windows builds), Visual Studio projects, and Linux makefiles. The documentation leaves a bit to be desired but once you have it up and running, it's very easy to maintain.
The FAQ provides installation instructions for MinGW. It seems that there is a GNU Makefile included, so you don't need to mess with Visual Studio project files.
Aparantly they they only build on MAC and Windows.
Instructions here: http://quantlib.org/install/macosx.shtml
But since MAC is basically BSD Unix it should be identical (or with little trouble) to get it up and running on Linux.
The following should work (though you may need to look at the configure options)
1) Install Boost.
2) ./configure
3) make
You'll definitely want to check out Mono, it might be just what you're looking for: http://monodevelop.com/
I have a VS 2008 C++ project, with one very small and simple code file. I need to write an app to generate this file and build the project into a Win32 DLL. I will need to deliver a free compiler etc. with the app to my client, so I can't automate VS to do this.
How would I best go about this?
VS 2008 Express installs the command line compiler (in fact the installer has an option so you only get the command line stuff). So getting a free compiler is no problem.
If you really only need to build a single file into a DLL, a cl command using the '/LD' option should be enough to do the trick (though you'll likely need at least a couple other options).
If you want to get fancy, I'm not sure if The Express SKU includes nmake.exe (but I imagine it does).