我在VM Ubuntu 16.04上构建了一个C++应用程序,我在其上安装了g ++编译器6.2.0以支持C++ 14的功能.当我尝试在默认为g ++ 5.4.0的新干净VM 16.04上运行它时,会弹出错误 /usr/lib/x86_64-linux-gnu/libstdc++.so.6:版本`GLIBCXX_3.4.22'.
我注意到在VM上安装了更新的编译器库libstdc ++.so.6.0.22.在干净的VM上,我想避免更新编译器,所以我尝试只安装最新的libstdc ++ 6软件包.但是,安装的库是libstdc ++.so.6.0.21,因此问题仍然存在.如何专门安装libstdc ++.so.6.0.22版本?
我正在linux(Ubuntu 16.04)上准备一个c ++应用程序,使用了一些动态链接的poco库.我有项目文件夹,包括:include,bin,lib,src和build文件夹以及相关的Makefile.到目前为止,我使用了以下Makefile,它从/ usr/local/lib获取了库
CC := g++
# Folders
SRCDIR := src
BUILDDIR := build
TARGETDIR := bin
# Targets
EXECUTABLE := C++_APP
TARGET := $(TARGETDIR)/$(EXECUTABLE)
SRCEXT := cpp
SOURCES := $(shell find $(SRCDIR) -type f -name *.$(SRCEXT))
OBJECTS := $(patsubst $(SRCDIR)/%,$(BUILDDIR)/%,$(SOURCES:.$(SRCEXT)=.o))
CFLAGS := -c -Wall
INC := -I include -I /usr/local/include
LIB := -L /usr/local/lib -lPocoFoundation -lPocoNet -lPocoUtil
$(TARGET): $(OBJECTS)
@echo " Linking..."
@echo " $(CC) $^ -o $(TARGET) $(LIB)"; $(CC) $^ -o $(TARGET) $(LIB)
$(BUILDDIR)/%.o: $(SRCDIR)/%.$(SRCEXT)
@mkdir -p …Run Code Online (Sandbox Code Playgroud) 环境
适用于 Linux 的 Visual Studio Code 1.25(ubuntu 16.04)。
主题 VisualStudio 黑暗。
目前我在 Ubuntu 16.04 中使用 Visual Studio 代码 1.25 来编写 C++ 代码。我想更改函数参数的颜色,就像在 Visual Studio 2015 中一样,它们在函数声明和函数体中都是灰色的。我试图通过使用以下用户设置来实现这一点:
"editor.tokenColorCustomizations": {
"textMateRules": [
{
"scope": "variable.parameter",
"settings": {
"fontStyle": "",
"foreground":"#413f39"
}
}
]
}
Run Code Online (Sandbox Code Playgroud)
但没有成功。是我做错了什么还是 vs 代码不支持这个功能?
我在arm嵌入式板上创建了一个c++应用程序。该板使用armbian linux debian风格。这个应用程序在 poco NetSSl 库的帮助下在多个地方执行 https 请求。
当我使用以下参数运行 valgrind 时:
valgrind --leak-check=full --leak-resolution=high --show-reachable=yes --num-callers=20 --track-origins=yes --show-below-main=yes --log-file=valrgind.log ./c++_app
Run Code Online (Sandbox Code Playgroud)
我收到以下错误消息:
==2414== Memcheck, a memory error detector
==2414== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==2414== Using Valgrind-3.14.0 and LibVEX; rerun with -h for copyright info
==2414== Command: ./c++_app
==2414== Parent PID: 1556
==2414==
disInstr(thumb): unhandled instruction: 0xEC51 0x0F1E
==2414== valgrind: Unrecognised instruction at address 0x52a17e7.
==2414== at 0x52A17E6: ??? (in /usr/lib/arm-linux-gnueabihf/libcrypto.so.1.1)
==2414== Your program just …Run Code Online (Sandbox Code Playgroud) 我已经使用visual studio 2015为windows创建了一个c ++应用程序.我也想在linux发行版上运行这个应用程序,所以我在Windows上安装了Visual C++ for Linux Development插件.我还创建了一个Ubuntu 16.04 VM来定位.ssh连接成功以及文件传输到linux相关文件夹.编译成功完成,但由于我在链接过程开始时也使用共享库,因此出现以下错误:
Illegal characters in path
Run Code Online (Sandbox Code Playgroud)
为线
Ld Condition="'@(RemoteLink)' != ''"
Run Code Online (Sandbox Code Playgroud)
的文件:
C:\ Program Files(x86)\ Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Application Type\Linux\1.0\Linux.Common.targets
我也在Visual Studio 2017上尝试过,但效果相同.我在VC++目录和链接器的"共享库搜索路径"字段中输入库路径,但错误仍然存在.怎么解决这个问题?
我已经为C ++应用程序创建了一个Inno Setup脚本。该脚本可以正常运行,并且包含以下内容:
[Files]
Source: "C:\Users\john\Desktop\My_App_setup\my_app.exe"; DestDir: "{app}"; \
Flags: ignoreversion
Source: "C:\Users\john\Desktop\My_App_setup\settings\*"; DestDir: "{app}\settings"; \
Flags: ignoreversion recursesubdirs createallsubdirs
Run Code Online (Sandbox Code Playgroud)
这些文件是C ++可执行my_app.exe文件,是最终用户自定义的设置文本文件。
我想做的是当我有一个新版本的my_app.exe来更新此文件并保留到目前为止用户可能已更改的相同设置。
我该怎么办?
我正在为跨平台32位嵌入式系统(Windows和Linux)开发一个c ++应用程序.对于一个所需的功能,我需要以毫秒计算时间差.首先,纪元时间戳为32位系统提供的最大精度是秒.我遇到的大多数相关答案都是64位相关的,如使用std :: clock或std :: chrono,如:
std::chrono::duration_cast<std::chrono::milliseconds>(now.time_since_epoch()).count();
Run Code Online (Sandbox Code Playgroud)
或系统使用
#include <sys/time.h>
Run Code Online (Sandbox Code Playgroud)
或Windows上的GetSystemTime函数.我还检查了与poco相关的时间函数,但它们也基于使用64位变量.这可以使用现有的标准或外部c ++库来完成,还是应该遵循不同的方法?
c++ ×5
linker ×2
32-bit ×1
inno-setup ×1
installer ×1
libstdc++ ×1
linux ×1
makefile ×1
memory-leaks ×1
milliseconds ×1
openssl ×1
timestamp ×1
ubuntu-16.04 ×1
valgrind ×1