Skip to content

Missing main entry point in shared libraries #6983

Description

@Ekopalypse

Unlike executable files libraries do not use a main entry point, at least on Windows.
No entry point means _vinit is not called at all, hence consts etc... do not get initialized.
On Windows I would suggest to generate the DllMain function which calls then _vinit and possibly a user-main function, which gets the parameters from DllMain forwarded.

V version:
OS: windows, Microsoft Windows 7 Professional v7601 64-bit
Processor: 4 cpus, 64bit, little endian, Intel(R) Core(TM) i5-2500 CPU @ 3.30GHz
CC version: N/A

vroot: D:\ProgramData\Compiler\v
vexe: D:\ProgramData\Compiler\v\v.exe
vexe mtime: 2020-11-27 18:44:30
is vroot writable: true
V full version: V 0.1.29 e0d6490.1891f55

Git version: git version 2.19.1.windows.1
Git vroot status: latest-commit-414-g1891f55c
.git/config present: true
thirdparty/tcc status: master 17d18c13

What did you do?
build shared library

What did you expect to see?
The function DllMain created

What did you see instead?
DllMain is missing

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugThis tag is applied to issues which reports bugs.OS: WindowsBugs/feature requests, that are specific to Windows OS.Status: ConfirmedThis bug has been confirmed to be valid by a contributor.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions