I try to compile the following solution:
https://github.com/TimoKunze/EditControls
When I try to compile it using VS 2022, I am getting the following compiler error:
Error C1189 #error: /RTCc rejects conformant code, so it is not supported by the C++ Standard Library. Either remove this compiler option, or define _ALLOW_RTCc_IN_STL to acknowledge that you have received this warning.
EditCtls C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.34.31721\include\yvals_core.h 1542
How could I get rid of this compiler error?
Here are my directories:
Include directories:
D:\Projects\Libraries\WTL\Include;$(IncludePath);$(VCInstallDir)atlmfc\include
External Include Directories:
$(VC_IncludePath);$(WindowsSDK_IncludePath);
Library directories:
$(ProgramFiles)\Windows Kits\10\Lib\10.0.10586.0\um\x86;$(LibraryPath);$(VSInstallDir);$(VSInstallDir)lib
Library WinRT directories:
$(WindowsSDK_MetadataPath);
Source directories:
$(VC_SourcePath);
I am pretty new with C++, and I don't know how to "define _ALLOW_RTCc_IN_STL to acknowledge that I have received this warning."
I also don't see that the /RTCs is defined anywhere in the project property page. Where would I find that?
Related
I am developing TCP/IP program using Boost.Asio but I am getting error :
note: see declaration of 'std::allocator<void>' 1>d:\hardware\libraries\visual studio 2017\x64\include\boost\asio\use_future.hpp(137): error C4996: 'std::allocator<void>': warning STL4009: std::allocator<void> is deprecated in C++17. You can define
_SILENCE_CXX17_ALLOCATOR_VOID_DEPRECATION_WARNING or _SILENCE_ALL_CXX17_DEPRECATION_WARNINGS to acknowledge that you have received this warning.
After reading the error I understood that I have define
_SILENCE_CXX17_ALLOCATOR_VOID_DEPRECATION_WARNING
or
_SILENCE_ALL_CXX17_DEPRECATION_WARNINGS
I define them once in Configuration Properties -> C/C++ -> General -> Additional #using Directories but error is still persistent.
Then I #defined booth the macros in main file before including any header but still the error persisted.
Then I declared the macro in my per-compiled herder but the error still persisted.
I even tried 2 different boost packages. One installed with vcpkg package manager and one pre-fill binary.
MSVC 14.1 x64
Boost : 1.68 (x64)
Just Turning off "SDL checks" is all you need.
Detail: property page of current project> 'c/c++'>'General'>'SDL checks'
(VS2019, Win10 X64; 2021/01/27)
I use MinGW64+msys on Winodws7 64bit
Now I’m trying to build CMAKE but I can’t.
When I typed ./configure soon an error happened. .
---------------------------------------------
CMake 3.2.3, Copyright 2000-2015 Kitware, Inc.
Found GNU toolchain
C compiler on this system is: gcc
---------------------------------------------
Error when bootstrapping CMake:
Cannot find appropriate C++ compiler on this system.
Please specify one using environment variable CXX.
See cmake_bootstrap.log for compilers attempted.
I also find error messages in Bootstrap.cmk/cmake_bootstrap.log like bellow.
[First Message in the log file]
In file included from c:/mingw64/x86_64-w64-mingw32/include/c++/iosfwd:40:0,^M
from c:/mingw64/x86_64-w64-mingw32/include/c++/ios:38,^M
from c:/mingw64/x86_64-w64-mingw32/include/c++/ostream:38,^M
from c:/mingw64/x86_64-w64-mingw32/include/c++/iostream:39,^M
from cmake_bootstrap_4468_test.cxx:3:^M
c:/mingw64/x86_64-w64-mingw32/include/c++/bits/postypes.h:40:35: fatal error: cw
char: No such file or directory^M
compilation terminated.^M
[Second Message in the log file]
cmake_bootstrap_4468_test.cxx:5:23: fatal error: iostream.h: No such file or dir
ectory^M
compilation terminated.^M
Test failed to compile
They said cwchar and iostream.h doesn't exist, although I have them and set their path to environmental variable.
The first massage said my C++ compiler isn’t appropriate. I installed it by mingw-get.exe.
Does anyone know, how can I get appropriate C++ compiler?
You mixed two compilers. I recommend: delete your old one and install msys2+mingw64.
I am currently compiling a Qt project which integrates OpenMesh and CUDA together. Since I have to use nvcc to compile the project, I found an error from the OpenMesh:
J:\OpenMesh2.4\include\OpenMesh/Core/System/compiler.hh(109) : fatal error C1189:
#error : "You have to define _USE_MATH_DEFINES in the compiler settings!"
Since the compiler is nvcc not vc compiler, even I add the macro in the "preprocessor definitions", the error still appears. I just wonder if there is a way to add this macro for the nvcc?
I also tried to manually add this macro in one of my header which include the open mesh headers. The above error is gone but the compile gives another strange error about the source code of openmesh.
Found the solution: add -D followed by the macro in the nvcc flag...
I am trying to integrate wwise into a test project. I have a project on windows 7 using ms visual studio 2010 and this is the error I get after I try and add a necassary cpp to the project. i dont get this build error on my machine at home with the same set up, what does it mean?
------ Build started: Project: wwise test, Configuration: Debug Win32 ------
AkFilePackageLUT.cpp
c:\program files (x86)\audiokinetic\wwise v2012.2.1 build 4427\sdk\samples\soundengine\common\akfilepackagelut.h(204): error C2065: 'NULL' : undeclared identifier
c:\program files (x86)\audiokinetic\wwise v2012.2.1 build 4427\sdk\samples\soundengine\common\akfilepackagelut.cpp(117) : see reference to function template instantiation 'const CAkFilePackageLUT::AkFileEntry<T_FILEID> *CAkFilePackageLUT::LookupFile<AkFileID>(T_FILEID,const CAkFilePackageLUT::FileLUT<T_FILEID> *,bool)' being compiled
with
[
T_FILEID=AkFileID
]
c:\program files (x86)\audiokinetic\wwise v2012.2.1 build 4427\sdk\samples\soundengine\common\akfilepackagelut.h(204): error C2065: 'NULL' : undeclared identifier
c:\program files (x86)\audiokinetic\wwise v2012.2.1 build 4427\sdk\samples\soundengine\common\akfilepackagelut.cpp(140) : see reference to function template instantiation 'const CAkFilePackageLUT::AkFileEntry<T_FILEID> *CAkFilePackageLUT::LookupFile<AkUInt64>(T_FILEID,const CAkFilePackageLUT::FileLUT<T_FILEID> *,bool)' being compiled
with
[
T_FILEID=AkUInt64
]
To me it looks on the first glance like you did not specify a template parameter .
Other possible causes:
You are compiling with a debug version of the C runtime, declaring a
Standard C++ Library iterator variable in a for loop, and then
trying to use that iterator variable outside the scope of the for
loop. Compiling Standard C++ Library code with a debug version of
the C runtime implies /Zc:forScope. See Debug Iterator Support for
more information.
You may be calling a function in an SDK header file that is
currently not supported in your build environment.
Omitting necessary include files, especially if you define
VC_EXTRALEAN, WIN32_LEAN_AND_MEAN, or WIN32_EXTRA_LEAN. These
symbols exclude some header files from windows.h and afxv_w32.h to
speed compiles. (Look in windows.h and afxv_w32.h for an up-to-date
description of what's excluded.)
Identifier name is misspelled.
Identifier uses the wrong uppercase and lowercase letters.
Missing closing quote after a string constant.
Improper namespace scope. To resolve ANSI C++ Standard Library
functions and operators, for example, you must specify the std
namespace with the using directive. The following example fails to
compile because the using directive is commented out and cout is
defined in the std namespace
This error message is saying the following:
in <path...>\akfilepackagelut.h there is a definition of a function template. In fact, it is a templated method of a class. Inside that definition, on line 204, the name NULL is used. NULL is defined in header <cstddef> of the C standard library, and normally you can include that definition by including one of a lot of C/C++ headers, because most of them somehow include <cstddef>. However, akfilepackagelut.h seems to include only headers that in the VS2012 installation you are using do not include that definition, so the compiler does not know what NULL means.
The whole rest of the error message is just template error gibberish, telling you that that function template we are talking about has been instantiated twice somewhere in AkFilePackageLUT.cpp, telling you the exact locations and the template parameters and so on.
What can you do?
Well, if you can not modify the source as you say (Why? You have the source) you can't do anything but perhaps file a bug for the project. If you can modify it would be best to #include <cstddef> in akfilepackagelut.h.
I'm trying to use iphlpapi (GetAdapterInfo) and am having trouble compiling the code. I have iphlpapi.h from SDK 7 and have added the appropriate path to the include files in visual studio.
I get the following error...
c:\program files\microsoft sdks\windows\v7.0\include\ifdef.h(154) : error C2146: syntax error : missing ';' before identifier 'NET_IFTYPE'
The lines in ifdef where this occurs are shown below.
typedef NET_LUID IF_LUID, *PIF_LUID;
typedef ULONG NET_IFINDEX, *PNET_IFINDEX; // Interface Index (ifIndex)
typedef UINT16 NET_IFTYPE, *PNET_IFTYPE; // Interface Type (IANA ifType)
I finally figured out how to get this to work so I'm putting this here for others who might stumble upon it.
First, I'm using visual c++ version 6.0 with the 2003 sdk. I added the sdk as the first choice using TOOLS->OPTIONS->DIRECTORIES. Adding the include winsock2.h caused about 60 redefinition errors. I found several sources telling me that the winsock2 include had to precede the windows.h include. My windows.h include was generated for me by VC++ in the precompiled header stdafx.h so I moved the winsock2.h include there. I now can compile and run my program!
According to this page, it looks as though you might need to make sure winsock2.h is included first. I'm guessing that it defines some of those types.
Also, the MSDN page for NET_LUID says it requires Vista at a minimum. Make sure that's true.