atlbase.h not found when using Visual C++ Express 2010 - visual-c++

So I tried moving my project to Visual C++ Express 2010 on Windows 7 from a previous version on Windows XP. I got all sorts of errors where atlbase.h was not found. This isn't so much a question but I wanted to document what my resolution was for others.
Copied the following PlatformSDK files from my previous install and put them on my Windows 7 machine.
PlatformSDK/include/atl
PlatformSDK/include/mfc
PlatformSDK/lib
PlatformSDK/src/atl
I then change the VC++ Directories in the project Properties to point to those directories.
Include Directories-
*include/atl
*include/mfc
Library Directories-
*lib
Source Directories-
*src/atl
Make a change to stdafx.h
right after this line: #include "atlbase.h"
add this line: extern CComModule _Module;
Hopefully you're ready to go now! Probably not but perhaps you are well on your way.

ATL and MFC were not included into free Express versions of Visual Studio. This is the primary reason behind the problems locating the include file. ATL still is is part WDK. If you have ATL isntalled with a previous version of VS, or with WDK, you need to go to project setting an update your includ directories respectively, so that ATL *.h files are picked up. See post below for more details and discussion.
How to add WTL and ATL to visual studio c++ express 2008
Why were MFC, ATL and masm not included in VC++ Express?
Please include ATL to VC++2010 Express or Windows SDK

this is probably because the previous version that you were using was visual c++ 6.0 and that doesn't support it

ATM, it seems to be non-free.
SDK v7.0 Samples -- no atlbase.h

There is now an ATL-inspired WRL library for the Windows Runtime that apparently supports building Classic COM objects (see http://msdn.microsoft.com/en-us/library/jj822931.aspx). It is included in Express but I haven't tried it.
Even though ATL 7.1 is in WDK 7.1 it's quite annoying to set up so please consider voting to bring back ATL to VS Express ;) https://visualstudio.uservoice.com/forums/121579-visual-studio/suggestions/3252947-add-atl-to-visual-studio-2010-express-for-desktop

Related

Can someone tell me how to Configure Visual C++ 2015 with CPLEX?

I tried tutorial steps for Visual 2010, the linking didn't work or the console doesn't respond to build or run. I tried for other options to configure, which also didn't work as well.
You may vote for a request for enhancement at https://www.ibm.com/developerworks/rfe/execute?use_case=viewRfe&CR_ID=85231
regards
Alex Fleischer
It can be a bit complicated...
First, I think you should start reading the following tutorial. I find it quite straightforward as adapted to any CPLEX version. You must only notice that using a CPLEX version 12.X translates into the usage of its library: cplex12X.lib, the tutorial referring to CPLEX v12.61.
Then, you must install Visual Studio 2012, or even 2010, as they will install another Platform Toolset, v110 for VS2012 or v100 for VS2010. This is required since CPLEX comes with libraries for the 2010, 2012 and 2013 only, there is none so far for VS2015.
The configuration might work even if you have already VS2015 installed on your computer but I strongly advise you to begin installing the older version first, then the VS2015 to ensure the latter will recognize the older Platform Toolset and give you the option under: View\Property Pages\Configuration Properties\General\Platform Toolset of choosing the v110 for your project.
Be aware that using only VS2015 will prompt you a bunch of LNK2038 mismatch detected for '_msc_ver' errors letting you know that you're using version 1800 whereas you're linking libraries compiled on 1600 or 1700 versions.
One is glad to be of service
As of CPLEX 12.6.3, VS2015 is not supported (see the detailed system requirements here). It is possible to use VS2015 with a VS2013 project (e.g., see here), but this is probably not what you are looking for.

Which Windows Libraries are missing from the Visual C++ Redistributable Package?

I am using JNI to interface to a CAN driver I wrote using MSVC++ 2012. Everything compiles and runs fine - but only on my computer. Whenever I try to run on any other computer, I get the JNI "UnsatisfiedLinkError" - can't find dependent libraries. I've implemented JNI before, and typically this issue is resolved by simply installing the Microsoft Visual C++ Redistributable Package before running my program. The Redistributable does not solve my issue, however, installing the entire MSVC++ Express 2012 IDE on the computer in question seems to make everything work just fine. Thus, I assume this means that there is some dependency that gets installed and added to PATH when the IDE is installed but not when the Redistributable is installed. Just for verification, I uninstalled the IDE and my JNI driver failed to load once again. The primary difference between this and my other implementations of JNI is that I use Windows.h since it is required for the CAN API I use in my driver. Any ideas on any libraries installed with the IDE but not the Redistributable and whose prototypes are included with Windows.h? (Note: I am aware that Windows.h includes a number of headers itself but I imagine the other criteria make the issue a bit more specific.)
First guess: You are installing a debug build intead of a release build. Debug builds depend on debug versions of the CRT, which cannnot be redistributed.
Check that you are using the right "Microsoft Visual C++ Redistributable Package". There are 2012, 2012 Update 1 and 2012 Update 2 (as well as many for 2010, 2008, ...).
Assuming your dependencies are load-time DLLs, you can use Depends to find out what's missing. (Note: you'll typically see some delay-load DLLs that are "missing". Ignore thoses; See the FAQ.)
Of course, once you find out the name and path of the missing DLL, you'll have to find out what redist package installs it.

RC2176 : old DIB in res\MyApp.ico; pass it through SDKPAINT in VC++ 2008

Yeah, a question regarding this error exists. But I think it's quite different situation from the one the OP was in.
I just created a MFC application in VC++ 2008 (pro version) and compiled it. The compilation failed because of the error
RC2176 : old DIB in res\MyApp.ico; pass it through SDKPAINT
I must've missed something because VC++ created the icon that is not compiling. Any clue would be appreciated.
UPDATE: I forgot about this issue for a while. I fixed the problem by following solution to this question - Can't open resource editor in VC++ 2008
Answered already in the linked question: error RC2176 : old DIB in res\icon3.ico; pass it through SDKPAINT?
If you would install and integrate a more recent (same or later release date than VS 2008) SDK with VS 2005, that also resolves it. You can also go to C:\Program Files\Microsoft Visual Studio 8\VC\bin (or your equivalent of the path) and replace the files rcdll.dll and rc.exe with the ones from a more recent VS, WDK or SDK.
Side-note: the version of rcdll.dll and rc.exe must match, that is you need to copy both at once from your source (be it VS, WDK or SDK). For me any version starting with 6.0 or 6.1 worked. That's any version starting from the compilers that accompanied the Vista SDKs and VS versions or later.
Did you install Service Pack 1? Also, if you install a newer Windows SDK and use it in your environment, this could very well cause a conflict of some kind.

Side by side installation problems with Visual Studio 2008

I develop an unmanaged DLL with Visual C++ which is part of my application. I have always had various problems with linking the VC runtime library. Somehow I managed with VS 2005, but since I moved to VS 2008, the release version of my DLL no longer works on any PC other than the one with my development tools (namely VS 2008).
I link the runtime library as multi-threaded DLL (/MD). I tried the /MT option but that causes a lot of error messages. I allow isolation of the manifest file, and of course installed the VC++ 2008 runtime (although I don't think it should be needed). I also tried the dependency walker to check what is missing. On my development PC (VS 2008 SP1 installed) three files are reported missing:
MSVCR90.DLL, GPSVC.DLL, IESHIMS.DLL
But that does not stop the application (and my DLL) from running.
On all other PCs I tried to install my application on, apart from these three, a fourth file is reported as missing by dep. walker: MSVCP90.DLL.
More importantly, my own DLL is not working as well.
I know this is nothing new and I tried to read everything I could find about SxS problems but I still don't know what to do. Hopefully my description of the 'phenomenon' is good enough for someone more experienced to give me some help.
Thanks in advance.
You may need to distribute and install Microsoft Visual C++ 2008 Redistributable, OR SP1 versionf of it.

Getting others to use my apps with Visual C++

I am learning how to build games in Visual C++ and when I upload them so friends can check them out, they all end up with messages saying it can not run. I did some research and found that it is because I am compiling against a Dynamic library instead of a static library. Correct me if I am wrong anywhere please. Upon further research, I found that a lot of people do not advise going this direction but instead include the files needed by my game.
How would I go about distributing my games to friends and make it real easy for them to just open up my .exe and play the game?
If you link to any DLLs, you also need to ship those along. If you produce a single .exe in your output, you probably need your friends to install the MS Visual Studio redistributable package for your version of visual studio. This is an example link for the VS 2010 one, but the one you give your friends should match your version.
There are essentially two options: Keep everything as-is and provide them with the runtime files (also named Microsoft Visual C++ * Redistributable Package or similar; the * has to be replaced with your version, e.g. 2005, 2008 or 2010). Downloads can be found on Microsoft's download site as well as in your Visual Studio installation folder (look for a folder called "Redist").
Alternative solution: In your project settings you're able to select the runtime environment (under linker options). Change your release build to use "Multithreaded" instead of "Multithreaded-DLL".

Resources