Ir para conteúdo

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

urm

Erro na compilação

Recommended Posts

Olá,

eu sou novo no C/C++ e estou com um problema na hora de compilar um código,

dá o seguinte erro:

C:\Users\Eva Vilma\Downloads\Compilador\gcc.exe [Error] 1 compilaþÒo.c: No such file or directory

C:\Users\Eva Vilma\Downloads\Compilador\gcc.exe	[Error] no input files
compilation terminated.
28 C:\Users\Eva Vilma\Downloads\Compilador\Makefile.win	recipe for target '"1 compilação.o"' failed

E o código que eu estou tentando compilar:

#include <stdio.h>
        #include <stdlib.h>
        #include <stdarg.h>
        
        char look; 
        
        
        void init();
        
        void nextChar();
        void error(char *fmt, ...);
        
        void fatal(char *fmt, ...);
        void expected(char *fmt, ...);
        
        void match(char c);
        char getName();
        
        char getNum();
        void emit(char *fmt, ...);
        
        
        int main()
        {
                init();
        
                return 0;
        }
        
        
        void init()
        
        {
                nextChar();
        }
        
        
        void nextChar()
        
        {
                look = getchar();
        }
        
        
        
        void error(char *fmt, ...)
        {
                va_list args;
        
                fputs("Error: ", stderr);
        
                va_start(args, fmt);
        
                vfprintf(stderr, fmt, args);
                va_end(args);
        
                fputc('\n', stderr);
        }
        
        
        
        void fatal(char *fmt, ...)
        {
                va_list args;
        
                fputs("Error: ", stderr);
        
                va_start(args, fmt);
        
                vfprintf(stderr, fmt, args);
                va_end(args);
        
                fputc('\n', stderr);
        
                exit(1);
        
        }
        
        
        void expected(char *fmt, ...)
        {
        
                va_list args;
        
                fputs("Error: ", stderr);
        
                va_start(args, fmt);
                vfprintf(stderr, fmt, args);
        
                va_end(args);
        
                fputs(" expected!\n", stderr);
        
                exit(1);
        }
        
        
        void match(char c)
        
        {
                if (look != c)
                        expected("'%c'", c);
        
                nextChar();
        }
        
        
        char getName()
        
        {
                char name;
        
                if (!isalpha(look))
        
                        expected("Name");
                name = toupper(look);
        
                nextChar();
        
                return name;
        }
        
        
        
        char getNum()
        {
                char num;
        
                if (!isdigit(look))
        
                        expected("Integer");
                num = look;
                nextChar();
        
                return num;
        }
        
        
        void emit(char *fmt, ...)
        
        {
                va_list args;
        
                putchar('\t');
        
                va_start(args, fmt);
                vprintf(fmt, args);
        
                va_end(args);
        
                putchar('\n');
        
        }

Compartilhar este post


Link para o post
Compartilhar em outros sites

Se está no Windows, vá no terminal e verifique se o sistema operacional não adicionou um .txt no final da extensão do arquivo (arquivo.c.txt) caso esteja usando um notepad ou semelhante.

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.