Can't compile C++11 code on VS2012 - c++11

I had a project I had built on VC++ 2010 Express. I updated the project to VS2012 but I can't compile the following c++11 code:
const Uint16 text[]=u"Hello World! \u20AC";
I get the errors:
Initialization with {...} expected for aggregrate object and
expected a';'
What's the cause of this and how can I correct this errors?

Related

fatal error C1189: #error: <future> is not supported when compiling with /clr or /clr:pure

When porting Qt to 5.10.1, I am getting following error
Reason for Error: Visual studio Build with clr(Common language runtime ) support settings, so that above error is generated.
C/C++ Advanced > showIncludes sets "Yes", so It has been identified that from Qt's QThread above error is generated.
How to resolve above error in Qt 5.10.1 with VS2015 ?
Note: I am using C# dll in my Qt VS project
Make sure QThread doesn't include when clr is enabled.
I have done conditional compilation for my project include
#ifndef CLR_ENABLED
#include <QtCore/QThread> //Error C1189: #error: <future> is not supported when compiling with /clr or /clr:pure. Qt5 porting.
#endif

vs2017 compile error: double inclusion of header boost/config/abi_prefix.hpp

I upgraded some vc2008 projects into vc2017 projects, and replaced boost_1_47 with boost_1_64.
Vc2008 projects were correctly compiled, but vc2017 projects reported an error:
fatal error C1189: double inclusion of header boost/config/abi_prefix.hpp is an error
what does it means? And how to solve it?
I used VS2017 with vc141 toolset and windows 10 SDK

cmake generated visual studio solution failed to build

I am currently working on a project on windows 10 and was asked to use some c++ code for it. The code was written with plattform independence in mind. So I used the given cmake files to build a visual studio solution (VS 2015 Update 3). But when I try to build the solution it gives me over 900 errors and warnings.
The same project was successfully build on a mac using cmake and g++. The project itself uses a Qt gui and some additional libaries like boost.
To understand the errors you have to know, that the solution consists of 5 projects: ALL_BUILD, iModControll, iModDaemon, iModView and ZERO_CHECK
There are a lot errors like:
missing type specifier - int assumed. Note: C++ does not support default-int
inconsistent dll binding
declaration not found
unexpected token before ;
and so on...
You can see the full list here
I am very new to cmake and not an VS expert, so please help me to understand what went wrong here. Again: the code compiled perfectly under OSX.
EDIT:
I used mingw, as #MaxGo suggested. The errors and warnings were reduced after that. Here is what I have now:
warning: void DC_TermFunc()' redeclared without dllimport attribute after being referenced with dll linkage
void DC_TermFunc(void)
{
if(controller)
{
qDebug() << "Terminating iModSkynet";
runthread->terminate();
delete runthread; // This will delete the controller too
}
}
error: function 'void DC_SendData(char, char*, int)' definition is marked dllimport
IMODCONTROLLSHARED_EXPORT void DC_SendData(char oc, char* data, int length)
{
QByteArray qdata = QByteArray(data, length);
controller->sendBlenderCommunication(oc, qdata);
}
The other errors are similar. My question is: Are there any known issues when porting c++ source code to windows, why does it not show as many errors as in VS and what can I do to solve these errors?
CMake Configuration- Boost- Visual Studio - C++
Step 1: Download CMake installation file, install and save it in local disk
Step 2: Create 2 Folders in local disk a) Raw File b)Solution File
Step 3: Raw File folder- Create a Main.cpp file and paste your raw c++ code it it and save. Now in the same folder create a txt file named CMakeLists and paste the following code in it and save.
cmake_minimum_required(VERSION 3.7)
project (cmboosttest)
#find_package(Boost REQUIRED)
#include_directories(${Boost_INCLUDE_DIR})
add_executable(boosttest ${PROJECT_SOURCE_DIR}/Main.cpp)
Step 4: Open CMake choose Raw File folder in browse source and Solution File Folder in browse build.
Step 5: Click Configure. Once it succeeds, click Generate.
Step 6: When you open the Solution File folder, you can see the built solution file. Click on it and your program will open in Visual Studio. Now, build your program in VS.
Hope this helps!

How to compile libprotobuf in Release/Debug x64 mode using Visual Studio 2013

I am able to compile in win32 but i am getting below error when compiled in x64
Error 1>------ Build started: Project: libprotobuf, Configuration:
Release x64 ------ 1>LINK : fatal error LNK1561: entry point must be
defined
Can we really compile libprotobuf targeting x64?
any help is really appreciated
I was using protobuf-2.6.0 where i was getting the issue. After migrating to Protobuf-2.6.1 i am able to generate libprotobuf.lib for x64.

How to solve build errors using VS 2010 Ultimate on 32bit XP Sp3

Installed VS2010 Ultimate on my desktop workstation - Dell Precision T3500 (Windows 7 64bit OS), and on my IBM ThinkPad R51 (Windows XP Sp3 32bit).
I am having problems building solutions on the StinkPad, and cannot figure out why. As listed below, the build output for a compiler built ADO library lists the following errors:
c:\wpds\debug\msjro.tlh(196): error C2146: syntax error : missing ';' before identifier 'ConflictTables'
c:\wpds\debug\msjro.tlh(196): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
c:\wpds\debug\msjro.tlh(196): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
c:\wpds\debug\msjro.tlh(224): error C2146: syntax error : missing ';' before identifier 'GetConflictTables'
c:\wpds\debug\msjro.tlh(224): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
I have checked to make sure that all include, exe, and library paths are correct for all projects and solutions. Any insight will be greatly appreciated.
Thanks
Bill
I encountered this same problem when compiling for the first time with a new version of msado15.dll. There are dependencies between msado15.dll and msjro.dll, as evidenced by these lines at the top of msjro.tlb:
// Cross-referenced type libraries:
//
// #import "C:\Program Files (x86)\Common Files\System\ado\msado15.dll"
//
In my case, the problem arose because I'm building my app on Windows 7, and the SP1 update includes a breaking change in msado15.dll that will cause the application to fail on Windows XP. When I fixed this problem using this KB, my msado dll problems were fixed but my msjro.tlb stopped compiling.
There is probably a way to update msjro to reference the desired/correct msado (in my case, msado60_Backcompat.tlb as installed in the KB), but if you're using CADODatabase classes defined in ado2.cpp and ado2.h, and if you're not using jet-specific features, a simpler fix is to just comment-out the portions of ado2.h and ado2.cpp that reference jet.
I just commented out this line in ado2.h:
//#import <MSJRO.DLL> no_namespace rename("ReplicaTypeEnum", "_ReplicaTypeEnum")
and also #ifdef'd out all of the implementations of CJetEngine methods in ado2.cpp, and that worked for me.
Good luck!
I had this problem too. Then I compared the MSJRO.TLH created on WinXP to the one created on Win7. On WinXP the declaration was
ADODB::_RecordsetPtr ...
on Win7 it was
_RecordsetPtr ...
I guessed that the problem might be related to namespaces. MSADO15.TLH defines a namespace -"ADODB". So I placed:
using namespace ADODB;
before my import of the Jet.
#import "MSJRO.DLL"
This got rid of the errors for me.

Resources