visual-c++

How-to use Clang Static Analyzer on Windows?

眉间皱痕 提交于 2020-04-05 06:44:50
问题 I'm currently trying to integrate the Clang Static Analyzer v9.0.1 into my CMake v3.16.5 build system using the Microsoft Visual C++ Compiler (MSVC) v19.25.28610.4 on a Windows v10.0.18363.720 operating system. Everything is build for the architecture x86_64. LLVM and Clang have been build from source. After some reading on the World Wide Web (WWW), there seems to be multiple ways to use the Clang Static Analyzer. Sadly the documentation is horrible and there seems to be some special quirks

How can I insert element into beginning of vector?

喜夏-厌秋 提交于 2020-03-14 06:55:31
问题 i'm newbie in writing code and i need a little help.I need to insert values into the beginning of a std::vector and i need other values in this vector to be pushed to further positions for example: something added to beginning of a vector and values moved from position 1 to 2, from 2 to 3 etc. how do i do that? 回答1: Use std::vector::insert function accepting iterator to the first element as a target position (iterator before which to insert the element): #include <vector> int main() { std:

How do I access arguments for a new Main Function in C++?

半世苍凉 提交于 2020-03-05 02:55:07
问题 I have a new main function that I asked the linker to point to in the Visual Studio. I can correctly execute this function. However the command line arguments that I am getting is not correct. Currently this is my signature int NewMain(int argc, const char* argv[]) { cout << "New Main" << endl; for (int i = 0; i < argc; ++i) { cout << argv[i] << "\n"; } return 0; } However when I use the same function with the standard main, I am getting all the arguments. 回答1: When you specify an entry point

How to generate a manifest file for VS 2017 for a c++ project and be sure its working?

浪尽此生 提交于 2020-03-04 05:52:13
问题 I've been looking around trying to figure out how to generate a manifest file for a c++ application for VS2017. I've seen some stuff for VS2010, and the only thing I've seen for VS2017 is this page on the MS site. However, actually generating the file wasn't clear. So what I did was: Go to project properties Go to Configuration Properties > Manifest Tool > Embed Manifest and set it to No . Apply and build. I now have an external file named filename.exe.manifest next to my filename.exe . I

Where do I translate MFC message boxes

大兔子大兔子 提交于 2020-02-27 22:47:15
问题 I'm localizing an MFC app into Japanese, and have the resources working right. My current problem is that, when I use AfxMessageBox or MessageBox , the dialog title and button messages come up in English, and I haven't found anywhere to change that. I haven't found anything useful searching MSDN or Google. So, Does this work? Does Windows come up with "OK" or "Yes/No" buttons in Japanese, Arabic, and Russian? If not, what do I specify to change these? Edit: I went with MessageBoxEx , writing

visual C++ express 2010 and setting env variables solution wide

与世无争的帅哥 提交于 2020-02-27 06:34:31
问题 I'm C++ dev migrating to visual 2010 c++ from vim/g++. Here blog I've read that VC++ directories are no more and that I should use property pages in vs 2010 but I don't know how... Here is what I need to do. I have w solution (50 projects strong) and all of them use boost, pthreads, xercesc and few other libs. I have env variables that point to those libs on my hard drive. How can I tell VS to use them as additional include paths? Again, it's 2010 version so no vs per solution setup available

visual C++ express 2010 and setting env variables solution wide

一个人想着一个人 提交于 2020-02-27 06:33:08
问题 I'm C++ dev migrating to visual 2010 c++ from vim/g++. Here blog I've read that VC++ directories are no more and that I should use property pages in vs 2010 but I don't know how... Here is what I need to do. I have w solution (50 projects strong) and all of them use boost, pthreads, xercesc and few other libs. I have env variables that point to those libs on my hard drive. How can I tell VS to use them as additional include paths? Again, it's 2010 version so no vs per solution setup available

Visual Studio 2015 not detecting v141 (2017) Build tools

安稳与你 提交于 2020-02-26 06:56:27
问题 I have Windows 10 x64 with installed latest Visual Studio 2015. I needed v141 build tools so I downloaded and installed Visual Studio 2017 C++ Build tools. Anyway the the IDE still showing only v140 in Platform Toolset listbox in project settings. I checked if it's installed and it's contains core tools, mstools and tools v141. 回答1: Visual Studio 2015 not detecting v141 (2017) Build tools Platform Toolset V141 is from Visual Studio 15 2017 not Visual Studio 14 2015. Basically, the software is

uninitialized_copy memcpy/memmove optimization

 ̄綄美尐妖づ 提交于 2020-02-24 06:51:48
问题 I've recently started to examine the STL in the MSVC's implementation. There are some nice tricks there, however I don't know why the following criteria is used. The std::uninitialized_copy is optimized to a simple memcpy/memmove if some conditions are met. As my understanding the input range can be memcpy 'd to the uninitialized area if the target type U is_trivially_copy_constructible from source type T. However the MSVC implementation checks a hell lot of thing before choosing the memcpy

uninitialized_copy memcpy/memmove optimization

时光毁灭记忆、已成空白 提交于 2020-02-24 06:51:15
问题 I've recently started to examine the STL in the MSVC's implementation. There are some nice tricks there, however I don't know why the following criteria is used. The std::uninitialized_copy is optimized to a simple memcpy/memmove if some conditions are met. As my understanding the input range can be memcpy 'd to the uninitialized area if the target type U is_trivially_copy_constructible from source type T. However the MSVC implementation checks a hell lot of thing before choosing the memcpy