-
Notifications
You must be signed in to change notification settings - Fork 443
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
Comments
I'm away from a system at the moment, however, from what I recall you need
to set environment values to tell the build system where the files will be
located before invoking make.
Clearly host.o will not be located in the root of the filesystem.
cc -g -c -o */host.o*
Take a look at the statements at the top of the makefile.
…-Vince
On Mon, Aug 12, 2024 at 11:50 PM John Alex ***@***.***> wrote:
The declaration of main:74
<https://github.com/drh/lcc/blob/9bd428949f53b34980d194b1b4a2be921a85b5b4/etc/lcc.c#L74>
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 by manually setting the standard to std=c89 or
overriding with the right -W flag but I still end up with the result being
that we're missing output files, see below) 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
# sudo make all CC=clang
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
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
—
Reply to this email directly, view it on GitHub
<#53>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AGSORE5IPL4SNI2H7DGHMHLZRF67NAVCNFSM6AAAAABMNLWF5SVHI2DSMVQWIX3LMV43ASLTON2WKOZSGQ3DEMZSGY2TGMQ>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Even setting environment variables still has error: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The declaration of
main
:74 is missing a type entirely. I set this toint
and proceeded.Trying to run
make lcc
gives me an error about not having permission to write the.o
files, so Isudo
to give the process permission and proceeded.Compilation then failed because
/lburg/gram.c
usesfree
but<stdlib.h>
hasn't been included and no definition is given forfree
, 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 whateverSo okay, let's try just running each of the make commands on their own.
so those ones seem to work, but no matter what order I do the rest in, compilation fails, and the outputs generally look like
How am I supposed to build this? because
make all
doesn't work eitherThe text was updated successfully, but these errors were encountered: