_main is already defined in Hello.obj.

Asked 2 years ago, Updated 2 years ago, 30 views

I'm a self-taught student.

While I was doing well while making Hello World!, I ran it again, and this phrase appeared saying that there was an error.

"_main is already defined in Hello.obj."

"There are symbols that have been defined several times."

It's like this. I'd really appreciate your help.

c

2022-09-22 16:57

1 Answers

A project is compiled into one binary (executable) even if there are multiple files.

At this time, one main function is required to run the process in the OS. Like there's one front door in the house.

I can't see it well because the screenshot is small, but isn't the main function already defined in the Simple Project.cpp file?

Create a separate project, write the current code, and then compile it.


2022-09-22 16:57

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.