Skip to content

lld: undefined symbol main when linking c with Windows app #7852

@taishi132

Description

@taishi132

I have an application with wWinMain defined that runs just fine (not considering #7851) without linking to C. When I do link with C, I get this message from lld:

lld-link: error: undefined symbol: main
>>> referenced by d:\agent\_work\4\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:78
>>>               libcmtd.lib(exe_main.obj):(int __cdecl invoke_main(void))
error: LLDReportedFailure

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions