Author Topic: How to add new compilers to CodeBlocks?  (Read 961 times)

Offline gh_origin

  • Multiple posting newcomer
  • *
  • Posts: 48
How to add new compilers to CodeBlocks?
« on: November 24, 2020, 09:57:59 am »
I want to add an unsupported compiler. I have read anything available about XML based compiler and here are my XMLs. I have no idea why CodeBlocks started up with an exception saying the compiler ID is duplicated. I did give it a new ID! I have to use Task Manager to End the codeblocks.exe process after this.

Here is the exception:



p/s: extensions renamed to .txt to be able to upload.

Offline gh_origin

  • Multiple posting newcomer
  • *
  • Posts: 48
Re: How to add new compilers to CodeBlocks?
« Reply #1 on: November 24, 2020, 10:04:49 am »
I put these XMLs on C:\Program Files\CodeBlocks\share\CodeBlocks\compilers.

Our school used Turbo C++ 3.0 to teach programming and we switched to CodeBlocks + Borland Free C++ 5.5 compiler for a while. Now I want to upgrade to newer Borland Free C++ compiler to let the students use a more modern compiler and some new language standard features. Our curriculum was designed around that Borland C++ compiler and we used many specific features of it so switching to the GNU compiler caused our code to no longer compile. The plan is to switch to the GNU compiler in the future, but currently we still have to stick with Borland compiler.

Offline gh_origin

  • Multiple posting newcomer
  • *
  • Posts: 48
Re: How to add new compilers to CodeBlocks?
« Reply #2 on: November 24, 2020, 12:24:25 pm »
I found the problem. I'm not directly editing the XMLs with an text editor but instead using a XML editor program. That program is buggy as I kicked the save button but it indeed doesn't save anything. Save As works, though. The new compiler is recognized now and I'm updating the compiler options. Sorry.

p/s: which XML editor program are you using? I can't imagine editing XML with a plain text editor.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13007
    • Travis build status
Re: How to add new compilers to CodeBlocks?
« Reply #3 on: November 24, 2020, 12:28:00 pm »
I use a plain text editor.
Why would you want to use a special editor for this task?
Obviously it causes more troubles then the saved time. :)
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline gh_origin

  • Multiple posting newcomer
  • *
  • Posts: 48
Re: How to add new compilers to CodeBlocks?
« Reply #4 on: November 25, 2020, 07:05:59 am »
After struggled a while I decided to modify the existing bcc compiler XMLs instead of adding my new bcc32c XMLs. Here is the modified XMLs. Everything worked fine now.

BTW, you could download the modern Borland free C++ compiler here: https://altd.embarcadero.com/download/bcppbuilder/BCC102.zip Version 5.5 is too old to use now.