__int64' followed by 'int64' is illegal - c++11

i have very old project who has been made in visual studio 2008 with windows xp 32 bit.
I am trying to run this project in windows 7 64 bit with visual studio 2017.
i dont know much details about the project.
i know that MFC MBCS pakage was use.
so now i am trying to compile it and got some compilation errors.
the main one is :
__int64' followed by 'int64' is illegal
in the stdint.h file.
the line that get the error is:
typedef long long int64_d
i check the project and there is no call or use of the stdint header.
i read that it can be because the code build with old version of c++ and now i try to compile with higher version then c++11.
any help will be very appraised.
Thank You!

Well i figure it out.
the problem was that i am using old libs and dlls(probably made by v100 toolset of VS 2010) ,
so i set the platform toolset to the same version of the visual studio that make those
libs and dlls - visual studio 2010 v100.
to do that go to :
right click on the project
properties
configuration properties
general
platform toolset
and set it to v100(or other version needed)
now it's work fine!

Related

Specify include-path and library-files for code generation in Simulink Coder

This drives my crazy: I have a simulink model with an s-function generated by the s-function builder. I use some external header and library files (lib/dll) and all works in simulink-normal-mode.
But if I try to run my model in rapid accelerator or try to build the model for code generation I get LNK2019 errors. It seems that for code generation, Simulink does not know about my header-files (include folder) and my lib-files (folder and files) anymore. But I did specify all of these within the mex command for my s-function. Otherwise, the model wouldnt work in normal-mode.
Is there something I did miss that I should do for code generation?
With the Microsoft compiler setup I have found it to be very troublesome and causing this error not due to my setup in Matlab, but due to the installation of the MSVC components:
Need to remove the following two packages first (Must Do, Very Crucial)
Microsoft Visual C++ 2010 Redistributable -x64
Microsoft Visual C++ 2010 Redistributable -x86
Remove the current .NET framework and install an older version or not
Install the Microsoft SDK 7.1 and this process may take a little bit time
Make sure that the PC has one of the following installed
Microsoft C++ 2010 SP1 Compiler Update for the Windows SDK 7.1
Visual Studio 2010 Professional or Express

Compiling Visual Studio 2010 project in VS 2012 (C++): error LNK2038: mismatch detected for '_MSC_VER': value '1600' doesn't match value '1700'

I've been sent a sample app for a newly minted SDK, and I can't compile it - it won't compile at all in Visual Studio Express for reasons of ATL, and that seems to be the only version of VS 2010 that Microsoft still makes available. So I'm trying to compile it in VS 2012 Professional, but it gives me error LNK2038. From what I can gather e.g. from this thread, the problem is down to trying to use .lib files compiled for 2010 in the 2012 version. Since I'm not the one who compiled the .lib, and I don't have the code for it, and VS 2010 is inaccessible, I'm really not sure what to do about this unless the original authors recompile it. Any suggestions? Something basic I'm missing? Many thanks for any help.
Library files cannot be reused across different versions of the compiler. You will need to do one of the following:
Compile your project with the same version of the compiler used for creating the library files you have.
Obtain new library files from the owner of the code, compiled using the same compiler you are now using.
Obtain the source code for the libraries, and compile new versions of them yourself.
Rewrite the code you own to not depend on the libraries you cannot control, since your build environment does not allow for their use.

load c++ dll in ironpython

I have an ironpython app that uses dlls.
Some of the dlls written in c#, and one is in managed c++.
The app works fine on my host, and on any host that includes visual studio (2010) installation.
When I tried to run this app on hosts without vs, It failed. After some checking I discovered that ironpython cannot load the c++ dll.
After installing vs - the app runs fine.
I narrowed it down: the dll can be uploaded after the installation of:
-Microsoft application error reporting
-VC 9.0 Runtime(x86)
-VC 10.0 Runtime(x86)
-Microsoft visual studio macro tools
I tried to install Microsoft Visual C++ 2010 Redistributable Package http://www.microsoft.com/download/en/details.aspx?id=5555 and it didn't do the trick.
Why? what exactly happens in installation of vs, that doesn't occur when I install Microsoft Visual C++ 2010 Redistributable Package component?
How can I monitor errors that arise when loading dlls with ipy?
Thank you!
The DLL that is written in managed C++ uses a DLL for its standard libraries. You can change it to static libraries. Follow these steps
Open your project properties in Visual Studio (right click on the project)
Click you way to Configuration Properties > C++ > Code Generation
On the right, find Runtime Library and select Multi-Threaded Debug (/MTd)
Do the same for the Release build, but this time select Multi-Threaded (/MT)
Rebuild all
As for your specific questions :
1. The redistribuable installer will copy the DLL in the system path. Visual Studio will do the same thing. So if it doesn't work, make shure that you have the 32 or 64 bit binaries (same as your code, not the platform you are running). +If you are running from a console, close it and start a new one to get the updated path.
2. Use Dependency Walker. Loading your DLL will show you what it is looking for, it should be enough. To monitor its runtime execution, load IronPython. In the "Profile" menu, select "Start Profiling" and provide a command line that will reproduce your problem.

Compatibility issues when upgrading a C++ project from VS 2005 to VS 2010 Express

I was given some files that were built in Visual Studio 2005 version.
When I tried to convert the .sln file to use in VS 2010 Express C++, however, I run into problems.
The error gives out the path and says that the file was not found even though the file is there. I know there shouldn't be any compatibility issues between the two unless I am missing something. Has anyone run into this type of problems?
The exact error message is:
"Conversion Report - GeoM\GeoM.vcproj: Converting project file
'C:\Users...\GeoM\GeoM.vcproj'. File 'C:\Users...\GeoM\GeoM.vcproj' was not found. \
Project upgrade failed.
The most likely explanation is that your C++ project has been configured to support compilation for a platform other than x86 (such as x64 or IA-64).
This is explained on the Visual C++ blog, in the Visual Studio 2010 C++ Project Upgrade Guide:
Make sure you have the required platforms installed before doing upgrade
Converting a project on a machine without all the available platforms for the project will result in a conversion error. For example, if you try to convert a project with Itanium Platform on Visual Studio Professional SKU, which does not support the Itanium platform, you will see a conversion error like the following:
Failed to upgrade 'Debug|<Itanium>'. Please make sure you have the
corresponding platform installed under '%vctargetspath%\platforms\Itanium'.
Cannot load the project due to a corrupt project file. The following error
has occurred during XML parsing:
File: D:\Sample\ConsoleApp\ConsoleApp.vcproj
Line: 28
Column: 5
Error Message:
System error: -2147154677.
The file 'D:\Sample\ConsoleApp\ConsoleApp.vcproj' has failed to load.
This is by design as the conversion needs to evaluate the properties in the missing platforms to do a successful conversion. You can verify which platforms are installed on your machine by looking in the following directories: %ProgramFiles%\MSBuild\Microsoft.cpp\V4.0\Platforms (or %ProgramFiles(x86)%\MSBuild\Microsoft.cpp\V4.0\Platforms on x64 machine) for the Platforms installed on the machine.
Since the Express version does not support compiling C++ applications for either of these platforms, the upgrade wizard is failing to convert your project and returning the described error message.
The only way this upgrade is going to succeed is if you use a full version of Visual Studio (with the appropriate platform compiler tools installed), or if you edit the solution/project files that you have to remove any mention of a non-x86 configuration. You should be able to do this with a simple text editor like Notepad, but as always, back up first in case you destroy something irreplaceable.

Compiling CUDA with Visual Studio 2010

I have used Visual Studio 2008 to compile and run CUDA applications before. I have switched to Visual Studio 2010 and Windows 7. I've been trying to get integration set up all morning, but haven't had complete success. I've downloaded the toolkit, installed Nsight, made sure the libraries/include/bin paths are set, checked the box to use a Build Customization of CUDA 3.2, and set the properties of the individual .cu file to be of type CUDA C/C++ instead of C/C++. I got an error about not supporting compiler v100, so I set the project platform to v90 and am downloading Visual Studio 2008 now. I was hoping that I wouldn't have to have two versions of visual studio installed, but oh well. Anyway, most of the syntax highlighting is enabled, some keywords like "int" is blue, comments are green, and strings are red. However, cuda-specific keywords like __ global__ aren't. Also, I've checked through the include directories and can't find cutil.h, so I'm wondering if there's anything else that wasn't included in the install of the 3.2 SDK (I have included cuda_runtime.h instead, but I don't know if this will solve my problems). Does anyone know how to fix this?
Edit: I have Visual Studio 2008 installed. When I try to compile, I get a giant list of errors, starting with 1>C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\crtdefs.h(490): error : invalid redeclaration of type name "size_t", while most of the following errors have to deal with the size_t type. All of the errors are in included files, most of which I've never seen. Does anyone know what's going on? Or if there's a simple, step-by-step guide to getting VS2010 to use cuda?
Edit 2: Apparently I had one of the many current settings as 64-bit, and the others as 32-bit. Changing the active configuration, Cuda C/C++ Target Machine Platform, and Linker|Advanced Target Machine all to 32-bit or 64-bit allowed me to compile and run. I still don't have any idea how to fix the __ global__ and such syntax highlighting, but it's not that big of an issue.
You'll find a complete guide here:
How to Run CUDA In Visual Studio 2010
you can check if the source file that contains kernel is a CUDA/C file rather than a C/C++ file. (Solution Explorer -> File Properties)

Resources