|
|
1, 有关使用C++编程的问题
我现在想用C++来开发一个程序,该开发的程序需要在一个精简的Linux系统中使用。 如果把该程序移植到精简的Linux系统中,请问需要移植哪些C++的动态库文件才行?有没有办法直接设置Makefile的编译选项, 进行静态编译,以后可以不依赖C++的动态库。 我试着在Makefile的-gcc 后加-static 参数 (CFLAGS += -gcc -g -static -lstdc++),出现了编译错误。 例如,
request_handler.o(.text+0x50): In function `CRequestHandler::~CRequestHandler()':
request_handler.cpp: undefined reference to `operator delete(void*)'
request_handler.o(.text+0x7a): In function `CRequestHandler::~CRequestHandler()':
request_handler.cpp: undefined reference to `operator delete(void*)'
而不加static或者加dynamic编译选项,编译没有问题。
2, 我的程序中需要访问一些硬件信息,如获得硬盘数量,获取网卡数量等等。 请问有什么办法可以编程实现么? 如果不能直接编程实现,应该如何访问系统文件获取?
3, 在编译C++程序时,我已经在gcc后面加上了 –g选项。 编译是没问题的,执行也没问题。 可是我在使用gdb进行调试的时候,出现以下错误:
(gdb) r
Starting program: /home/atao/nas_cpp/httpd
Reading symbols from shared object read from target memory...(no debugging symbols found)...done.
Loaded system supplied DSO at 0x992000
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
迫切希望高手指教, 只要能回答以上问题即可。 万分感谢了。 |
|