Skip to content

Without main function, compilation fails.#7

Open
OwenGrumbles wants to merge 1 commit intoBanceDev:mainfrom
OwenGrumbles:main
Open

Without main function, compilation fails.#7
OwenGrumbles wants to merge 1 commit intoBanceDev:mainfrom
OwenGrumbles:main

Conversation

@OwenGrumbles
Copy link

@OwenGrumbles OwenGrumbles commented Feb 17, 2026

When compiling with:

gcc -o hashmap hashmap.c

I get this error:

/usr/bin/ld: /usr/lib/gcc/x86_64-pc-linux-gnu/15.2.1/../../../../lib/Scrt1.o: in function `_start':
(.text+0x1b): undefined reference to `main'
collect2: error: ld returned 1 exit status

Adding main function leads to successful compilation.

@BanceDev
Copy link
Owner

thats because you're trying to make an executable out of the hashmap source file. If your goal is to build the shell check out the build instructions. This project uses premake for the build system.

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

Successfully merging this pull request may close these issues.

2 participants