
Linux
ericohe
AI工程师
展开
-
Ubuntu 22.04 安装cmake3.28
Cmake 3.28Kitware APT Repository原创 2024-01-03 04:23:34 · 1370 阅读 · 0 评论 -
docker中支持GUI(界面)
在尝试Mac系统vcpkg中安装qt5失败之后,考虑到用docker安装Ubuntu,能不能在docker中运行GUI程序呢?没有做不到,只有想不到。GitHub - fcwu/docker-ubuntu-vnc-desktop: A Docker image to provide web VNC interface to access Ubuntu LXDE/LxQT desktop environment.sudo docker run --name ubvnc -p 6080..原创 2022-04-21 08:43:00 · 2548 阅读 · 0 评论 -
vs2019 编译调试Linux代码
CMakeSettings.json{ "configurations": [ { "buildCommandArgs": "", "cmakeCommandArgs": "", "cmakeExecutable": "/usr/bin/cmake", "configurationType": "Release", "ctestCommandArgs": "", "generator": "..原创 2022-01-26 13:36:45 · 1291 阅读 · 0 评论 -
linux 进程监控
linux 进程监控https://developer.aliyun.com/article/50081原创 2021-12-01 17:36:42 · 936 阅读 · 0 评论 -
C语言写个贪吃蛇游戏【跨平台】
snake.c#include <stdio.h>#include <stdlib.h>#include <stdbool.h>#include <time.h>//#include <iostream>#ifdef __unix__ /* __unix__ is usually defined by compilers targeting Unix systems */#inclu.原创 2021-02-02 17:40:01 · 221 阅读 · 0 评论 -
gtest最新版本编译
git clone https://github.com/google/googletest.gitcd googletestgit checkout release-1.10.0# for release versionmkdir build && cd build && cmake ..make make DESTDIR=../gtest install# for debug versioncmake -DCMAKE_BUILD_TYPE=...原创 2021-01-26 11:13:12 · 438 阅读 · 0 评论 -
Linux std::thread and std::bind example
#include <iostream> // std::cout#include <atomic> // std::atomic#include <thread> // std::thread#include <vector> // std::vector#include <functional>#include <algorithm>#inclu...原创 2020-12-28 17:25:13 · 490 阅读 · 0 评论 -
Linux下获取线程ID
#include <pthread.h>#include <thread>#include <iostream>#include <unistd.h>#include <stdio.h>#include <sys/syscall.h>#define gettid() syscall(__NR_gettid)using namespace std;int main(){ cout<<"p...原创 2020-12-28 17:11:42 · 617 阅读 · 0 评论 -
Linux C++ 内存使用监控
#include <unistd.h>#include <ios>#include <iostream>#include <fstream>#include <string>#include <cstring>#include <stdexcept>#include <limits>//////////////////////////////////////////////////...原创 2020-12-25 13:44:57 · 796 阅读 · 0 评论 -
Linux popen跨进程调用
被调用代码:sum.cpp#include <stdio.h>#include <string.h>#include <errno.h>int main(int argc,char*argv[]){ int a = 2; int b = 3; printf("==sum is %d\n", a + b); return a + b;}g++ -o sum sum.cpp调用代码:popen.cpp...原创 2020-12-18 13:49:24 · 553 阅读 · 0 评论 -
Linux fork example
// parent.c: the parent program#include <stdio.h>#include <stdlib.h>#include <sys/types.h>#include <unistd.h>#include <string.h>#include <iostream>#include <sys/wait.h>void fork_wait(){ int statu...原创 2020-12-17 15:01:53 · 170 阅读 · 0 评论 -
Linux fork进程的用法
代码// fork.cpp#include <stdio.h>#include <stdlib.h>#include <sys/types.h>#include <unistd.h>#include <string.h>#include <iostream>#include <sys/wait.h>void fork_wait(){ int status, ret; int pid原创 2020-11-12 13:23:02 · 193 阅读 · 0 评论 -
C++ while循环 vs condition_variable
消费者线程等待生产者发来的信息第一版 while + sleepwhile (true){ if (is_sent_) { is_sent_ = false; //Do something ... } // Sleep this thread for 5 MilliSeconds std::this_thread::sleep_for(std::chrono::milliseconds(5));}总感觉sleep是很傻原创 2020-09-29 16:59:53 · 401 阅读 · 0 评论 -
c++之多线程中“锁”(mutex)
Demo1——无锁的情况假定有一个全局变量counter,启动两个线程,每个都对该变量自增10000次,最后输出该变量的值。在第一个demo中,我们不加锁,代码文件保存为:mutex_demo1_no_mutex.cpp#include <iostream>#include <thread>#include <vector>#include <mutex>#include <chrono>#include <stde...原创 2020-09-29 09:41:06 · 1437 阅读 · 0 评论 -
Ubuntu 中编译boost 1.74.0 & 测试验证 & cmake & Conan设置
apt-get updateapt-get install -y mpi-default-dev libicu-dev python-dev python3-dev libbz2-dev zlib1g-devwget https://dl.bintray.com/boostorg/release/1.74.0/source/boost_1_74_0.tar.gztar -zxvf boost_1_74_0.tar.gzcd boost_1_74_0./bootstrap.sh...原创 2020-09-27 13:43:41 · 2243 阅读 · 0 评论 -
VTK离屏渲染情况下的键盘交互
VTK离屏渲染情况下,没有窗口,鼠标键盘的响应是无效的,程序直接退出。代码如下:#include <vtkPolyDataMapper.h>#include <vtkObjectFactory.h>#include <vtkActor.h>#include <vtkSmartPointer.h>#include <vtkRenderWindow.h>#include <vtkRenderer.h>#inclu.原创 2020-09-25 17:58:13 · 696 阅读 · 0 评论 -
vs2019+cmake实现Linux远程开发
vs2019+cmake实现Linux远程开发https://www.cnblogs.com/apocelipes/p/11431808.html打开通往Linux世界的大门原创 2020-09-23 16:38:22 · 252 阅读 · 0 评论 -
基于egl / osmesa 的VTK offscreen rendering (离屏渲染)方案
Ubuntuapt-get update apt-get install x11proto-gl-dev libdrm-dev libxxf86vm-dev libxt-dev xutils-dev flex bison xcb libx11-xcb-dev libxcb-glx0 libxcb-glx0-dev xorg-dev libxcb-dri3-dev libxcb-dri2-0-dev libxcb-xfixes0 libxcb-xfixes0-dev libxcb-pr...原创 2020-09-13 18:57:03 · 3755 阅读 · 4 评论 -
CentOS 7 安装配置备忘录
因为声音有问题,删除了声音组件,导致gnome挂了,不能进入桌面一怒执行,重新安装系统。1. USB制作CentOS 7的系统盘挂ntfs USByum install epel-releaseyum install ntfs-3ghttps://www.howtoforge.com/tutorial/mount-ntfs-centos/安装Chrome浏览器 cd /etc/yum.repos.d/ vim google-ch...原创 2020-09-05 20:25:07 · 350 阅读 · 0 评论 -
解决:unable to connect to X server
错误如下:ERROR: In /home/whistler/Desktop/build/VTK-8.2.0/Rendering/OpenGL2/vtkXOpenGLRenderWindow.cxx, line 452vtkXOpenGLRenderWindow (0x34ae140): bad X server connection.解决方案:方案一:Xvfb :5 -screen 0 800x600x24 &export DISPLAY=:5glxgears ...原创 2020-09-03 13:21:24 · 10061 阅读 · 0 评论 -
解决Linux下编译调用dcmtk出现的-fPIC错误
错误如下:libdcmdata.a(dcdatset.cc.o): relocation R_X86_64_32S against `_ZTV10DcmDataset' can not be used when making a shared object; recompile with –fPIC重新编译dcmtk修改:dcmtk-3.6.4/CMake/Generat...原创 2020-02-15 18:05:31 · 506 阅读 · 0 评论 -
Centos 7 安装与配置
下载Centos 7 iso文件Download Centos7 iso file修改CentOS默认yum源为国内yum镜像源https://blog.youkuaiyun.com/inslow/article/details/54177191选择速度最快的yum源yum install yum-plugin-fastestmirrorrpm -Uvh http://...原创 2019-06-16 20:53:48 · 297 阅读 · 0 评论