Cygwin Error/warning in codelite

General questions regarding the usage of CodeLite
gerardpuducul
CodeLite Enthusiast
Posts: 36
Joined: Mon Sep 08, 2008 5:11 pm
Contact:

Cygwin Error/warning in codelite

Post by gerardpuducul »

Hy all,

I discover codelite and i am very impressed by it. But i want to use it with cygwin and specially i want to use the feature for going directly on the error/warning by clicking in the build message in the build tab but codelite don't recognize the cygwin syntax. for example I have these kind of error output :

"..\..\source\ft\ft.c", line 263: Error: C2456E: undeclared name, inventing 'extern int cds'
"..\..\source\ft\ft.c", line 263: Warning: C2917W: no side effect in void context: 'cds'
"..\..\source\ft\ft.c", line 263: Serious error: C2284E: expected ';' after command - inserted before '{'
..\..\source\ft\ft.c: 1 warning, 1 error, 1 serious error
make: *** [ft.o] Error 1

I have try to create a new compiler with other compiler error pattern but i never success to make codelite recognize my error/warning!!!! :( :(

somebody can help please??

thanks
User avatar
eranif
CodeLite Plugin
Posts: 6367
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Cygwin Error/warning in codelite

Post by eranif »

What compiler are u using?
gerardpuducul wrote:"..\..\source\ft\ft.c", line 263: Error: C2456E: undeclared name, inventing 'extern int cds'
"..\..\source\ft\ft.c", line 263: Warning: C2917W: no side effect in void context: 'cds'
"..\..\source\ft\ft.c", line 263: Serious error: C2284E: expected ';' after command - inserted before '{'
..\..\source\ft\ft.c: 1 warning, 1 error, 1 serious error
You need to define the regexes for this

The default compiler is set to detect gnu gcc compiler, the errors pattern in your example is not from g++, for example:

for g++, errors are in the form of:

Code: Select all

"..\..\source\ft\ft.c":263: error: <some message here>
To fix this, I suggest that you define a new compiler:
1. Goto 'Settings -> Build Settings ...'
2. Click on the 'New ...' button
3. Give the new compiler a name
4. At this point you have create a new compiler (toolchain + regex) which is a copy of the g++
4.1. Select the newly created compiler
5. In the 'General' tab of the new compiler, edit the patterns to fit your output, assuming that the output you provided are accurate these should do the work:
set in the 'Compile Error Pattern':

Code: Select all

("[a-zA-Z\\\.0-9 _/\:\+\-]+")(, line )([0-9]+)((: Error:)|(: Serious error:)) 
Set 'File Index in pattern' to 1
Set 'Line Number in pattern' to 3

set in the 'Compile warning pattern':

Code: Select all

("[a-zA-Z\\\.0-9 _/\:\+\-]+")(, line )([0-9]+)(: Warning) 
Set 'File Index in pattern' to 1
Set 'Line Number in pattern' to 3

6. Click OK and dismiss the dialog.

At this point u defined a new compiler which is a clone of g++ (in regards to the toolchain, but uses different regex to parse the compiler output).
All left to be done now, is to set it as the compiler for the project.

7. Right click on the project and select 'Settings...' - the 'Project Settings' dialog is opened
8. In the general Tab, select the new compiler (the 'Compiler' field) to the new created compiler.
9. Click OK and try to build again

HTH,
Eran
Make sure you have read the HOW TO POST thread
gerardpuducul
CodeLite Enthusiast
Posts: 36
Joined: Mon Sep 08, 2008 5:11 pm
Contact:

Re: Cygwin Error/warning in codelite

Post by gerardpuducul »

hy eranif,

Thanks for your answer but i had already done what you have said ( with a different regular expression ) and it dosen't work!!! :cry: :cry:

To be sure I have create a new project and follow exactly your suggestion and no change!! :( :( . There is no highlight, no link, working in the build tab. I have tested your regular expression with an other IDE and it seems good. But codelite doesn't seems to want to apply it. any suggestions?

Thanks!!

PS : I use an ARM ADS compiler
User avatar
eranif
CodeLite Plugin
Posts: 6367
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Cygwin Error/warning in codelite

Post by eranif »

Can u copy/paste here the .project file & the C:\Program Files\CodeLite\config\build_settings.xml ?

Note: I tested this regexes inside CodeLite and they seem to work fine for me

Eran
Make sure you have read the HOW TO POST thread
gerardpuducul
CodeLite Enthusiast
Posts: 36
Joined: Mon Sep 08, 2008 5:11 pm
Contact:

Re: Cygwin Error/warning in codelite

Post by gerardpuducul »

here is the .project ( i have remove all virtual directory because i have a lot of them)

<?xml version="1.0" encoding="utf-8"?>
<CodeLite_Project Name="SWIFTMM">
<VirtualDirectory Name="SYSTEM_VAL_SW">
............................................................................................
</VirtualDirectory>
<Description/>
<Dependencies/>
<Settings Type="Executable">
<Configuration Name="BB" CompilerType="ARM" DebuggerType="GNU gdb debugger" Type="Executable">
<General OutputFile="$(IntermediateDirectory)/$(ProjectName)" IntermediateDirectory="./Debug" Command="./$(ProjectName)" CommandArguments="" WorkingDirectory="$(IntermediateDirectory)" PauseExecWhenProcTerminates="yes"/>
<Compiler Required="yes" Options="-g">
<IncludePath Value="."/>
<IncludePath Value=""$(UnitTestCppBase)/include/UnitTest++/""/>
</Compiler>
<Linker Required="yes" Options="">
<LibraryPath Value=""$(UnitTestCppBase)/lib""/>
<Library Value="libUnitTest++.a"/>
</Linker>
<ResourceCompiler Required="no" Options=""/>
<PreBuild/>
<PostBuild/>
<CustomBuild Enabled="yes">
<CleanCommand>make clean</CleanCommand>
<BuildCommand>make</BuildCommand>
<SingleFileCommand></SingleFileCommand>
<MakefileGenerationCommand></MakefileGenerationCommand>
<ThirdPartyToolName>None</ThirdPartyToolName>
<WorkingDirectory>C:\DesignSync\SW\SYSTEM_VAL_SW\bb\build\pnx5220-3</WorkingDirectory>
</CustomBuild>
<AdditionalRules>
<CustomPostBuild></CustomPostBuild>
<CustomPreBuild>

</CustomPreBuild>
</AdditionalRules>
</Configuration>
<Configuration Name="Debug" CompilerType="ARM" DebuggerType="GNU gdb debugger" Type="Executable">
<General OutputFile="$(IntermediateDirectory)/$(ProjectName)" IntermediateDirectory="./Debug" Command="./$(ProjectName)" CommandArguments="" WorkingDirectory="$(IntermediateDirectory)" PauseExecWhenProcTerminates="yes"/>
<Compiler Required="yes" Options="-g">
<IncludePath Value="."/>
<IncludePath Value=""$(UnitTestCppBase)/include/UnitTest++/""/>
</Compiler>
<Linker Required="yes" Options="">
<LibraryPath Value=""$(UnitTestCppBase)/lib""/>
<Library Value="libUnitTest++.a"/>
</Linker>
<ResourceCompiler Required="no" Options=""/>
<PreBuild/>
<PostBuild/>
<CustomBuild Enabled="yes">
<CleanCommand>make build</CleanCommand>
<BuildCommand>make</BuildCommand>
<SingleFileCommand></SingleFileCommand>
<MakefileGenerationCommand></MakefileGenerationCommand>
<ThirdPartyToolName>None</ThirdPartyToolName>
<WorkingDirectory>C:\DesignSync\SW\SYSTEM_VAL_SW\bb\build\pnx5220-3</WorkingDirectory>
</CustomBuild>
<AdditionalRules>
<CustomPostBuild></CustomPostBuild>
<CustomPreBuild>

</CustomPreBuild>
</AdditionalRules>
</Configuration>
<Configuration Name="Release" CompilerType="gnu g++" DebuggerType="GNU gdb debugger" Type="Executable">
<General OutputFile="$(IntermediateDirectory)/$(ProjectName)" IntermediateDirectory="./Release" Command="./$(ProjectName)" CommandArguments="" WorkingDirectory="$(IntermediateDirectory)" PauseExecWhenProcTerminates="yes"/>
<Compiler Required="yes" Options="">
<IncludePath Value="."/>
<IncludePath Value=""$(UnitTestCppBase)/include/UnitTest++/""/>
</Compiler>
<Linker Required="yes" Options="-O2">
<LibraryPath Value=""$(UnitTestCppBase)/lib""/>
<Library Value="libUnitTest++.a"/>
</Linker>
<ResourceCompiler Required="no" Options=""/>
<PreBuild/>
<PostBuild/>
<CustomBuild Enabled="no">
<CleanCommand></CleanCommand>
<BuildCommand></BuildCommand>
<SingleFileCommand></SingleFileCommand>
<MakefileGenerationCommand></MakefileGenerationCommand>
<ThirdPartyToolName>None</ThirdPartyToolName>
<WorkingDirectory></WorkingDirectory>
</CustomBuild>
<AdditionalRules>
<CustomPostBuild></CustomPostBuild>
<CustomPreBuild></CustomPreBuild>
</AdditionalRules>
</Configuration>
</Settings>
</CodeLite_Project>


and the xml

<?xml version="1.0" encoding="UTF-8"?>
<BuildSettings>
<Compilers>
<Compiler Name="gnu g++">
<Switch Name="ArchiveOutput" Value=" "/>
<Switch Name="Debug" Value="-gstab"/>
<Switch Name="Include" Value="-I"/>
<Switch Name="Library" Value="-l"/>
<Switch Name="LibraryPath" Value="-L"/>
<Switch Name="Object" Value="-o "/>
<Switch Name="Output" Value="-o "/>
<Switch Name="Preprocessor" Value="-D"/>
<Switch Name="Source" Value="-c "/>
<Tool Name="ArchiveTool" Value="ar rcu"/>
<Tool Name="CompilerName" Value="g++"/>
<Tool Name="LinkerName" Value="g++"/>
<Tool Name="ResourceCompiler" Value="windres"/>
<Tool Name="SharedObjectLinkerName" Value="g++ -shared -fPIC"/>
<Option Name="ObjectSuffix" Value=".o"/>
<Pattern Name="Error" FileNameIndex="1" LineNumberIndex="3">(^[a-zA-Z:]{0,2}[a-zA-Z\.0-9_/\+\-]+ *)(:)([0-9]+)(:)([ eor]*)</Pattern>
<Pattern Name="Warning" FileNameIndex="1" LineNumberIndex="3">(^[a-zA-Z:]{0,2}[a-zA-Z\.0-9_/\+\-]+ *)(:)([0-9]+ *)(:)([0-9:]*)( warning:)</Pattern>
<GlobalIncludePath></GlobalIncludePath>
<GlobalLibPath></GlobalLibPath>
</Compiler>
<Compiler Name="gnu gcc">
<Switch Name="ArchiveOutput" Value=" "/>
<Switch Name="Debug" Value="-g "/>
<Switch Name="Include" Value="-I"/>
<Switch Name="Library" Value="-l"/>
<Switch Name="LibraryPath" Value="-L"/>
<Switch Name="Object" Value="-o "/>
<Switch Name="Output" Value="-o "/>
<Switch Name="Preprocessor" Value="-D"/>
<Switch Name="Source" Value="-c "/>
<Tool Name="ArchiveTool" Value="ar rcu"/>
<Tool Name="CompilerName" Value="gcc"/>
<Tool Name="LinkerName" Value="gcc"/>
<Tool Name="ResourceCompiler" Value="windres"/>
<Tool Name="SharedObjectLinkerName" Value="gcc -shared -fPIC"/>
<Option Name="ObjectSuffix" Value=".o"/>
<Pattern Name="Error" FileNameIndex="1" LineNumberIndex="3">(^[a-zA-Z:]{0,2}[a-zA-Z\.0-9_/\+\-]+ *)(:)([0-9]+)(:)([ eor]*)</Pattern>
<Pattern Name="Warning" FileNameIndex="1" LineNumberIndex="3">(^[a-zA-Z:]{0,2}[a-zA-Z\.0-9_/\+\-]+ *)(:)([0-9]+ *)(:)([0-9:]*)( warning:)</Pattern>
<GlobalIncludePath></GlobalIncludePath>
<GlobalLibPath></GlobalLibPath>
</Compiler>
<Compiler Name="VC++">
<Switch Name="ArchiveOutput" Value="/OUT:"/>
<Switch Name="Debug" Value="/Zi "/>
<Switch Name="Include" Value="/I"/>
<Switch Name="Library" Value=" "/>
<Switch Name="LibraryPath" Value="/LIBPATH:"/>
<Switch Name="Object" Value="/Fo"/>
<Switch Name="Output" Value="/OUT:"/>
<Switch Name="Preprocessor" Value="/D"/>
<Switch Name="Source" Value=""/>
<Tool Name="ArchiveTool" Value="lib.exe /nologo"/>
<Tool Name="CompilerName" Value="cl.exe /nologo /c"/>
<Tool Name="LinkerName" Value="link.exe /nologo"/>
<Tool Name="ResourceCompiler" Value="windres"/>
<Tool Name="SharedObjectLinkerName" Value="link.exe /DLL /nologo"/>
<Option Name="ObjectSuffix" Value=".obj"/>
<Pattern Name="Error" FileNameIndex="1" LineNumberIndex="3">(^[a-zA-Z\\\.0-9 _/\:\+\-]+ *)(\()([0-9]+)(\))( \: )</Pattern>
<Pattern Name="Warning" FileNameIndex="1" LineNumberIndex="3">(^[a-zA-Z\\\.0-9 _/\:\+\-]+ *)(\()([0-9]+)(\))( \: )(warning)</Pattern>
<GlobalIncludePath>"C:/Program Files/Microsoft Visual Studio 8/VC/include";.</GlobalIncludePath>
<GlobalLibPath>"C:/Program Files/Microsoft Visual Studio 8/VC/lib"</GlobalLibPath>
</Compiler>
<Compiler Name="ARM">
<Switch Name="ArchiveOutput" Value=" "/>
<Switch Name="Debug" Value="-g "/>
<Switch Name="Include" Value="-I"/>
<Switch Name="Library" Value="-l"/>
<Switch Name="LibraryPath" Value="-L"/>
<Switch Name="Object" Value="-o "/>
<Switch Name="Output" Value="-o "/>
<Switch Name="Preprocessor" Value="-D"/>
<Switch Name="Source" Value="-c "/>
<Tool Name="ArchiveTool" Value="ar rcu"/>
<Tool Name="CompilerName" Value="g++"/>
<Tool Name="LinkerName" Value="g++"/>
<Tool Name="ResourceCompiler" Value="windres"/>
<Tool Name="SharedObjectLinkerName" Value="g++ -shared -fPIC"/>
<Option Name="ObjectSuffix" Value=".o"/>
<Pattern Name="Error" FileNameIndex="1" LineNumberIndex="3">("[a-zA-Z\\\.0-9 _/\:\+\-]+")(, line )([0-9]+)((: Error:)|(: Serious error:)) </Pattern>
<Pattern Name="Warning" FileNameIndex="1" LineNumberIndex="3">("[a-zA-Z\\\.0-9 _/\:\+\-]+")(, line )([0-9]+)(: Warning) </Pattern>
<GlobalIncludePath></GlobalIncludePath>
<GlobalLibPath></GlobalLibPath>
</Compiler>
</Compilers>
<BuildSystem Name="GNU makefile for g++/gcc" ToolPath="C:/Cygwin/bin/make.EXE" Options="-f" Jobs="2"/>
</BuildSettings>

Thanks for your help :roll:
User avatar
eranif
CodeLite Plugin
Posts: 6367
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Cygwin Error/warning in codelite

Post by eranif »

Ok, I think I know where is the problem:

You are using a custom makefile, so CodeLite could not determine compiler used.
The way codelite determines the compiler is by searching for a line like this:

Code: Select all

----------Building project:[ New_Name - Static Debug ]----------
In this way, codelite can determine which compiler regex to use (imagine many project, each uses different compiler)

The solution for this:
Add this line at the start of your makefile (if you need help, you can post the makefile here, and I will update it for you):

Code: Select all

@echo "----------Building project:[ [YOUR PROJECT NAME HERE] - BB ]----------"
at the begining of your makefile

Ofc, these are workaround, in the meantime, I will apply a proper fix for this problem.

Note:
When pasting code/xml/makefiles please use the code tags this will use monospace font and make it more readable. In addition, try to keep the original formatting of the message - it is very important in makefile, where tabs has special meanings


Eran
Make sure you have read the HOW TO POST thread
User avatar
eranif
CodeLite Plugin
Posts: 6367
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Cygwin Error/warning in codelite

Post by eranif »

FYI, this bug is now fixed in SVN and will part of next build release.

Eran
Make sure you have read the HOW TO POST thread
gerardpuducul
CodeLite Enthusiast
Posts: 36
Joined: Mon Sep 08, 2008 5:11 pm
Contact:

Re: Cygwin Error/warning in codelite

Post by gerardpuducul »

ok thanks i will wait for the next release ( because my makefile are share with other people) ;)

When do you plan to release it?
User avatar
eranif
CodeLite Plugin
Posts: 6367
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Cygwin Error/warning in codelite

Post by eranif »

Probably this week / towards end of week

Eran
Make sure you have read the HOW TO POST thread
gerardpuducul
CodeLite Enthusiast
Posts: 36
Joined: Mon Sep 08, 2008 5:11 pm
Contact:

Re: Cygwin Error/warning in codelite

Post by gerardpuducul »

ky eran,

is the rev 2060 include the modification?? Because it does't seem to work :(

Thanks
Post Reply