ITeye博客

chenqi210的博客

chenqi210 · 共 49 篇文章

[置顶] MinGW 比较通用的Makefile

#MinGW 5.1.6 .PHONY:clean tidy rebuild SRCDIR = src LIBDIR = lib DOCSDIR = docs BUILDDIR = build CC = C:\MinGW\bin\g++.exe SRCEXT = cpp DEPEXT = depend RM = del /f /q MKDIR = mkdir RMDIR = rmdir /q /s FLAGS = -g -Wall -O3 #-save-temps #-fdump-class-hierarchy #-dump_class_hierarchy LIBPATHS = -L"C:\…

2010-12-03 18:14 · GNUMake · 评论(0)

g++ strerror_r返回类型

#ifdef HAVE_DECL_STRERROR_R # ifdef HAVE_STRERROR_R_CHAR_P std::string explain_errcode(int errcode) { std::vector<char> buffer(0xff); do { if (strerror_r(errcode, &buffer[0], buffer.size()) != ERANGE) return &buffer[0]; buffer.resize(buffer.size() * 2); } while (true); } # else std::string explain_…

2017-11-21 16:55 · 评论(0)

maven android 开发配置

下载必需工具, android sdk 的命令行工具。 正式下载地址可以去 http://develop.android.com 这里找,只下载命令行工具即可(Android Studio 比较大,自带IDE) 设置一些环境变量 ANDROID_HOME 需要指向解压后的tools的上一级目录 (required) USE_SDK_WRAPPER 这个变量只要不为空就可以,可以用yes这样的文字内容 (optional) 升级JDK (严格来说,只使用的情况下是只需要升级JRE的) 运行 $ANDROID_HOME/tools 下的android 命令行脚本,JRE不支持的情况下会出现Uns…

2017-10-12 15:53 · 评论(0)

armcc Makefile.mingw

.PHONY: clean compile link all VPATH=.. RVCT_HOME = /usr/local/bin OBJEXT = o EXEEXT = axf SRCEXT = c RM = rm -fr MKDIR = mkdir -p MV = mv -f CPPFLAGS = CFLAGS = CXXFLAGS = LDFLAGS = CC = $(RVCT_HOME)/armcc -c LD = $(RVCT_HOME)/armcc -o PROGRAMS = demo demo2 demo_SOURCES = ./src/foo.c demo_OBJECTS …

2017-07-07 17:08 · 评论(0)

C宏不完全展开的情况

遇到了一个宏没有完全展开的情况。 #include <stdlib.h> #include <stdio.h> /* Use printf inside the definition */ #define PRINTF(fmt, args...) do { printf(fmt, ##args); } while (0) /* Make printf represent as the encapsulated print */ #define printf PRINTF int main(int argc, char* *argv) { int p = 100; printf("p = %d…

2017-06-28 10:00 · 评论(0)

autotools 在MAC上编译问题

通常在MAC上可以和其他linux机器一样用 autoreconf -vi && cd bin && ../configure && make 但是在需要编译iOS(iPhone, AppleTV, WatchOS)之类的二进制文件时需要有其他的设置 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk \ -mios-simulator-version-min=10.3 这个是iPhone模拟器的设置…

2017-04-20 21:24 · 评论(0)

archiva的一些安全性配置

http://archiva.apache.org/docs/2.0.1/adminguide/customising-security.html 写道 Security properties and password rules can be configured in the security.properties file, which by default is searched for in: ~/.m2/security.properties conf/security.properties in the Archiva installation Security propert…

2017-04-10 10:44 · 评论(0)

迁移助手迁移文件之后homebrew权限问题

https://digitizor.com/fix-homebrew-permissions-osx-el-capitan/ 写道 sudo chown $(whoami):admin /usr/local && sudo chown -R $(whoami):admin /usr/local

2016-12-26 15:34 · 评论(0)

C Shell 流重定向的操作符说明

http://stackoverflow.com/questions/6762348/what-do-and-do-in-tcsh 写道 In tcsh redirection the ! symbol means overwrite the existing file even if noclobber is set. In other words, if noclobber is set then: cmd > file will write stdout to file if file does not exist cmd > file will fail if file exists…

2016-12-05 16:31 · 评论(0)

libtool 2.2.6b以后链接时间接依赖丢时导致的undefined symbol的解决方法

在debian 或者ubuntu这类操作系统上libtool从2.2.6b版本开始,间接依赖库会在链接时被丢掉。导致会发生莫名奇妙的undefined symbol。 http://stackoverflow.com/questions/11802727/libtool-doesnt-provide-library-dependencies-to-link 写道 4 down vote accepted On any Debian machine I use for development, I have to compile and install Libtool by hand, bec…

2016-11-24 20:26 · autotools · 评论(0)

windows中 Vim 运行python命令崩溃的解决方法

http://stackoverflow.com/questions/35597157/gvim-crashes-when-running-python 写道 Finally solved the problem. It turned out that Python uses PYTHONPATH variable to resolve the PYTHON folder (used to load python libraries and so on). Here is the default value for Python 2.7: C:\Python27\Lib;C:\Python2…

2016-09-07 16:28 · 评论(0)

动态库文件依赖修改工具 chrpath, install_name_tool

部署不同版本程序时比较有用的一个东西。mark一下。 chrpath 这个工具可以将写死的依赖去掉. Usage: chrpath [-v|-d|-c|-r <path>] <program> [<program> ...] -v|--version Display program version number -d|--delete Delete current rpath/runpath setting -c|--convert Convert rpath to runpath -r <path>|--replace <path> Replace current rpath/runpat…

2016-09-05 20:24 · 评论(0)

log4j PatternLayout里各参数对性能的影响

在官网上有介绍,但还是复制一下,以免忘掉 转自 https://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/PatternLayout.html Overview Package Class Use Tree Deprecated Index Help PREV CLASS NEXT CLASS FRAMES NO FRAMES All Classes SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD org.apache.log4…

2016-08-10 11:12 · 评论(0)

pthread_rwlock_t 未定义的问题

最近在linux上次编译时出现pthread_rwlock_t没有定义的现象.但是已经include了pthread.h,网上查了一些资料后发现,原因竟然是因为显示使用了-std=c99参数导致. 在c99没有完全实现时,如果不显示指定-std, 则gcc默认使用gnu89(或gnu90)标准. 一般而言, gnuXX标准 = cXX标准 + GNU extension 而pthread_rwlock_t正好就是GNU extension的一部分. 所以指定使用c99就会把GNU extension禁用,造成pthread_rwlock_t未定义的问题. 解决方法就是: 方法一: 把-std…

2016-08-06 15:02 · c++ · c · 评论(0)

更改kde login时的cursor theme

装过几个桌面环境之后,发现原来的登录界面的光标颜色由白变黑了。找来找去最后在一个bug贴里找到方法. https://bugs.launchpad.net/ubuntu/+source/kde-workspace/+bug/288502 写道 $ sudo update-alternatives --config x-cursor-theme There are 7 choices for the alternative x-cursor-theme (providing /usr/share/icons/default/index.theme). Selection Path Priori…

2015-07-26 13:01 · debian · 评论(0)