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

(.text+0x20): undefined reference to `main' #2

Closed
ChoppyThing opened this issue May 18, 2019 · 2 comments
Closed

(.text+0x20): undefined reference to `main' #2

ChoppyThing opened this issue May 18, 2019 · 2 comments
Assignees

Comments

@ChoppyThing
Copy link

Hi,
i'm trying to run this example to see if it fits my needs. But i'm getting an this error while compiling the example:

Linking... /usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/Scrt1.o: In function _start':
(.text+0x20): undefined reference to main' collect2: error: ld returned 1 exit status Error: linker exited with status 1 /usr/bin/dmd failed with exit code 1.

Do you have any idea how to solve this ?

Thank you

@burner burner self-assigned this May 19, 2019
@burner burner closed this as completed in e65c1d8 May 21, 2019
@codescreener
Copy link

please upload your program
"(.text+0*20):undefined reference to *" occurs when you need to link explicit libraries to compile program
for example: if you want to compile math.h library function included program
you need to write:
$gcc file_name -o output_file_name -lm

@thanna
Copy link

thanna commented Jun 21, 2023

any fix on this problem? I encountered the same problem , works fine with visual studio no errors or warnings but when I uploaded it on the vps I cant recompile it. this is the same error that I have.

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

4 participants