Input Line Too Long

CodeLite installation/troubleshooting forum
fbronx
CodeLite Curious
Posts: 8
Joined: Sat Mar 08, 2008 1:31 am
Contact:

Input Line Too Long

Post by fbronx » Tue Jan 12, 2010 11:38 am

I've generated a workspace with the Premake tool. It contains a project with a lot of files and when the linker starts I get the following error:

Code: Select all

Input Line Too Long
mingw32-make.exe: *** [../../bin/Debug/glue_wxd.dll] Error 255
Any idea how I can solve this problem?

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

Re: Input Line Too Long

Post by eranif » Tue Jan 12, 2010 12:13 pm

This is a mingw problem. there is a limitation to how much windows allows as input to the command line - you seem to cross that limitation.

The obvious solution is to break your single project into 2-3 projects each producing an archive / dll. if this is too much of an effort, try pasting here
the link line, maybe I will come up with an idea

Eran
Make sure you have read the HOW TO POST thread

fbronx
CodeLite Curious
Posts: 8
Joined: Sat Mar 08, 2008 1:31 am
Contact:

Re: Input Line Too Long

Post by fbronx » Tue Jan 12, 2010 11:26 pm

I've included the makefile.

Franky
You do not have the required permissions to view the files attached to this post.

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

Re: Input Line Too Long

Post by eranif » Wed Jan 13, 2010 10:07 am

You are currently genertaing 200 object files, by changing this

Code: Select all

obj/Debug/WX
into

Code: Select all

objd/WX
(note that I appended 'd' to the obj to indicate a 'Debug' objects)

You will be saving a 1000 characters - which should let you "pass" the link line

To change it, open the project settings -> general tab, and change the intermediate directory entry into 'objd/WX'

EDIT:
Another option is to change the directory structure a bit:

All of your files are placed in the makefile relatively to the project file. So each file is prefixed with:

Code: Select all

../../src/WX/src/
by simply moving the 'src' directory to the project directory, the paths can be changed into:

Code: Select all

src/WX/src/
Eran
Make sure you have read the HOW TO POST thread

fbronx
CodeLite Curious
Posts: 8
Joined: Sat Mar 08, 2008 1:31 am
Contact:

Re: Input Line Too Long

Post by fbronx » Wed Jan 13, 2010 9:11 pm

I generate my project files into separate directories. I do this to keep the source directories clean from codelite files, VC++ files, make files, ...
I think it's better that the IntermediateDirectory is relative to the project directory and not a source directory.

Code: Select all

../../src/WX/src/$(IntermediateDirectory)/AboutDialogInfoClass$(ObjectSuffix)
would become this:

Code: Select all

$(IntermediateDirectory)/AboutDialogInfoClass$(ObjectSuffix)
Is this possible?

Franky.

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

Re: Input Line Too Long

Post by eranif » Wed Jan 13, 2010 9:46 pm

fbronx wrote:Is this possible?
Nope.

Doing so will prevent codelite from working with projects which has files with the same file name but under different directories.

For example:
path_one/file.cpp
path_two/file.cpp

Using your approach, both object files will be generated under the same intermediate directory so they will override each other which will cause link error.

Using the current approach, this is possible.

Btw, did u try to rename the intermediate directory like I suggested?
Eran
Make sure you have read the HOW TO POST thread

fbronx
CodeLite Curious
Posts: 8
Joined: Sat Mar 08, 2008 1:31 am
Contact:

Re: Input Line Too Long

Post by fbronx » Wed Jan 13, 2010 11:46 pm

eranif wrote:
fbronx wrote:Is this possible?
Doing so will prevent codelite from working with projects which has files with the same file name but under different directories.

For example:
path_one/file.cpp
path_two/file.cpp

Using your approach, both object files will be generated under the same intermediate directory so they will override each other which will cause link error.

Using the current approach, this is possible.
I think it's better to keep projects in separate folders of the workspace folder. Then object files are in separate folders too, so they can't conflict with other projects.
eranif wrote: Btw, did u try to rename the intermediate directory like I suggested?
Eran
I haven't tried it, but this is a temporary solution, because there are still a lot of classes to add.

Franky.

fbronx
CodeLite Curious
Posts: 8
Joined: Sat Mar 08, 2008 1:31 am
Contact:

Re: Input Line Too Long

Post by fbronx » Thu Jan 14, 2010 12:47 am

I had hoped that this could help me: I changed the settings for a cpp file into this

Code: Select all

$(CompilerName) $(SourceSwitch) "$(FileFullPath)" $(CmpOptions) $(ObjectSwitch)$(IntermediateDirectory)/$(FileName)$(ObjectSuffix) $(IncludePath)
This makes it possible to get the object files in another folder then the sourcefolder, but it still have problems with defining dependencies and the linker.

Code: Select all

../../src/WX/src/$(IntermediateDirectory)/AboutDialogInfoClass$(ObjectSuffix): ../../src/WX/src/AboutDialogInfoClass.cpp 
	@makedir "../../src/WX/src/obj/WX/Debug"
	$(CompilerName) $(SourceSwitch) "C:/development/GLUEscript/src/WX/src/AboutDialogInfoClass.cpp" $(CmpOptions) $(ObjectSwitch)$(IntermediateDirectory)/AboutDialogInfoClass$(ObjectSuffix) $(IncludePath)
Franky

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

Re: Input Line Too Long

Post by eranif » Thu Jan 14, 2010 9:10 am

fbronx wrote:I think it's better to keep projects in separate folders of the workspace folder. Then object files are in separate folders too, so they can't conflict with other projects.
I agree with you. However, what do you do when you got the same file name under the same project?
fbronx wrote: I haven't tried it, but this is a temporary solution, because there are still a lot of classes to add.
Even if we will place all the objects under the same directory, it is also a temporary solution, since eventually the linker will complain again (once it will hit its limit). The correct solution is to break your project into sub-projects.

Btw, are you using SVN version of codelite? or an official release?
Eran
Make sure you have read the HOW TO POST thread

fbronx
CodeLite Curious
Posts: 8
Joined: Sat Mar 08, 2008 1:31 am
Contact:

Re: Input Line Too Long

Post by fbronx » Thu Jan 14, 2010 12:03 pm

I agree with you. However, what do you do when you got the same file name under the same project?
I had this problem when I imported cURL into my source tree and had two files: curl.c and curl.cpp with resulted into the same object file. I solved this problem by renaming my files following the POCO C++ standard (meaning my curl.cpp was renamed into CurlClass.cpp, the suffix Class is because this file implements a JavaScript Class).
Even if we will place all the objects under the same directory, it is also a temporary solution, since eventually the linker will complain again (once it will hit its limit). The correct solution is to break your project into sub-projects.
Can't we use wildcards then?
Btw, are you using SVN version of codelite? or an official release?
I use the latest official release

Franky

Post Reply