Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid main declaration && Missing input files #53

Open
JohnAlexCO opened this issue Aug 13, 2024 · 2 comments
Open

Invalid main declaration && Missing input files #53

JohnAlexCO opened this issue Aug 13, 2024 · 2 comments

Comments

@JohnAlexCO
Copy link

JohnAlexCO commented Aug 13, 2024

The declaration of main:74 is missing a type entirely. I set this to int and proceeded.

Trying to run make lcc gives me an error about not having permission to write the .o files, so I sudo to give the process permission and proceeded.

Compilation then failed because /lburg/gram.c uses free but <stdlib.h> hasn't been included and no definition is given for free, so I include it at the top of the file and try to proceed again.

But at this stage, regardless of what C-compiler I try to build with (clang, gcc, tcc, chibicc, ...) I get variations of the same problem -- lots of files don't want to build because of implicit function use (which is possible to get past, but I still end up with missing output files, regardless) or because I'm missing .o objects or whatever

# sudo make lcc CC=gcc
cc -g -c -o /host.o 
cc: fatal error: no input files
compilation terminated.
make: *** [makefile:128: /host.o] Error 1

So okay, let's try just running each of the make commands on their own.

sudo make cpp
sudo make bprint
sudo make liblcc
sudo make lburg
sudo make rcc
make: Nothing to be done for 'cpp'.
make: Nothing to be done for 'bprint'.
make: Nothing to be done for 'liblcc'.
make: Nothing to be done for 'lburg'.
make: Nothing to be done for 'rcc'.

so those ones seem to work, but no matter what order I do the rest in, compilation fails, and the outputs generally look like

sudo make triple
cc -g -c -o /host.o 
cc: fatal error: no input files
compilation terminated.
make: *** [makefile:128: /host.o] Error 1

How am I supposed to build this? because make all doesn't work either

cpp/getopt.c:21:3: warning: add explicit braces to avoid dangling else [-Wdangling-else]
   21 |                 else if (strcmp(argv[optind], "--") == 0) {
      |                 ^
1 warning generated.
clang -g -c -Icpp -o /unix.o cpp/unix.c
clang -g  -o /cpp /cpp.o /lexer.o /nlist.o /tokens.o /macro.o /eval.o /include.o /hideset.o /getopt.o /unix.o 
clang -g -c -o /host.o 
clang: error: no input files
make: *** [makefile:128: /host.o] Error 1
@Azzydon
Copy link

Azzydon commented Aug 13, 2024 via email

@zqxyus
Copy link

zqxyus commented Nov 16, 2024

Even setting environment variables still has error:
cc -g -c -o /host.o
cc: fatal error: no input files
compilation terminated.
make: *** [makefile:128: /host.o] Error 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants