1. "This program was compiled with gcc."

  2. "This program was compiled in gcc."

  3. "This program was written in C++."

  4. "This program was written with C++."

Note: gcc is a widely used compiler by C/C++ programers.

What are the subtle differences between the pairs of sentences?

  • 1
    ... compiled with gcc is the more widely used expression.
    – Kris
    Feb 2, 2013 at 12:27
  • @Kris, please review my post. I appended two new sentences.
    – xmllmx
    Feb 2, 2013 at 12:32
  • Try and not change the question in its scope. You can ask a new question instead.
    – Kris
    Feb 2, 2013 at 12:35
  • 1
    Written in C, not *with C. C is a language. You have asked this question in English, not *with English, right?
    – Kris
    Feb 2, 2013 at 12:36
  • @Kris, why does "with gcc" is correct while "with c++" is not?
    – xmllmx
    Feb 2, 2013 at 12:37

3 Answers 3


Neither of your examples is most correct; programs are compiled by compilers. GCC is doing the work to compile C code to machine code or whatever.

As for the subtle differences between your examples:

Compiled with is more correct than compiled in but both are awkward compared to the above. Using "with" to say "compiled using" is more appropriate if you are talking about the future:

"We will compile the C-code with GCC"

However, if you are talking about previously compiled code then "compiled by" makes the most sense as the work has been done, and it was performed by the compiler.

Finally, since GCC is a thing (ie a piece of software) rather than a place, "compiled in" doesn't make much sense in this case. When talking about building or making something, consider goods like a car being made in a specific country. This is why we tend to say that products are "made in China" instead of "made by China."

edit: As pointed out in the comments, we do tend to say that programs are written IN languages . Programs aren't written BY languages though, because the language is not doing the work, you are! That should also answer the additional sentences you added about writing IN C++ and then compiling that code WITH GCC to the point where the output was compiled BY GCC.

  • please review my post. I appended two new sentences.
    – xmllmx
    Feb 2, 2013 at 12:32
  • I disagree with your last paragraph. "in" is used for more than just places - for example: "This program was written in HTML." Feb 2, 2013 at 12:39
  • @KristinaLopez html is a language (hyperText Markup Language), not a compiler.
    – Kris
    Feb 2, 2013 at 12:40
  • @Kris, My point to Mattacular was that they said "in" was limited to use for a place such as "made in China". I was pointing out the flaw in that statement and my example was to show another use for "in", not to imply that HTML was a compiler. Feb 2, 2013 at 12:50
  • 1
    @KristinaLopez - you're right, we do say "in" to mean more than just places. My comments are only pertinent to this context where we are talking about building/making things. I'll update my post.
    – mattacular
    Feb 2, 2013 at 13:21

While the preposition in would make more sense and appear to be the natural choice considering the program is compiled in a specific compiler environment, 'compiled with gcc' is the predominant version found in literature.

The probable reasoning could be that gcc is not only a compiler but also a substantial set of libraries and includes.

From the horse's mouth (gnu.org): [emphasis mine]

GCC, the GNU Compiler Collection: The GNU Compiler Collection includes front ends for C, C++, Objective-C, Fortran, Java, Ada, and Go, as well as libraries for these languages (libstdc++, libgcj,...).


enter image description here

compiled with gcc 1,540,000
compiled by gcc 547,000
compiled in gcc 228,000
compiled with gcc 2,600
compiled by gcc 491
compiled in 4

  • 2
    With and by GCC are both correct, depending on the tense/context. Since the examples in the original question are all past-tense, 'compiled by' is most correct. Let's not pretend that programmers are the best writers. Just because the GNU developers are brilliant at writing compilers does not mean they are brilliant at writing english.
    – mattacular
    Feb 2, 2013 at 13:24
  • @mattacular Obviously, you've not factored in the includes. And you don't down vote (in case you wanted to) because you don't agree with the answer; you would instead, if you offer an authentic counter to it. No room for opinions in voting.
    – Kris
    Feb 3, 2013 at 10:08
  • @mattacular If developers used the preposition with, it's with good reason, not because they are poor in English. This is proved by the fact that they capitalize English. Evidently, they are definitely better than us. :)
    – Kris
    Feb 3, 2013 at 10:12
  • Sorry but my first comment was the authentic counter. Also sorry that I didn't think slapping up an nGram and calling it a day was sufficient to answer the original question which was "what are the subtle differences?" not "how frequently is each used?" Especially since one is correct over the other depending on context/tense I felt it needed more explanation than you provided.
    – mattacular
    Feb 3, 2013 at 16:06
  • Also I am genuinely curious why you think this is true: "If developers used the preposition with, it's with good reason, not because they are poor in English" I've never known programmers to be as deliberate or cautious with natural spoken language as they are with machine languages.
    – mattacular
    Feb 3, 2013 at 16:07

I agree with the other answers that compiled by is better. I just wanted to give you a more general rule on why sometimes we use with and other by. Often, it is a case of tense, past vs. future. For example

I will break the window with a hammer.

Once the window has been broken, you could examine it and say

This window was broken by a hammer.

So, for gcc, you would say

I will compile the software with gcc

The software was compiled by gcc.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.