摘要: 一:sudo passwd root (设置root登陆密码)二:执行: sudo gedit /etc/lightdm/lightdm.conf 将内容改为:[SeatDefaults] greeter-session=unity-greeter user-session=ubuntu greeter-show-manual-login=true allow-guest=false 阅读全文
posted @ 2013-05-11 09:53 bo-study 阅读(142) 评论(0) 推荐(0) 编辑
摘要: 一:(此种方式修改ip,重启系统后ip恢复原设置)sudo ifconfig eth0 192.168.2.1 netmask 255.255.255.0sudo route add default gw 192.168.2.254sudo /etc/init.d/networking restart二:1、ubuntu系统修改IP地址:sudo gedit /etc/network/interfacesauto eth0iface eth0 inet staticaddress 219.218.122.168netmask 255.255.255.0gateway 219.218.122.. 阅读全文
posted @ 2013-05-11 09:51 bo-study 阅读(203) 评论(0) 推荐(0) 编辑
摘要: 调用mysql UDF api 扩展mysql 函数时,如果使用g++ 编译器编译动态链接库,在声明udf函数时,需要加上 extern "C" 的声明,否则,在mysql中添加自定义函数时,会报找不到对应函数的错误消息;正确的声明形式:extern "C" {xxx_();xxx_init();xxx_deinit();}注:要使用mysql udf 功能呢个,需要 用with-mysqld-ldflags=-rdynamic设定MySQL。() 阅读全文
posted @ 2013-02-21 17:17 bo-study 阅读(255) 评论(0) 推荐(0) 编辑
摘要: gcc 链接库文件的方式:1:直接在编译选项后加上库文件的绝对地址:$ gcc -Wall calc.c /usr/lib/libm.a -o calc2:通过 -l 选项:$ gcc -Wall calc.c -lm -o calc链接库文件时,可以通过 -L 选项指定库文件的路径;Following the standard Unix convention for search paths, several directories can be specified together in an environment variable as a colon separated list;W 阅读全文
posted @ 2013-02-21 17:14 bo-study 阅读(529) 评论(0) 推荐(0) 编辑
摘要: macro:1:预处理器定义的宏:cpp -dM /dev/null 可以查看预处理器定义的宏;(或者新建一个空的头文件,如foo.h, 然后通过 cpp -dM foo.h 查看,该方式可以将输出结果重定向到文件中)2:查看某一个头文件中定义的宏:如果想查看 stdlib.h 头文件中定义的 宏,可以通过如下的方式查看:echo "#include <stdlib.h>" >foo.hcpp -dM foo.h参考: 《an introduction to gcc》 阅读全文
posted @ 2013-02-19 21:00 bo-study 阅读(270) 评论(0) 推荐(0) 编辑
摘要: #以下是指定编译器路径CC = /opt/armv6/codesourcery/bin/arm-none-linux-gnueabi-gcc#以下是指定编译需要的头文件CFLAGS = -g -Wall -O0 -I/home/andy/share/alsalib/include -I/home/andy/share/libmad_install/include#以下是源文件SRCS = main.c miniplayer_decode.c miniplayer_play.c#以下是指定需要的库文件LIBS = -L/home/andy/share/libmad_install/lib -lm 阅读全文
posted @ 2013-02-18 23:14 bo-study 阅读(5350) 评论(0) 推荐(0) 编辑
摘要: /etc/ld.so.conf 文件中存放库文件的路径;修改该文件后 执行 ldconfig 即可生效; 阅读全文
posted @ 2013-02-18 22:52 bo-study 阅读(220) 评论(0) 推荐(0) 编辑
摘要: 我目前使用的格式:indent -kr -bl -bli0 -nut -ts2 -i2 -l-1 xxx.clinux:内核使用的格式:indent-npro-kr-i8-ts8-sob-l80-ss-ncs-cp1 filename (查看 /usr/src/linux-headers-<版本>/scripts/Lindent) 阅读全文
posted @ 2013-02-18 12:41 bo-study 阅读(216) 评论(0) 推荐(0) 编辑
摘要: C语言编程中经常可以看到在结构体中定义宏,由于宏在预处理的时候即被替换,因此结构体中定义的宏的作用域仍为从定义处到文件结尾(如果没有#undef),所以在结构体中定义宏与在结构体外定义变量没有区别; (有待更进一步考究) 在结构体定义宏的好处是方便阅读:使程序员更容易理解该宏的逻辑意义; 可以通过 : gcc -E *.c 查看预编译之后的文件内容;参考:http://blog.chinaunix.net/uid-27120815-id-3273577.html 阅读全文
posted @ 2012-10-31 21:56 bo-study 阅读(1905) 评论(0) 推荐(0) 编辑
摘要: ANSI C语言中的全部转义字符序列如下:a:响铃符b:回退符f:换页符n:换行符r:回车符t:横向制表符v:纵向制表符\:反斜杠?:问号':单引号":双引号ooo:八进制数xhh:十六进制数在编程中经常看到如:\033的转义字符,它们的具体意思如下:转义字符说明\033[0m关闭所有属性\033[1m设置高亮度\033[4m下划线\033[5m闪烁\033[7m反显\033[8m消隐\033[30m—-\33[37m设置前景颜色\033[40m—-\33[47m设置背景颜色\033[nA光标上移n行\033[nB光标下移n行\033[nC光标右移n行\033[nD光标左移n 阅读全文
posted @ 2012-10-30 16:00 bo-study 阅读(800) 评论(0) 推荐(0) 编辑