no stdint.h in Visual Studio 2005, cannot compile - c++

I am trying to compile the format.h and format.cc classes found here:
https://github.com/vitaut/format
I can compile the files no problem on Visual Studio 2010, but 2005 will not compile due to a missing stdint.h class. If I write a wrapper and compile the class into a static library in Visual Studio 2010, would I run into any issues compiling / linking and ultimately executing with it in Visual Studio 2005? I would think no...

Thanks deviant fan for the link. That sounds like the best approach. It turns out that the code posted here:
C++ performance challenge: integer to std::string conversion
by user434507 is actually faster for my case than the format library referenced above. So I'm simply going to use that instead.

Related

Visual Studio 2010: chrono header file missing

I just installed Visual Studio 2010 Ultimate and wanted to write a simple program in C++.
But it seems like VS doesn't find the header file "chrono".
I tought installing SP1 would help, but it didn't.
There also some other header files like "thread" missing.
Does anyone know where I can get these missing files?
VS2010 only has partial C++11 support. You need VS2012+.
As an addition to Mark's answer, no Visual Studio version fully supports C++11 now. Here is the complete table of features: C++11 Features (Modern C++)
You can also read here for getting more information BOOST
Chrono is a standard template library that has been introduced in Visual Studio 2012.
Chrono is used to manipulate time durations and time instants.
Visual Studio 2010 or even with SP1 will not support Chrono.

I need to change compiler on VS

I have made a sudoku solver using SDL (for GUI) on VCpp 2010 IDE.
The program compiles without errors and runs fine. However, i cannot pass the compiled executable on to some people because they don't have msvc dll on their pc.
I thought i could use devc++ that compiles with GCC but this IDE is kinda buggy and just won't let me include some header files.I also have some problems setting up SDL expansions.
So, is there a way to change VisualStudio compiler to GCC?
I really need to stay with VS because it is easy to use and there is a lot of online support.
Short answer: no, you cannot change cl.exe (MS cc compiler) with gcc. Or mingw. (You can with a compatible compiler, like Intel C compiler)
Long answer: you don't need to to that. Use the static linked runtime library, and you don't have a dependency ms dlls anymore (see this answer: How do I make a fully statically linked .exe with Visual Studio Express 2005?)
Or redistribute the VC++ runtime with your app. It's free (http://www.microsoft.com/en-us/download/details.aspx?id=26999)
You don't need to change compiler - they need to download the Visual Studio 2010 redistributable:
http://www.microsoft.com/en-gb/download/details.aspx?id=5555
In short: no. You can't simply use the GCC compiler in Visual Studio.
The long version: you can use a Makefile project to run GCC, but then you lose some of the benefits of using Visual Studio.
I'm not sure when this became a feature in Visual Studio (probably wasn't one in 2013), but it is now possible to change the "Platform Toolset" - and thus the compiler - used by Visual Studio to other compilers like Clang/LLVM and GCC. I have been happily using Clang with VS2017 ever since the MSVC++ compiler bugged up with some 3rd party libraries.
Microsoft made a blog post on the installation instructions and how to switch.

OpenGL: How to compile glew32.dll from source file

I download the glew source file from http://glew.sourceforge.net/.
In the readme file, it says I should use \build\vc6.0\glew.dsw to comple the DLL.
But there are four projects after I open it in VS 2010.
When I compile them, 2 of them failed to compile.
Thanks.
Ok.
I figured it out.
Just open the the file in glew.dsw in VS 2010.
There are four projects.
Compile glew_shared, you will get glew32d.dll.
Compile glew_static, you will get glew32d.lib.
just ignore the other two.
glew32d.dll and glew32d.lib works fine in VS 2010.
This also answer my own question in
Glew in VS 2010: unresolved external symbol __imp__glewInit
Just a guess but by the way that folder is labelled, it's probably meant to compile using Visual C++ 6.0, which came with Visual Studio 6. I just gave it a quick try and built without problems under that IDE. Of course, I don't believe Microsoft offers that product anymore. If you want to build it yourself, you'll probably have to upgrade the code base to Visual C++ 2010.
I ran into the same problem. I converted the original project to Visual Studio 2010 and placed the result in https://github.com/chrisoei/glew. See the downloads section for a zip file containing glew32.dll built using VS 2010.

Is it possible to compile ffmpeg in visual studio 2010?

Is it possible to compile the sourcecode from ffmpeg in visual studio 2010? Is it difficult?
Just looking for some advice (and instructions) if possible. :-)
Cheers,
Pete
Apparently someone at Google has written a C99 to C89 "downconverter" in part to get ffmpeg to compile with Visual Studio:
http://blogs.gnome.org/rbultje/2012/09/27/microsoft-visual-studio-support-in-ffmpeg-and-libav/
The tool they wrote is currently only in source code form. Although that tool is written in C, it uses some compiler specific includes, specific to the Clang compiler, so you currently need clang to compile it. I had to get all the pieces to Clang (which relies on llvm) and compile with VS2010. OK, got that figured out, so now I have the two tools compiled: c99wrap.exe and c99conv.exe.
The blog does not mention two important things that are mentioned here:
http://libav.org/platform.html#Microsoft-Visual-C_002b_002b
First, you have to ensure the link.exe you use is the Visual C linker and not the mingw linker. Also, the msvc toolchain under msys does not yet support shared DLL builds, it only supports static lib builds at this time, so --enabled-shared fails to link.
It is not possible because ffmpeg makes extensive use of C99 features (with good reason), and MSVC doesn't support nearly enough nook and crannies of the standard.
You can however, use the C library built by MinGW for use with Visual Studio projects. See the following links for all the information you need:
Information about building/using the library on Windows with Visual Studio: http://ffmpeg.arrozcru.org/wiki/index.php?title=Main_Page
Downloads: http://ffmpeg.arrozcru.org/autobuilds/
Of course it is possible
To use FFmpeg SVN libraries with your Microsoft Visual C++ project,
you must first make sure your Microsoft Visual C++ build system has
the inttypes.h and stdint.h include files.
How do I know if I have those files? Well... unless you already did
this and know you have that file, you don't have it. MSVC++ does not
adhere to the C99 standard, where that file is specified, so you're on
your own here.
Alexander Chemeris was nice enough to make such files for Microsoft
Visual C++, so they can be found here
Download latest archive from link above and unpack it to the folder to
which you installed FFmpeg's include files. The default path is
/usr/local/include, which is, in this guide for Windows,
C:\msys\local\include.
Inttypes C99
Visual Studio 2013 provides the support for C99 which was missing earlier. With this ffmpeg can now be built using Visual Studio 2013. You can read more about the new language/libraries features here.
Also, try out Visual Studio 2013 RC here.
According to the documentation it is not possible.

Visual Studio environment alternative

I use Visual C++ (7.1 and 8.0) on huge C++ project. The solution contains thousands of files. Visual Assist helps in jumping to function and class definitions. The problem is that it sometimes becomes too slow. I just can't edit a single letter without delay.
Is there some alternative to this environment? I mean something that may read .sln and .vcproj files, use MSVC debugger, compile with MSVC compiler or even use IncrediBuild if necessary. I don't need any sophisticated features. It should be possible to find and open a file by name and jump to function/class definition from place where it is used.
May be Vim with some plugins? Or something else?
It seems there is no alternative to MS Visual studio. I've added separate HDD for source files and it works much better.
Currently i left Visual studio because c++ support just sucks (still using Visual studio 2013 but only for C# projects)
i use NetBeans right now, and really enjoy the refactoring part.
The visual C++ compiler support can be added using a free plugin (VCC4N - Visual C++ Compiler For NetBeans)
good luck