Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 22016

Why isn't gcc recognizing my .c file even when I provide it as an argument?

$
0
0

I have file1.c:

#include <stdio.h>

int main() {

    file2();

}

and file2.c:

#include <stdio.h>

int file2() {
}

I'm trying to compile file1 with gcc -o file1 file1.c file2.c, but I'm getting the error implicit declaration of function 'file2' is invalid.

Does anyone know what I could be missing here? file1.c and file2.c are both in the same folder.


Viewing all articles
Browse latest Browse all 22016

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>