Page 1 of 1

Questions/Suggestions

Posted: Sun Dec 27, 2009 11:30 pm
by smartmobili
Hi,

I wanted to test again codelite to see the evolution from the last time I tried it (was one year ago I think) and I have some suggestions :

1)When inserting some files inside a project, menu should be : "Add Existing File(s)" instead of "Add an existing file" because the latter
doesn't reflect the fact you can add multiple files. Another remark is about insertion speed that is very slooooooowww.

2)In your codelite+mingw bundle you should add pthread to mingw because it's used in lots of opensource projects.


I have also some questions:

1) I tried first to install only codelite because I had an existing mingw installation but I never found the menu where you add
compiler path so I have finally installed the codelite+mingw but I still don't see how you find mingw path. I only see
something in Tag Settings but I hope this it not from where you locate compiler. So how do you set compiler path ?

2) I have some errors when compiling my project :

C:/lal/openquartz/openquartz_20091224/openquartz/src/CoreFoundationLite/CFBinaryPList.c:868: error: jump to label 'miss'
C:/lal/openquartz/openquartz_20091224/openquartz/src/CoreFoundationLite/CFBinaryPList.c:853: error: from here
C:/lal/openquartz/openquartz_20091224/openquartz/src/CoreFoundationLite/CFBinaryPList.c:855: error: crosses initialization of 'const uint8_t* ptr2'
mingw32-make.exe[1]: *** [Debug/CFBinaryPList.o] Error 1

The question is : is it gcc error messages or are you translating them ?
And is it possible to disable the error messages you are displaying directly in source code because this is useless and just add confusion.

Thanks

Re: Questions/Suggestions

Posted: Sun Dec 27, 2009 11:45 pm
by eranif
smartmobili wrote:1)When inserting some files inside a project, menu should be : "Add Existing File(s)" instead of "Add an existing file" because the latter
doesn't reflect the fact you can add multiple files
Sure, this can be changes easily
smartmobili wrote:Another remark is about insertion speed that is very slooooooowww.
Not to me ... nor my colleagues
smartmobili wrote:2)In your codelite+mingw bundle you should add pthread to mingw because it's used in lots of opensource projects.
Can u specify what is missing? since I think I did included it
smartmobili wrote:1) I tried first to install only codelite because I had an existing mingw installation but I never found the menu where you add
compiler path so I have finally installed the codelite+mingw but I still don't see how you find mingw path
You can do it in several ways:
- 'Settings -> Build Settings' and select your compiler, in the 'Tools' tree item, there is an entry named 'PATH', set it like this:

Code: Select all

$(PATH);C:\Path\To\My\MinGW
Note that I prepend here the content of the old PATH variable
- You can also define new environment variable from 'Settings -> Environment Variables', something like:
MyMINGW
with value:
C:\Path\To\My\MinGW
Next, in the 'Tools' entry of your compiler of choice, prepend each tool with the $(MyMINGW)
- Third way: add environment variable named PATH to the environment variables from 'Settings -> Environment variables'
It is similar to the first method, but this one affects not only the compiler, but it sets it "globally"
smartmobili wrote:C:/lal/openquartz/openquartz_20091224/openquartz/src/CoreFoundationLite/CFBinaryPList.c:868: error: jump to label 'miss'
C:/lal/openquartz/openquartz_20091224/openquartz/src/CoreFoundationLite/CFBinaryPList.c:853: error: from here
C:/lal/openquartz/openquartz_20091224/openquartz/src/CoreFoundationLite/CFBinaryPList.c:855: error: crosses initialization of 'const uint8_t* ptr2'
mingw32-make.exe[1]: *** [Debug/CFBinaryPList.o] Error 1

The question is : is it gcc error messages or are you translating them ?
Those are gcc error messages, codelite simply invokes makefiles and prints the output (it also parses the output, but this is another story)
smartmobili wrote:And is it possible to disable the error messages you are displaying directly in source code because this is useless and just add confusion.
If you find them useless, you can disable them or replace them with less intrusive marker from:
'Settings -> Build Settings' select the 'Build Output Appearance' and un-check the option: 'Compiler errors/warnings shown in text annotations' ( another quicker way to navigate to this dialog with this specific tab, is from the 'Build' pane, there is a little toolbar to the left, click on the last button which says "Set compiler colours"

EDIT:
I just tried the following code sample:

Code: Select all

#include <stdio.h>
#include <pthread.h>

void *thread_entry(void *arg)
{
	printf("Inside thread!!\n");
	return NULL;
}

int main(int argc, char **argv)
{
	pthread_t tid;
	pthread_attr_t attr;
	pthread_attr_init(&attr);
	
	pthread_create(&tid, &attr, thread_entry, NULL);
	Sleep(1000);
	return 0;
}
and it compiles, links and run fine with the MinGW that comes with codelite (did you try to compile something with pthread? or you assumed it does not include it?)

Eran

Re: Questions/Suggestions

Posted: Mon Dec 28, 2009 2:51 pm
by smartmobili
Thanks for all answers.
Abou pthread I was just guessing it was not included because I had a look and I didn't see pthread.h in include dir
(but it was in mingw32).
About compiler path, I had a look and there is nothing in PATH var so are you using another mechanism when installing
the codelite+mingw bundle ?

UPDATE : I have another project using mingw internally (GNUstep) that added its mingw path to global var and that's why
I didn't understand how things works. So now I have removed it from env var.

Re: Questions/Suggestions

Posted: Mon Dec 28, 2009 9:13 pm
by smartmobili
I found an annoying bug when using pre-build events, when I tried to create a folder while it already exists
compilation stops but with Visual it works fine:

Prebuild commands:
mkdir "..\..\dist\bin"
mkdir "..\..\dist\lib"

With Visual Studio :

Prepare include path
A subfolder or a file C:\lal\openquartz\openquartz_20091227\openquartz\src\CoreFoundationLite\\dist\bin already exists.
A subfolder or a file C:\lal\openquartz\openquartz_20091227\openquartz\src\CoreFoundationLite\\dist\lib already exists.

With codelite:
Executing Pre Build commands ...
mkdir "..\..\dist\bin"
Un sous-rmingw32-make.exe: *** [All] Error 2

Would it be possible to check retirn code from dos cmd and adopt a clever behavior ?
Do you plan to also support some Visual variable like $(SolutionDir), ... ?

Thanks

Re: Questions/Suggestions

Posted: Mon Dec 28, 2009 9:41 pm
by eranif
smartmobili wrote:I found an annoying bug when using pre-build events, when I tried to create a folder while it already exists
compilation stops but with Visual it works fine:
It sounds to me like a bug in Visual Studio not in codelite - if the command returns error other than 0 - it should abort

Since the Windows 'mkdir' is very primitive (it does not accept any arguments) - you might consider using codelite's 'makedir' instead - it performs the same way, however it will not prompt for errors if the directory already exists
smartmobili wrote:Do you plan to also support some Visual variable like $(SolutionDir), ... ?
No.

Please note, that patches are welcome (although I am guaranteeing that they will all be accepted)
Eran

Re: Questions/Suggestions

Posted: Mon Dec 28, 2009 11:24 pm
by smartmobili
eranif wrote:
smartmobili wrote:I found an annoying bug when using pre-build events, when I tried to create a folder while it already exists
compilation stops but with Visual it works fine:
It sounds to me like a bug in Visual Studio not in codelite - if the command returns error other than 0 - it should abort

Since the Windows 'mkdir' is very primitive (it does not accept any arguments) - you might consider using codelite's 'makedir' instead - it performs the same way, however it will not prompt for errors if the directory already exists
smartmobili wrote:Do you plan to also support some Visual variable like $(SolutionDir), ... ?
No.

Please note, that patches are welcome (although I am guaranteeing that they will all be accepted)
Eran
I disagree of course it's not a Visual Studio bug...
I suppose mkdir returns a DOS error code indicating that it already exists so it shouldn't stop.

I am also trying to compile objective-C code and I had to remove some flags you are passing when detecting .m or .mm : -X objective-c.

Finally I have created a new workspace/project and this time when trying to compile I get the following error :

g++ -c "C:/lal/openquartz/openquartz_20091227/openquartz/src/UIKit/examples/helloworld/mainapp.m" -g -o ./Debug/mainapp.o "-I." "-I." "-I../../../../../../include" "-I../../../../../../include/usr"
g++ -c "C:/lal/openquartz/openquartz_20091227/openquartz/src/UIKit/examples/helloworld/SampleApp.m" -g -o ./Debug/SampleApp.o "-I." "-I." "-I../../../../../../include" "-I../../../../../../include/usr"
g++: CreateProcess: No such file or directory

However when I try to compile my first project with the same compiler it works fine so if you have any idea why ...
I may have an idea because when I try to compile an empty main.c it works but if I rename it into .m it fails.
I will have a look but would it be possible to integrate objective-C support to your mingw install ?

Re: Questions/Suggestions

Posted: Tue Dec 29, 2009 2:34 am
by smartmobili
Once I have installed mingw-objc module things are better but I have a question, are you sure you need to pass -X (uppercase) ?
Because in command line when I try it I get an error :

C:\MinGW-4.4.0\bin>gcc -X objective-c mainapp.m
gcc: objective-c: No such file or directory
gcc: unrecognized option '-X'

if using -x(lowercase) I get no errors...

Re: Questions/Suggestions

Posted: Tue Dec 29, 2009 9:18 am
by eranif
smartmobili wrote:Once I have installed mingw-objc module things are better but I have a question, are you sure you need to pass -X (uppercase) ?
Because in command line when I try it I get an error :

C:\MinGW-4.4.0\bin>gcc -X objective-c mainapp.m
gcc: objective-c: No such file or directory
gcc: unrecognized option '-X'

if using -x(lowercase) I get no errors...
I never compiled Objective-C, the flags used for .mm / .m files were contributed by a Mac user - so he might be wrong there.
You can modify them from:
'Settings > Build Settings'
select your compiler and and under it, select 'File Types'
There you can modify the build line for the 'mm' file type

Eran