Page 1 of 1

Unable to compile because of filename

Posted: Thu Apr 19, 2012 5:19 pm
by dhs
I am using Codelite on Linux (self complile version)

I have some small issues that I try to search to bypass:

1/ If I want to add 2 differents files into project with samename (for example Abc.cpp and abc.cpp which is completely legal on Linux), Codelite only add one of them. Is there any option to tell CodeLite that the filename is case sentitive ?

2/ I I have a text file in my project (which is needed by our team Software factory) whose name begin with Makefile (for ex: Makefile.factory), I cannot compile correctly the project and have the following error :

>> g++: error trying to exec 'cc1objplus': execvp: No such file or directory
>> make[1]: *** [Debug/Makefile.o.d] Error 1

If I remove the file from the project, it will compile correctly

Thanks

Re: Unable to compile because of filename

Posted: Fri Apr 20, 2012 1:23 pm
by DavidGH
Hi,
1/ If I want to add 2 different files into project with same name (for example Abc.cpp and abc.cpp which is completely legal on Linux), Codelite only adds one of them
There are various ways of adding files to a project and I don't know if they all use the same common pathway, but:

Following what happens from FileViewTree::AddFilesToVirtualFolder, it calls Manager::AddFilesToProject which checks for uniqueness with a call to Manager::GetProjectNameByFile; and GetProjectNameByFile() uses wxString::CmpNoCase.
Perhaps you could test if replacing this by Cmp() solves your problem.

Eran, any objection to allowing this for non-windows platforms? If not, I'll add a DoCasesensitiveComparison parameter to Manager::GetProjectNameByFile

Regards,

David

Re: Unable to compile because of filename

Posted: Fri Apr 20, 2012 4:38 pm
by eranif
DavidGH wrote:Perhaps you could test if replacing this by Cmp() solves your problem
It will fix it for Linux / FreeBSD, but it will cause errors under Mac / Windows (both allows non-case sensitive filenames)

Eran

Re: Unable to compile because of filename

Posted: Fri Apr 20, 2012 6:39 pm
by dhs
Thanks a lot

For the second issue, do you have any suggestion for workaround ?

Re: Unable to compile because of filename

Posted: Sat Apr 21, 2012 4:55 pm
by DavidGH
The first issue is now fixed in trunk, 5463, for wxGTK.
For the second issue, do you have any suggestion for workaround ?
I'm sorry, but I don't know that part of the codebase at all, and a search for 'Makefile' didn't find anything obvious.

Re: Unable to compile because of filename

Posted: Sun Apr 22, 2012 10:01 am
by eranif
2/ I I have a text file in my project (which is needed by our team Software factory) whose name begin with Makefile (for ex: Makefile.factory), I cannot compile correctly the project and have the following error :
Can you please post your project and workspace generated makefile ? it is <project-name>.mk and <workspace-name>_wsp.mk

FYI: I was not able to reproduce this behavior (i.e. I added Makefile.factory file to a project and it compiles fine)
Eran

Re: Unable to compile because of filename

Posted: Mon Apr 23, 2012 1:13 pm
by dhs
Can you try to add to new file to the project: abc.mm

It will reproduce the issue.

Re: Unable to compile because of filename

Posted: Mon Apr 23, 2012 3:01 pm
by eranif
dhs wrote:Can you try to add to new file to the project: abc.mm
Thanks

The compilation you are getting is because the .mm file has a built-in command line (from "settings -> build settings -> <your compiler> -> file types -> mm")
Since codelite did find a match for file with .mm extension, it tried to execute its compilation rule. In this specific case, gcc failed to execute the objective-c compiler.

You can either:
- Install object-c compiler for gcc
- Delete the '.mm' rule from "settings -> build settings -> <your compiler> -> file types -> mm"

Eran