News:

As usual while waiting for the next release - don't forget to check the nightly builds in the forum.

Main Menu

Error Line number not being highlighted, with custom compiler setup

Started by scopaev, March 16, 2015, 02:19:20 AM

Previous topic - Next topic

scopaev

I successfully installed the CCS PIC compiler into the code::blocks list of compilers.
The compiler works great with code::blocks with the exception noted below.

The Error Lines are not being highlighted in the code.
When I try to double click the Build message error, nothing happens.

I think the issue has to do with codeblocks not setup for STDOUT "GCC Brief Format" errors by default.
https://gcc.gnu.org/onlinedocs/gcc-3.3.5/gnat_ug_unx/Output-and-Error-Message-Control.html

Just hoping that there is a flag or something I can set to activate this.

EXAMPLE:

WORKS GREAT, GCC Compiler & CB:
  ERROR Format:    FileName|LineNumber|ErrorMessageString|
  ERROR Example:   D:\test.c|15|Something is not right|

DOES NOT WORK, CUSTOM PICC COMPILER  ("STDOUT" + "GCC Brief Format") & CB:
  ERROR Format:    FileName:Line:Column:ErrorMessageString
  ERROR Example:   D:\test.c:15:22:Something is not right

Quiss

You should check: Compiler settings->Other settings->Advanced options->Output parsing
It's been a long time but I think the expression below was working then:
Compiler Error
Regular expression: [*]+[ \t]Error[ \t][0-9]+[ \t]["]([{}() \t#%$~A-Za-z0-9_:+/\.-]+)["][ \t]Line[ \t]([0-9]+)[()0-9,]+:[ \t](.*)
Message: 3
Additional message 2: 0
Additional message 3: 0
Filename: 1
Line: 2

You can use "Regular Expression testbed" in plugins, it is very helpful.

scopaev

Regex...shivers down spine

Thank you!!!, thats exactly what I needed  :) .
The regex testbed is fantastic (made life easier).

The following ended up working nicely for the CCS compiler messages:

  (.+):([0-9]+):([0-9]+):(.*[Ww]arning.+)
  (.+):([0-9]+):([0-9]+):(.*[Ee]rror.+)

  Although they seem too simplistic (but work).

-------------------------------------------------------
New "minor" issue:
  Now my Errors are a pretty red and my Warnings a pretty blue (I like it).

  After compiling, my "Build Log" Tab does not automatically switch to the "Build messages" Tab.
  The "Build messages" Tab is where I can click the line numbers and get auto placed to the right area.

  I notice that it is somehow related to having a "Linker for dynamic libraries" listed in the "Toolchain Executables".  The CCS compiler does not have a separate linker, which is why I did not list one.  When I place something in that field (Ccse.exe same as the C Compiler), I get an error from the C compiler (not code::blocks) stating that there are 2 duplicate source files.

  Anyway, any idea about where to look to get the Build log tab to auto switch to the build messages tab?

Again thanks so much

Quiss

As you stated above, it does not have seperate linker; so you just "Compile current file", not "Build" or Rebuild".