随笔分类 - C/C++
摘要:转载:陈皓http://blog.csdn.net/haoel前言C++中 的虚函数的作用主要是实现了多态的机制。关于多态,简而言之就是用父类型别的指针指向其子类的实例,然后通过父类的指针调用实际子类的成员函数。这种技术 可以让父类的指针有“多种形态”,这是一种泛型技术。所谓泛型技术,说白了就是试图...
阅读全文
摘要:链接时可以通过-L和-l来指定自己的库,因此链接可以通过,但是运行时,系统仍无法找到指定的库,需要简单配置一下。解决方法: 可以直接在将自己的库所在路径添加到/etc/ld.so.conf文件中。但一般这个文件中的内容都是一句“include /etc/ld.so.conf.d/*.conf”,因此...
阅读全文
摘要:在VS2010中新建文件夹,然后在文件夹内新建文件polling.cpp,可是在项目中不现实该cpp文件,所以就在在硬盘上将该文件删除,编译报错。>c1xx : fatal error C1083: Cannot open source file: 'polling.cpp': No such fi...
阅读全文
摘要:#ifdef _WIN32 #include #include #pragma comment(lib,"ws2_32.lib") #else #include #include #include #include #include #include #include #endif int getselfiplist(unsigned long ipbuf[],int bufcount) { int i,count=0; #ifdef _WIN32 char hostname[128]; struct hostent* inaddrs; if(gethostname(hos
阅读全文
摘要:has incomplete type and cannot be defined在头文件中添加该类型所在的文件eg:aggregate 'std::stringstream oss' has incomplete type and cannot be ;在文件中添加 include 来解决。
阅读全文