Skip to content

Zig doesn't detect wWinMain symbol in C files. #18621

Description

@eLeCtrOssSnake

Zig Version

0.12.0-dev.2159+7916cf6f8

Steps to Reproduce and Observed Behavior

Compile some C code that has a wWinMain startup point. (my use case: C application built by build.zig)
Observe that compiler ignores wWinMain definition and instead complains about the absence of main.

Side notes:
This issue is not present on the 0.11.0 version.
Declaring main instead of wWinMain works. This is the current workaround that I am using.
This is observed on both x86-windows and x86_64-windows

Zig build log: https://paste.sr.ht/~electrosssnake/da3a6d579b24d868d2f32f75f3c7b95b43686142
Whole build.zig: https://paste.sr.ht/~electrosssnake/ce4e6a9b7f184d910e2b309381da62ccf871b922
C file(start.c) that contains windows startup symbol: https://paste.sr.ht/~electrosssnake/8ac72ced13aed44f53549fe354baa9adeb068b56

Expected Behavior

Zig correctly detects wWinMain and builds the application.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugObserved behavior contradicts documented or intended behavioros-windowsMicrosoft WindowsregressionIt worked in a previous version of Zig, but stopped working.

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions