
c++
templarzq
这个作者很懒,什么都没留下…
展开
-
gcc 9.2.0编译
(1)下载src包:gcc-9.2.0.tar.xzgmp-6.1.0.tar.bz2mpc-1.0.3.tar.gzmpfr-3.1.4.tar.bz2isl-0.18.tar.bz2调用 ./contrib/download_prerequisites解压包(2)安装依赖:yum install texinfo(3)config:./configur...原创 2020-01-17 16:37:40 · 584 阅读 · 0 评论 -
How to configure a C/C++ project with Eclipse and CMake
author:How to configure a C/C++ project with Eclipse and CMakeI'm not an expert in CMake. Actually, I always programmed in Geany which is the most simple IDE and I run cmake . and转载 2014-11-24 08:35:26 · 2076 阅读 · 0 评论 -
flex&&bison
lex.l文件%{#include "Parser.h"%}%option yylineno%option outfile="Lexer.cpp" header-file="Lexer.h"%option warn nodefault%option reentrant noyywrap never-interactive nounistd%option bison-br原创 2016-04-02 20:49:33 · 1058 阅读 · 0 评论 -
kafka 配置项 server.properties
advertised.host.name=192.168.8.157如果不配置会默认为本机hostname,远程连接可能会根据hostname解析成不同的ip导致连接错误。原创 2016-09-05 13:42:40 · 854 阅读 · 0 评论 -
cenos安装高版本gcc
gcc 4.8 安装curl -Lks http://www.hop5.in/yum/el6/hop5.repo > /etc/yum.repos.d/hop5.repoyum install gcc gcc-g++gcc --versiongcc 4.9 安装yum install centos-release-sclyum install dev转载 2017-07-25 10:33:07 · 3043 阅读 · 0 评论 -
wxWidgets vc环境设置
1、include路径2、lib库路径3、预处理宏:WIN32_DEBUGWXUSINGDLL //使用动态库__WXMSW___WINDOWSNOPCH_CRT_SECURE_NO_WARNINGS原创 2018-04-02 00:01:34 · 303 阅读 · 0 评论 -
HALCON error #5322: Image acquisition: timeout
防火墙,防火墙,防火墙重要的事情说3遍。。。原创 2018-04-05 11:05:52 · 6450 阅读 · 1 评论 -
llvm-6 代码生成实例
#include "llvm/IR/LLVMContext.h"#include "llvm/IR/Module.h"#include "llvm/IR/Function.h"#include "llvm/IR/BasicBlock.h"#include "llvm/IR/IRBuilder.h"#include "llvm/ExecutionEngine/MCJIT.h"#incl...转载 2019-07-08 16:55:06 · 908 阅读 · 0 评论 -
函数hack
void Stub::set(void *orignal, void * mock_func) { int ret; pagesize_ = sysconf(_SC_PAGE_SIZE); orignal_page_ = reinterpret_cast(orignal) / pagesize_; orignal_page_ *= pagesize_;原创 2014-06-11 11:03:41 · 927 阅读 · 0 评论 -
计时器
#if defined(__i386__) static __inline__ unsigned long long rdtsc(void){ unsigned long long int x; __asm__ volatile ("rdtsc" : "=A" (x)); return x;}#elif defined(__x86_64__) static __i原创 2014-05-22 14:44:06 · 639 阅读 · 0 评论 -
内存检测工具-addressSanitizer
1、安装LLVM 3.1以上版本export ASAN_SYMBOLIZER_PATH=/usr/local/bin/llvm-symbolizerexport ASAN_OPTIONS=use_sigaltstack=1:verbosity=0:handle_segv=1:allow_user_segv_handler=1:detect_leaks=1原创 2014-05-08 16:36:56 · 14561 阅读 · 0 评论 -
成员函数指针与高性能的C++委托
Member Function Pointers andthe Fastest Possible C++ Delegates 撰文:Don Clugston 翻译:周翔 引子标准C++中没有真正的面向对象的函数指针。这一点对C++来说是不幸的,因为面向对象的指针(也叫做“闭包(closure)”或“委托(delegate)”)在一些语言中已经证明了它宝贵的价值。在Delph转载 2012-09-06 17:19:08 · 1025 阅读 · 0 评论 -
线程池
threadpool.h:// ThreadPool.h: interface for the CThreadPool class.////////////////////////////////////////////////////////////////////////#ifndef __THREADPOOL_H__#define __THREADPOOL_H__#原创 2012-11-15 09:43:41 · 521 阅读 · 0 评论 -
boost 1.50 编译安装
./bootstrap.sh --prefix=/usr/local/boost150./bjam -sTOOLS=/usr/local/gcc4.7.2 --include-dir=/usr/local/boost/include --lib-dir=/usr/local/boost/lib原创 2012-11-30 17:31:31 · 1144 阅读 · 0 评论 -
回收 Linux cached memory
1、增加内核回收cache倾向sysctl -w vm.vfs_cache_pressure=200 (貌似无效。。。)2、posix_fadvise(fd, offset, length,POSIX_FADV_DONTNEED);3、 sync echo 3 > /proc/sys/vm/drop_caches原创 2012-12-11 14:27:30 · 1296 阅读 · 0 评论 -
Hash Functions
BKDR Hashunsigned int BKDRHash(char *str){ unsigned int seed = 131; // 31 131 1313 13131 131313 etc.. unsigned int hash = 0; while (*str) { hash = hash * seed + (*str++);翻译 2013-03-14 12:04:03 · 751 阅读 · 0 评论 -
tcmalloc在linux 64下的编译安装
wget http://download.savannah.gnu.org/releases/libunwind/libunwind-0.99-alpha.tar.gztar zxvf libunwind-0.99-alpha.tar.gzcd libunwind-0.99-alpha/CFLAGS=-fPIC ./configuremake CFLAGS=-fPICmak转载 2013-04-02 18:09:34 · 2735 阅读 · 0 评论 -
Count binary 1
uint32_t countOne=0; for (; val!= 0; ++countOne) { val &= val - 1; } return countOne -1;原创 2013-07-12 13:31:08 · 410 阅读 · 0 评论 -
Makefile详解
作者:陈皓概述——————————————————————————————————————————————————————————————————什么是makefile?或许很多Winodws的程序员都不知道这个东西,因为那些Windows的IDE都为你做了这个工作,但我觉得要作一个好的和professional的程序员,makefile还是要懂。这就好像现在有这么多的HTML的编辑器转载 2013-11-07 09:20:23 · 697 阅读 · 0 评论 -
变态的C++函数指针
考虑一下在一个文件中只有下面的一段代码,这段代码是合法的:class SomeClass;typedef void (SomeClass::* SomeClassFunction)(void);void Invoke(SomeClass *pClass, SomeClassFunction funcptr) { (pClass->*funcptr)(); };注意到编译原创 2012-09-06 16:48:49 · 412 阅读 · 0 评论