如何在Linux中编译C ++源代码 [英] How to compile c++ source code in linux

查看:89
本文介绍了如何在Linux中编译C ++源代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在Linux(RedHat)中编译c ++.

I want to compile c++ in Linux(RedHat).
Help me!

推荐答案

使用g++编译器,例如在命令提示符下键入:

Use the g++ compiler, e.g. type at command prompt:

g++ -o myapp myapp.cpp



其中"myapp"是(由编译器生成的)可执行文件的名称,"myapp.cpp"是您的C++源文件.



where ''myapp'' is the name of the (compiler generated) executable, ''myapp.cpp'' is your C++ source file.


使用GCC.您将在此处找到所有选项: http://gcc.gnu.org/ [ http://en.wikipedia.org/wiki/Anjuta [ http: //www.anjuta.org/ [ ^ ].

如果您使用源代码发布程序,则通常将其解压缩到目录和命令中:
Use GCC. You will find all the options here: http://gcc.gnu.org/[^].

Want some something like Visual Studio? Use Anjuta IDE, see http://en.wikipedia.org/wiki/Anjuta[^], http://www.anjuta.org/[^].

If you have a program distribution in source code, you typically unpack it in a directory and command:
./configure
make
make install



您以root用户身份执行的最后一个命令,例如:sudo make install.

—SA



Last command you do as root, for example: sudo make install.

—SA


这篇关于如何在Linux中编译C ++源代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆