Build Ubuntu c&c++ Development Environment [GCC & Clang & Intel for x86 & AMD64]

Source: Internet
Author: User

My build environment is VMware 10.0.4 + lubuntu 14.04, SelectLubuntuThis release is because it compares to Ubuntu moreLightweight, usingLXDEDesktop Environment (may use LXQT in the future), 64Bit boot memory occupies more than 300 MB, while Ubuntu is around 600MB. The installation of the hard disk will be much smaller, for the development test allocation of 1.5GB memory is sufficient. Note that VMware 10 Vmware-tools does not fully support Ubuntu 14.10, after installation cannot find the host shared folder in/mnt, other graphics drive God horse is not a problem. The version reference for the customer operating system that corresponds to the VMware version:http://partnerweb.vmware.com/comp_guide2/pdf/VMware_GOS_Compatibility_Guide.pdf, the best way to try out the latest Ubuntu 14.10 is to install VMware 11.
    • Remove unwanted software and start the firewall (all incoming connections are blocked by default) after the system installation is complete:
    

    • Update software and language support and Install the following packages:
  
 
  1. build-essential #编译套件,包含gcc和make,编译安装vmware-tool也须安装此包
  2. gnome-system-monitor #Ubuntu默认任务管理器,比Lubuntu自带的强大太多了,替换之
  3. 7zip-full #用于解压7z格式压缩包
  4. gdb, clang #不解释...
  5. g++-4.8-multilib #用于64位主机编译32位程序
  6. cmake #跨平台的编译构建软件
  7. libgl1-mesa-dev #解决编译Qt程序时出现"cannot find -lGL"错误
  8. ubuntu-tweak #Ubuntu下很好用的清理软件,这个没有官方源,可以去官网下载deb安装包

    • installation Vmware-tool, extract to any directory, install all the way back, until you see enjoy, restart can.


    • installation Intel C + + Compiler for Linux:
Intel C + + compiler is commercial software, but for Linux version can be free trial, as long as not for commercial purposes, originally wanted to download the latest version of 15.0.1, only found the following page ...
        
do not know whether the new version of the free policy has changed, only the first with the previous 14.0.1 version. unzip to any directory and run the install_gui.sh GUI installation directly.
    
tick the required components:
    
    

add an include file environment directory, do not perform this step Intel C + + will not find the relevant header file when compiling the C + + program.
    
 
   
  
  1. # Add Intel C++ Compiler Include Path
  2. export CPLUS_INCLUDE_PATH="$CPLUS_INCLUDE_PATH:/usr/include/c++/4.8:/usr/include/x86_64-linux-gnu/c++/4.8"
save restart, console input export to see if the environment variable was added successfully. ?
    • Install Qtcreator as IDE:
QtcreatorThe ability to quickly switch between different compilers is very convenient, do not install the source version directly, there will be no window control bar bug. DownloadQt 5.4.0 for Linux,Double-click Run to install. Configure the compiler and build suite, where if you add the Linux ICC directly in the Compile Times QBs script error, the workaround is to select the GCC type to add the Intel C + + compiler.     
?
after Setup is complete, the configuration is correct under test:
  
 
  1. #include <string>
  2. #include <iostream>

  3. int main(int argc, char **argv)
  4. {
  5. using namespace std;

  6. string cc;
  7. #if defined(__INTEL_COMPILER)
  8. cc = "icc";
  9. #elif defined(__clang__)
  10. cc = "clang";
  11. #elif defined(__GNUC__)
  12. cc = "gcc";
  13. #endif

  14. cout << cc << "-" << sizeof ( void *) * 8 << "bit" Span class= "PLN" > << Endl
  15. return 0;
  16. }
?
compress disks before creating a virtual machine snapshot:
   
 
  1. sudo /usr/bin/vmware-toolbox-cmd disk list #查看磁盘挂载点
  2. sudo /usr/bin/vmware-toolbox-cmd disk shrink / #压缩磁盘挂载点
?



From for notes (Wiz)

Build Ubuntu c&c++ Development Environment [GCC & Clang & Intel for x86 & AMD64]

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.