zoukankan      html  css  js  c++  java
  • Modern C++ Course [Lecture 2] {Compilation, Debugging, Functions, Header/Source, Libraries, CMake}

    http://www.ipb.uni-bonn.de/wp-content/uploads/2018/05/lecture_2.pdf


     make bash file executable

     

     Wall: Warning all

    Wextra: add even more extra Warning

    Werror: treat Warnings as errors

     

    by default, there's no optimization.

    -O0

    -O3 -Ofaster 

     

     

    "segmentation fault" means you are using some unallowed memory.

     

     

    use reference to avoid copy, and save a lot time!

     explaining how reference as function variable works.

     

     

    Announce default variables only in declaration (typo above...).

    sort, sumation, multiplication standard operation in std::vector

     

     every header file should include "#pragma once", otherwise you would get wierd errors.

     

     

    the compiler doesn't know the definition of the test.cpp.

     

    simply add the 2nd line will make the "c++ main.cpp ... " work, but no output!

    build the test.cpp first, and include the result .o file into main.cpp building.

         c++ workflow!!!

    .o file is binary and only machine can read it.

     

     

      maybe there's a branch of changing now in makefile. but this file is simple and readable.

     

     

  • 相关阅读:
    应用层
    传输层
    一元函数微分学
    函数、极限、连续
    网络层习题与真题
    网络层
    数据链路层习题与真题
    二、使用kubeadm部署k8s
    一、Kubernetes概述
    二、rsync文件同步
  • 原文地址:https://www.cnblogs.com/ecoflex/p/10182982.html
Copyright © 2011-2022 走看看