placement new

代码直接在gcc里是可以编译通过的,在vc里编译,注意,如果是将例子代码加到MFC程序里,要注释掉源码中的DEBUG_NEW:

1
2
3
4
5
/*
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
*/

代码如下:

Read more

cannot open shared object file

1. setup LD_LIBRARY_PATH

1
export LD_LIBRARY_PATH=/where/you/install/lib:$LD_LIBRARY_PATH

2. modify /etc/ld.so.conf,add /where/you/install/lib, then

1
sudo ldconfig

cmake 显示编译命令

1
make VERBOSE=1

或者CMakeLists.txt中加上:

1
set(CMAKE_VERBOSE_MAKEFILE ON)