User forums > Using Code::Blocks

Let MinGW throw Code::Blocks generate assembly code (without errors)

(1/2) > >>

unnaturhal:
Hi there!
I have a simple problem. I need to generate assembly code when I compile my source, so I find that I must add -S suffix to the compiler.
I got it (in (right_click_on)Project -> Build options... -> Compiler settings -> Other options), simply writing -S in the Other options panel.
Now, when I rebuild my project, it automatically opens a main.o blank file and gives a syntax error in the Biuld messages panel. But, when I try to open the .o files, the assembly code is there, so it seems to work.
The question is: why Code::Blocks gives back this error and have this strange behavior? And again, there is a way to solve this problem?

Thanks in advance.

stefanos_:
This is totally unrelated to Code::Blocks IDE. This is something that has to do with your compiler; just run "gcc demo.c -S" from terminal and you will be just fine.

stahta01:

--- Quote from: stefanos_ on April 20, 2013, 03:07:52 pm ---This is totally unrelated to Code::Blocks IDE. This is something that has to do with your compiler; just run "gcc demo.c -S" from terminal and you will be just fine.

--- End quote ---

I am NOT sure the question is totally unrelated to Code::Blocks IDE.

You might try fixing it by changing the file property setting in the Code::Blocks IDE.
But, I would likely try doing something like suggested here http://wiki.codeblocks.org/index.php?title=Adding_support_for_non_C/C%2B%2B_files_to_the_build_system

NOTE: That is likely over complex for you.
Using a post or post build step is likely what would be simplest for you.

Tim S.

stefanos_:
Even though initially I said it's not related (and I still believe it's not fully related) with Code::Blocks, it is rather related to compiler; I haven't found though a decent way to produce the desired results you want with the help of Code::blocks. I do know the traditional way of using the compiler itself from terminal.


--- Code: ---gcc -ansi -Wall -g -S file.c
gcc -c file.s -o file.o
gcc file.o -o file

--- End code ---

unnaturhal:
Thanks for the replies but this morning I upgraded my Code::Blocks (from 10.05 to 12.11) and my MinGW, and now it desn't compile nothing (and put a red line under comments and strings without a reason..).
I will try your methods when I will solve those issues.

Navigation

[0] Message Index

[#] Next page

Go to full version