Author Topic: Long link command truncated!  (Read 7257 times)

Offline jay3d

  • Single posting newcomer
  • *
  • Posts: 5
Long link command truncated!
« on: October 12, 2012, 01:20:39 pm »
Hi,

In Code::Blocks when creating a DLL, I have to include many objects in the link command which makes it very long, but Code::Blocks
truncate the command to 65535 characters which makes the link fail.

Is there any setting to increase the command line length?

Cheers!

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9595
Re: Long link command truncated!
« Reply #1 on: October 12, 2012, 01:27:27 pm »
Is there any setting to increase the command line length?
This is either a Windows, or a wxWidgets limitation IIRC, unfortunately. You an (however) try to use the "flat objects" option.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline jay3d

  • Single posting newcomer
  • *
  • Posts: 5
Re: Long link command truncated!
« Reply #2 on: October 12, 2012, 02:20:15 pm »
You can (however) try to use the "flat objects" option.

Thanks! with that option I can now see the full command issued, but it's still giving me "Execution of 'mingw32-g++.exe ... ' in ' ... ' failed"
There's no error message from the linker itself, the OS might still truncating the command?

Cheers!
« Last Edit: October 12, 2012, 02:21:50 pm by jay3d »

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9595
Re: Long link command truncated!
« Reply #3 on: October 12, 2012, 02:22:01 pm »
There's no error message from the linker itself, the OS might still truncating the command?
Can you post the full command or (even better) the full compiler log?
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline jay3d

  • Single posting newcomer
  • *
  • Posts: 5
Re: Long link command truncated!
« Reply #4 on: October 12, 2012, 02:47:27 pm »
Can you post the full command or (even better) the full compiler log?

This is pretty long, so I made it an attachment.

Thanks!

[attachment deleted by admin]

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9595
Re: Long link command truncated!
« Reply #5 on: October 12, 2012, 03:08:37 pm »
This is pretty long, so I made it an attachment.
Are you sure the command line is truncated - this looks pretty normal to me and is less than 64k (52605 characters, to be precise).

I'd guess C::B is really unable to launch the compiler. For me, this looks more like a configuration error.

Is the compiler setup correct Is the GCC tool chain path setup correctly? Are the file names ft the GCC tool chain setup correct? Are all of these they existing? Did you forget t install the GC++ compiler package (i.e. GCC only)? What happens if you compile at the command line?
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline jay3d

  • Single posting newcomer
  • *
  • Posts: 5
Re: Long link command truncated!
« Reply #6 on: October 12, 2012, 04:03:34 pm »
Are you sure the command line is truncated - this looks pretty normal to me and is less than 64k (52605 characters, to be precise).

I'd guess C::B is really unable to launch the compiler. For me, this looks more like a configuration error.

Is the compiler setup correct Is the GCC tool chain path setup correctly? Are the file names ft the GCC tool chain setup correct? Are all of these they existing? Did you forget t install the GC++ compiler package (i.e. GCC only)? What happens if you compile at the command line?

It was truncated before using "flat objects" option, I use a toolchain from http://www.equation.com/servlet/equation.cmd?fa=fortran
It was configured properly in C::B, proven that it compiled all the project except the final linking phase where it fails (using the same mingw32-g++ command used to compile)
If I paste the command from C::B to Windows CMD it will truncate the command, even if I put it in a batch file

Cheers!
« Last Edit: October 12, 2012, 04:45:38 pm by MortenMacFly »

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9595
Re: Long link command truncated!
« Reply #7 on: October 12, 2012, 04:45:53 pm »
If I paste the command from C::B to Windows CMD it will truncate the command, even if I put it in a batch file
So - its a Window limitation than. Not much we can do I'm afraid...
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline jay3d

  • Single posting newcomer
  • *
  • Posts: 5
Re: Long link command truncated!
« Reply #8 on: October 12, 2012, 04:59:50 pm »
So - its a Window limitation than. Not much we can do I'm afraid...

Such a weird limitation  :(
I guess I have one solution is to pack every dir in the project into a static lib and then link those will shorted the command significantly

Thanks for help!  :)