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.

     

     

  • 相关阅读:
    python_函数
    初始python第三天(三)
    python入门练习题2
    python开发进阶之路(一)
    python入门练习题1
    初识Python第三天(二)
    初识Python第三天(一)
    初识Python第二天(4)
    初识python第二天(3)
    c windows控制台输出颜色文字
  • 原文地址:https://www.cnblogs.com/ecoflex/p/10182982.html
Copyright © 2011-2022 走看看