Skip to content

CorradeMain.lib - unresolved external symbol main #600

Closed
@ChrisHawkridge

Description

@ChrisHawkridge

Hi there,
I am on Windows and using Visual Studio 2022 building and MFC based application.
I installed the magnum package via vcpkg.

vcpkg install magnum

I use the magnum code in a DLL which is then used in my main EXE, however when I compile I eventually get to this error

CorradeMain.lib(CorradeMain.cpp.obj) : error LNK2001: unresolved external symbol main
C:\MyProject\x64\Release\MyProject.exe : fatal error LNK1120: 1 unresolved externals

I found the below section in the Corrade docs, but didn't really get anywhere with it.

Usage without CMake
When you don't use CMake, simply linking to the CorradeMain.lib is not enough to achieve the desired effect — additionally you need to tell the linker to choose a different entry point. That's done by passing /ENTRY:wmainCRTStartup to it for console apps and /ENTRY:wWinMainCRTStartup for GUI apps.

Are there additional parameters that I need to pass to vcpkg install to target windows?

Metadata

Metadata

Assignees

No one assigned

    Projects

    Status

    TODO

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions