-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cmakelists文件 #64
Comments
我也是遇到这个问题。自己写了 CMakeLists.txt 后可以正常编译构建,运行的时候命令行上一直显示 close18。不过能输出日志 |
@ChenXinShuo1998 找到原因了。是 |
@Young-Flash 可以把你的cmakelists发一下吗,我自己写的老是报错 |
sorry 过了太久了我已经删掉了 |
webserver.cpp里WebServer::WebServer()有个getcwd(),这个函数得到的是“当前工作目录的绝对路径”。如果使用外部构建的方法(创建build文件夹在里面cmake)生成的server可执行文件在build里,如果终端的当前工作目录目录在build里,getcwd()函数获取的路径就不对了,因为这个项目的头文件inlclude都是用相对路径 " ./XX和 ../XX"引用的。 所以解决办法就是让运行web程序的终端在工作路径 ~/myWeb/TinyWebServer-master 下,再运行./build/server就行了,内部构建还是外部构建也无所谓。 |
请问有cmakelists文件吗,我根据makefile写的cmakelists但是运行后不能进入,命令行上一直显示close17 close16
The text was updated successfully, but these errors were encountered: