随笔分类 - c++
android ndk不支持宽字符转换
摘要:sizeof(whar_t) = 4用mbstowcs转换后结果不对,看了下android 源码size_t mbsrtowcs(wchar_t *dst, const char **src, size_t len, mbstate_t *ps){ const char* s = *src; const char* s2 = memchr( s, 0, len ); if (s2 != NULL) len = (size_t)(s2 - s) + 1U; if (dst) memcpy( (char*)dst, s, len ); ...
阅读全文
ndk 编译的一些随手记
摘要:1. 链接静态库的顺序在链接静态库时,如果多个静态库之间存在依赖关系,则有依赖关系的静态库之间存在链接顺序问题。这在使用静态库时需要注意,否则会报符号找不到的链接错误。例如:lib2.a 依赖于 lib1.a,而最终可执行文件 test 依赖于 lib2.a,则链接选项应为:-llib2.a -llib1.a,而不能反过来,否则会报 lib1.a 中的某些符号未定义。2. 编译时遇到 undefined references to static stl 的情况 具体log:undefined reference to `std::__detail::_List_node_base::_M_un
阅读全文
Perforce: Can’t clobber writable file Perforce
摘要:We are using Perforce for version control, I never use it before, and I got my perforce account those days. When I want update form the dept, perforce gave the following error:Can’t clobber writable file PerforceHere is the solution:“A workaround is to stop perforce from making the files read-only o
阅读全文
linux Perforce 使用
摘要:习惯了svn ,觉得perforce 挺难用的。搞一上午终于搞明白了,使用的几个步骤如下:1.配置环境变量:下载 perforce 放到/usr/bin/下export P4PORT=192.168.4.88:1666 #P4所在的主机export P4CLIENT=dev-client #指定了与perforce服务器交流的client是什么export P4USER=daihh #P4用户名export P4PASSWD=123456 #P4密码export P4CHARSET=utf8 #调用命令时使用的字...
阅读全文
以后调查
摘要:dolphin-playerprof.c 中monstartup 不知道什么意思。留着慢慢啃。参考资料8.《系统程序员成长计划》Page108 栈是向下增长的,栈顶是低地址,栈底是高地址 C语言函数调用时,参数按值传递,并从最后一个参数开始压栈 glibc的backtrace函数可以获取当前函数的backtrace,其backtrace_symbols函数可以把backtrace获取的地址转换成源码的位置(函数名),没有调试信息时不好用 工具addr2line可以实现地址到源码位置的转换: ./file | awk '{print "addr2line "$3&qu
阅读全文
编译vlc for android
摘要:文档:http://wiki.videolan.org/AndroidCompile可参考http://www.tidroid.com/article_75.html?replytocom=3期间遇到的问题:1.m4/libtool.m4:67: LT_INIT is expanded from…m4/libtool.m4:102: AC_PROG_LIBTOOL is expanded from…configure.ac:191: the top levelautoreconf: configure.ac: adding subdirectory lib to autoreconfautor
阅读全文
Ti 的 OMX_Core
摘要:/* ====================================================================* Texas Instruments OMAP(TM) Platform Software* (c) Copyright Texas Instruments, Incorporated. All Rights Reserved.** Use of this software is controlled by the terms and conditions found* in the license agreement unde...
阅读全文
使用dlopen和dlsym来使用C++中的类
摘要:转载自http://hi.baidu.com/aaronmagic/blog/item/caae9d54706d1650d10906dd.html原文链接http://www.isotton.com/devel/docs/C++-dlopen-mini-HOWTO/一般来说,dlopen和dlsym是来处理C库中的函数的,对于C++中存在的name mangle问题,类的问题就不易处理,看下文你会有所收获。转载自:http://www.linuxsir.org/bbs/printthread.php?t=266890C++ dlopen mini HOWTO 中译版 [原创]C++ dlope
阅读全文
错误:expected class-name before ‘{’ token
摘要:转自http://yongshengfree.blog.163.com/blog/static/3525246520081023255997/刚开始以为头文件语法写错了 经常碰到,记录一下不过在查阅网上资料的时候也意外的收获了一些答案, 在此把它贴出来, 以示警醒:You can get the errorexpected class-name before ‘{’ tokenif you try to define a class as a subclass, and the superclass isn't defined in the local scope.WRONG clas
阅读全文
GDB调试STL容器
摘要:在http://www.yolinux.com/TUTORIALS/src/dbinit_stl_views-1.03.txt下载这个文件保存为~/.gdbinit 就可以使用它提供的方法方便调试容器gdb在启动的时候,会在当前目录下查找".gdbinit"这个文件,并把它的内容作为gdb命令进行解释。举些例子:(gdb) plist lst int elem[0]: $5 = 7 elem[1]: $6 = 1 elem[2]: $7 = 5 elem[3]: $8 = 9 elem[4]: $9 = 2 List size = 5 (gdb) 一些常用内置的...
阅读全文
浙公网安备 33010602011771号