Skip to content

fopen/ fclose crash on Windows with DLLs loaded via LoadLibrary #71

@kylincaster

Description

@kylincaster

Hi, I recently submitted a pull request that adds:

  • Windows support for loading dynamic libraries via LoadLibrary
  • Using @generated macro to simulate variadic C-style function templates (e.g., printf, printf!)

PR link: Add Windows DLL Support and Template-like Variadic Print Functions #70

While the core functionality works, there is one unresolved issue:

When calling standard C I/O functions like fopen and fclose via Windows dll api LoadLibrary, the program crashes.
Strangely, this does not happen when:

  • Using Julia’s native ccall(:fopen, ...)
  • Exporting LLVM IR and compiling into a standalone executable

This may be due to CRT linkage mismatches or buffering conflicts between different runtime contexts.
If anyone knows how to fix this CRT/runtime conflict, please help!

Cheers,
Kylin

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions