Sorry if this is in the wrong section but I wasn't really sure where else.

I'm trying to use gcc and -S option in order to produce assembly file. Now, if I do not use -S, I can compile it fine and run it. But once I do use -S, there are a lot of fatal errors (in building) and exits with status 1.

So how is it possible to compile and run fine but I get an error when I try to get assembly code?
Here is what I used:

gcc -ansi asdf.c -o asdf

above works fine and dandy but

gcc -ansi asdf.c -o -S asdf

gives me error.

Any insight would be deeply appreciated. Thanks.

The switch -S is in the wrong part of the command.

gcc -S filename.c
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.