Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using command line arguments when compile with gcc in codeblocks

Tags:

c

gcc

codeblocks

So my question is simple.

I want to compile a C project file in gcc compiler 4.4.8.

In windows cmd window I can type :

gcc -std=c99 -O2 -DCONTEST -s -static -lm name.c -o name.exe

In Code::Blocks how can I change the compiler default arguments with the above? I wanted to build a c file and I geting errors like

error: 'for' loop initial declarations are only allowed in C99 mode|
like image 477
Nikos KLon Avatar asked Apr 21 '26 04:04

Nikos KLon


1 Answers

Ok to put your preferred arguments to gnu compiler go to :

Settings -> Debugger -> Compiler settings -> Other Options

and paste there your arguments!

Example:

-std=c99 -O2 -DCONTEST -s -static -lm
like image 61
Nikos KLon Avatar answered Apr 22 '26 19:04

Nikos KLon



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!