Author Topic: build vs compile?  (Read 5893 times)

Offline jinjin12

  • Multiple posting newcomer
  • *
  • Posts: 13
build vs compile?
« on: March 01, 2011, 08:03:15 pm »
what's the difference between building a .cpp file and compiling it? i'm curious because i see the options

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9508
Re: build vs compile?
« Reply #1 on: March 01, 2011, 08:13:35 pm »
Compile = Compiler compiles source code into an object file.
Build = Compiler compiles and linker links the object files created by the compiler into e.g. an executable application (or a library...).
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline jinjin12

  • Multiple posting newcomer
  • *
  • Posts: 13
Re: build vs compile?
« Reply #2 on: March 02, 2011, 12:15:51 am »
this is not related to code blocks but i'm curious, when i use the g++ -o on linux, does that build or compile?  i heard that it compiles into an object file, however, i am able to execute the resulting file, thus g++ -o actually builds(compile + link like you said) the file correct?  thanks for helping a noob btw

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9508
Re: build vs compile?
« Reply #3 on: March 02, 2011, 11:35:54 am »
this is not related to code blocks but i'm curious, when i use the g++ -o on linux, does that build or compile?  i heard that it compiles into an object file, however, i am able to execute the resulting file, thus g++ -o actually builds(compile + link like you said) the file correct?  thanks for helping a noob btw
g++ -o builds (compile + link). The build will be an executable if the source code provides a main function accordingly.
g++ -c just compiles.

I am locking this topic now. For more basic stuff use Google / a programmers basic book / a compiler related forum.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ