kdevelop安装使用运行

Ubuntu下安装kdevelop,很实用的编写C++代码的工具。

sudo apt-get install kdevelop

就会在Ubutun中看到相应的图标,点击图标,进入程序界面

点击 New Project新建工程

选择standard模式,工程名字为Hello,编译工具cmake,系统会生成两个对应的文件。

main.cpp

#include 

int main(int argc, char **argv) {
    std::cout << "Hello, world!" << std::endl;
    return 0;
}
CMakeLists.cpp

project(hello)

add_executable(hello main.cpp)

install(TARGETS hello RUNTIME DESTINATION bin)
点击build,


Scanning dependencies of target hello
[ 50%] Building CXX object CMakeFiles/hello.dir/main.o
[100%] Linking CXX executable hello
[100%] Built target hello
*** Finished ***
最后运行,可以看到运行结果

Starting: /home/wang/projects/HelloWorld/build/helloworld
Hello, world!
*** Exited normally ***
如果觉得这篇文章有用,可以扫免费红包支持。

kdevelop安装使用运行_第1张图片


你可能感兴趣的:(Tool)