I also struggled with this. To be more clear.
On Windows (7, similar on older windows): Start --> Control Panel --> System --> Advanced System Settings --> Environment Variables
Then either on the top panel or the bottom panel (if you want it to apply to other users do it on the bottom), create two new variables. The 1st one is
- CMAKE_INCLUDE_PATH which points at the bottom of your include path (should contain a "google" folder)
- CMAKE_LIBRARY_PATH which should contain "libprotobuf" "libprotobuf-lite" "liteprotoc" .lib files.
After you create the variables press OK and then re-start cmake (or clean the cache).
每个进程都会有一个返回值的. 进程开始时是由系统的一个启动函数掉用了main函数的: int nMainRetVal = main(); 当从main函数退出后,启动函数便调用exit函数,并且把nMainRetVa传递给它. 所以,任何时候都会调用exit函数的,正常情况下,main函数不会调用exit函数的,而是由return 0; 返回值给nMainRetVal的,exit再接收这个值作为参数的.所以,正常情况下是以exit(0)退出的. 如果,你程序发生异常,你可以在main函数中调用exit(1),强制退出程序,强制终止进程.其中1表示不正常退出
No comments:
Post a Comment