【发布时间】:2011-06-30 21:59:15
【问题描述】:
我是 C++ 新手,我已经安装了 lib Com++ 用于网络编程 但是当我只包含头文件时
#include <iostream>
#include <ComPP/ComPlusPlus>
using namespace std;
int main(int argc ,char *argv[]){
cout << "Hello World" << endl;
return 0;
}
我得到了错误
main.cpp:2:29: fatal error: ComPP/ComPlusPlus: No such file or directory
使用 Fedora linux 我使用此命令按照手册中所述进行编译
g++ -I ./ -L./ -o server main.cpp -lCommPP -lsys -lpthread -lrt
目录 /usr/include/ComPP/ 与所有头文件都存在
ComPP
├── ComPlusPlus
│ ├── AClnt.h
│ ├── ASrvContext.h
│ ├── ASrv.h
│ ├── ASrvProperties.h
│ ├── Clone.h
│ ├── Comm.h
│ ├── ComPlusPlus
│ ├── Context.h
│ ├── Daemon.h
│ ├── Directory.h
│ ├── DirEntry.h
│ ├── File.h
│ ├── Launch.h
│ ├── Mutex.h
│ ├── Poll.h
│ ├── Process.h
│ ├── SClnt.h
│ ├── Sem.h
│ ├── ShMem.h
│ ├── Signalling.h
│ ├── Socket.h
│ ├── SocketTcp.h
│ ├── SocketUdp.h
│ ├── SocketUnix.h
│ ├── SrvProperties.h
│ ├── SSrvContext.h
│ ├── SSrv.h
│ ├── SSrvProperties.h
│ └── Thread.h
└── SysPlusPlus
├── ComException.h
├── config.h
├── GenCfg.h
├── Logger.h
├── syscall.h
├── syslib.h
├── SysPlusPlus
└── Tools.h
【问题讨论】:
-
您没有指定要包含哪些头文件。
标签: c++ network-programming include-path