小编dre*_*rjm的帖子

MSVCP120d.dll缺失

每次我想编译我的Visual Studio项目时,我都会收到MSVCP120d.dll缺失的消息.谷歌无法帮助我.我已经安装了一些可再发行组件,但它们没有帮助.我也发现了这个:

Msvcp120d.dll C++运行时的调试版本.不允许再分配.

http://msdn.microsoft.com/en-us/library/windows/hardware/dn448963(v=vs.85).aspx

c++ visual-studio-2012

39
推荐指数
2
解决办法
13万
查看次数

为什么cmake文件GLOB邪恶?

CMake文档说明命令文件GLOB:

我们不建议使用GLOB从源树中收集源文件列表.如果在添加或删除源时没有更改CMakeLists.txt文件,则生成的构建系统无法知道何时请求CMake重新生成.

网络中的几个讨论线程第二个是通配源文件是邪恶的.

但是,为了使构建系统知道已添加或删除了一个源,这就足够了

touch CMakeLists.txt
Run Code Online (Sandbox Code Playgroud)

对?

然后,这比编辑CMakeLists.txt插入或删除源文件名更省力.也难以记住.所以我认为没有任何充分理由提出反对意见file GLOB.

这个论点有什么问题?

glob cmake

26
推荐指数
3
解决办法
1万
查看次数

为什么可执行二进制文件包含包含头文件的路径?

为什么编译和链接的可执行文件包含源代码中包含的头文件路径?我正在使用wxWidgets库并使用Visual Studio 2013和gcc进行编译.这些头文件用于什么?如果它是编译器选项,我如何禁用它以避免这种情况?

构建配置:发布,静态链接.

例

c c++ wxwidgets

13
推荐指数
2
解决办法
1640
查看次数

在Windows上将boost库与Boost_USE_STATIC_LIB关闭

我的CMakeFiles.txt看起来像这样:

cmake_minimum_required ( VERSION 2.6 )

# Set warnings on and enable debugging
SET( CMAKE_C_FLAGS "-Wall -q" )

include(FindBoost)

set(Boost_USE_STATIC_LIBS ON)
set(Boost_USE_MULTITHREADED ON)
set(Boost_USE_STATIC_RUNTIME OFF)

find_package( Boost 1.57.0 COMPONENTS system filesystem REQUIRED )

if( Boost_FOUND )
    message( STATUS "Boost found!" )
    include_directories(${Boost_INCLUDE_DIRS})
    add_executable(foo main.cpp)

    # Needed for asio
    if(WIN32)
      target_link_libraries(foo wsock32 ws2_32)
    endif()

    target_link_libraries(foo ${Boost_LIBRARIES})
endif()
Run Code Online (Sandbox Code Playgroud)

我为Visual Studio 2013 64位渲染项目:

cmake -G "Visual Studio 12 Win64" -DBOOST_LIBRARYDIR=D:\Development\Tools\boost_1_57_0\stage\x64\lib ..\KServer
Run Code Online (Sandbox Code Playgroud)

输出是:

-- The C compiler identification is MSVC 18.0.31101.0
-- The CXX …
Run Code Online (Sandbox Code Playgroud)

c++ boost cmake dynamic-linking visual-studio-2013

10
推荐指数
1
解决办法
1万
查看次数

摆脱我的发布应用程序中的msvcr120.dll/msvcp120.dll依赖(VC++ 2013)

我知道有一些关于如何将msvcr120.dll/msvcp120.dll包含到项目中的问题.

但我想放弃这种依赖.我在Visual Studio 2013中的Release版本中编译程序.我不依赖于任何特定于VS的命令(#pragma等)或预编译的头文件等.

我想将它编译为单个版本.exe并将其提供给用户而不要求他为VS安装VC++ Redistributes(用户将使用Windows 7,Windows 8,也许是Windows XP).

那可能吗?如果是这样,怎么样?

c++ dll visual-studio visual-c++ visual-studio-2012

8
推荐指数
1
解决办法
7833
查看次数

Qt 5 dark Fusion主题适用于Windows吗?

经过一些研究后我发现,Qt 5现在提供了一个所谓的Fusion主题,这个主题在他们的一篇博文中被描述.我真的很喜欢你在上一张图片中可以看到的黑色配置的主题,我想在我的应用程序中使用它,但似乎这个配色方案是由Unity/Gnome3(看起来像一个Ubuntu窗口)强制所以我是渴望知道是否有任何可用的样式表或变通方法将这个黑暗版本的主题应用于应用程序.

qt themes stylesheet qt5

7
推荐指数
3
解决办法
1万
查看次数

在C++中更改.h文件不需要再次编译?

我有以下问题.在成功编译之后,如果我在仅更改其中一个.h文件中的某些内容后再次编译它,则计算机会说:

make:没有什么可以为'all'做的.

即使我只修改了.h文件,我是否可以强制编译器再次编译?

c++ makefile compilation header-files

6
推荐指数
1
解决办法
5510
查看次数

如何修复“PCH 警告:标头不在文件范围内停止”

我已经按照我认为正确的方式设置了程序和头文件,但我不断收到标题中提到的错误。

我曾尝试寻找此问题的修复方法,其中大多数只是添加“;” 在头文件中的类定义之后。我已经尝试了几乎所有我能找到的修复方法,但结果相同。

这是标记错误的主程序:

#include <iostream>
#include <string>
#include <iomanip>
#include <fstream>
#include "computeGross.h"
#include "computeInsurance.h"
#include "Employee.h" /*<-----------------This is where the error flags*/
using namespace std;

int main()
{ }
Run Code Online (Sandbox Code Playgroud)

这是错误标记的头文件:

#ifndef EMPLOYEE_H
#define EMPLOYEE_H
#include <string>
using namespace std;

struct Employee
{
    string name;
    double rate;
    double hours;
    double insurance;
    double social;
    double stateTax;
    double fedTax;
    double netPay;
    double grossPay;
};

#endif
Run Code Online (Sandbox Code Playgroud)

c++ precompiled-headers visual-studio

6
推荐指数
2
解决办法
2万
查看次数

VS Code:局部变量未正确显示

抱歉,如果之前有人问过这个问题,但我没有得到之前给出的答案。我是 VS Code 新手,了解一些 C++ 编码。我尝试了 windows/mingw 的教程:\n https://code.visualstudio.com/docs/cpp/config-mingw#_step-through-the-code \n 并完成了到目前为止的所有操作。示例代码已构建,我现在想进行调试,但在调试时单步执行应用程序时,我的变量视图显示了不同的内容。(见附图)\n在此输入图像描述\n该单词应包含任何字符串,并且 msg 应显示不同的内容。不过,我的自制手表显示正确。这是怎么回事?我按照教程中的方式做了所有事情。

\n

另外:终端选项卡不会从 cout 输出消息,但我在调试控制台中看到它。(参见“设置手表”章节上方教程中的图片)

\n

launch.json 是:

\n
{\n    // Use IntelliSense to learn about possible attributes.\n    // Hover to view descriptions of existing attributes.\n    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387\n    "version": "0.2.0",\n    "configurations": [\n        \n\n        {\n            "name": "g++.exe - Aktive Datei erstellen und debuggen",\n            "type": "cppdbg",\n            "request": "launch",\n            "program": "${fileDirname}\\\\${fileBasenameNoExtension}.exe",\n            "args": [],\n            "stopAtEntry": true,\n            "cwd": "${workspaceFolder}",\n            "environment": [],\n            "externalConsole": false,\n            "MIMode": "gdb",\n            "miDebuggerPath": "C:\\\\MinGW\\\\bin\\\\gdb.exe",\n            "setupCommands": …
Run Code Online (Sandbox Code Playgroud)

c++ mingw-w64 visual-studio-code

6
推荐指数
1
解决办法
6526
查看次数

Windows 进程和 WSL Linux 进程之间的共享内存

我想使用共享内存技术在进程之间共享数据。我可以分别在 Windows 和 WSL(Linux 的 Windows 子系统)上使用 boost 库来做到这一点。两者都很好用。我的工作是让这些脚本在 1 个进程在 Windows 上运行,1 个进程在 WSL Linux 上运行时工作。他们在同一台机器上运行。

发件人脚本

#include <chrono>
#include <boost/interprocess/shared_memory_object.hpp>
#include <boost/interprocess/mapped_region.hpp>
#include <cstring>
#include <iostream>
#include <thread>
using namespace boost::interprocess;
int main(int argc, char* argv[])
{
   //Remove shared memory on construction and destruction
   struct shm_remove
   {
      shm_remove() { shared_memory_object::remove("sharedmem"); }
      ~shm_remove() { shared_memory_object::remove("sharedmem"); }
   } remover;

   //Create a shared memory object.
   shared_memory_object shm(create_only, "sharedmem", read_write);

   //Set size
   shm.truncate(1000);

   //Map the whole shared memory in this process
   mapped_region …
Run Code Online (Sandbox Code Playgroud)

c++ boost ipc windows-subsystem-for-linux wsl-2

6
推荐指数
1
解决办法
718
查看次数