Author Topic: Problem with passing command line option file @file to GCC  (Read 6143 times)

Offline VincentB

  • Multiple posting newcomer
  • *
  • Posts: 28
Dear code::blocks experts,

I met the following problem with SVN 3935. In the build options of my project, when "Selected Compiler" is "GNU GCC compiler", and the next pullout list is selected to "compiler setting", and the tab "Other options" is active, and I wrote the following other options:
@some_file
Where some_file is a file where I put some command line options I would like to be passed to the compiler.

Unfortunately, it does not work, I get the following error message :
mingw32-g++.exe: @some_file: No such file or directory

The file some_file was put in the same directory as the project.
(not in red in build log). Could any one help ?
                   Vincent.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Problem with passing command line option file @file to GCC
« Reply #1 on: May 28, 2007, 06:58:08 pm »
Unfortunately, it does not work, I get the following error message :
mingw32-g++.exe: @some_file: No such file or directory



Why do you think @some_file is an valid mingw32-g++.exe option?
It does appear to be valid option for ld and as binutils.

Note, it did not work for as.exe till I used a full path name; no idea which folder it looks in by default.
Code
-Wa,"@c:\some_file.txt"

Tim S
« Last Edit: May 28, 2007, 07:04:31 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline VincentB

  • Multiple posting newcomer
  • *
  • Posts: 28
Re: Problem with passing command line option file @file to GCC
« Reply #2 on: June 26, 2007, 11:39:16 am »
Sorry for this very late reply, I was out of office...


The reason why I thought that @file is an option is that this is an option documented in GNU C compiler :

Look at this link and seach the string @file:
http://gcc.gnu.org/onlinedocs/gcc-4.2.0/gcc/Overall-Options.html#Overall-Options

I naively thought that this kind of option file can be passed to g++ also.
But you are right : I have just tested in command line from an MSYS terminal window (I am operating WindowsXP + MINGW/MSYS), and I obtained the same error message with or without full path.

So, it seems that this problem is not related to codeblocks.

Regards,
           Vincent.




Offline VincentB

  • Multiple posting newcomer
  • *
  • Posts: 28
Re: [SOLVED] Problem with passing command line option file @file to GCC
« Reply #3 on: June 26, 2007, 12:00:11 pm »
My problem is in fact that
Code
mingw32-gcc.exe --version
tells version 3.4.2, which apparently does not support @file option

(Well, just by comparing the same help section between version 3.4.2 and 4.2.0 I can see this difference : http://gcc.gnu.org/onlinedocs/gcc-3.4.2/gcc/Overall-Options.html#Overall-Options
http://gcc.gnu.org/onlinedocs/gcc-4.2.0/gcc/Overall-Options.html#Overall-Options
)

Just to add that the GCC documentation http://gcc.gnu.org/onlinedocs/gcc-4.2.0/gcc/Invoking-G_002b_002b.html#Invoking-G_002b_002b tells that most options passed to gcc can be also passed to g++. So, because the @file option is neither listed in the section concerning options controlling the C++ dialect nor in the section concerning options controlling the C dialect, it is quite logical to assume that it is either supported by both g++ and gcc, or not supported by any of them.

BR,
          Vincent.

PS: I have tested in command line the @file option with mingw32-gcc.exe and it does not work either.