Skip to content

microtexexport.h: a MICROTEX_STATIC branch, so that a static microtex lib links on MSVC - #195

Open
pthom wants to merge 1 commit into
NanoMichael:openmathfrom
pthom:pr_microtex_static_export
Open

pthom wants to merge 1 commit into
NanoMichael:openmathfrom
pthom:pr_microtex_static_export

Conversation

@pthom

@pthom pthom commented Sep 23, 2026

Copy link
Copy Markdown

The MSVC branch in microtexexport.h only knows two states:

  #if defined(MICROTEX_LIBRARY)
      #define MICROTEX_EXPORT __declspec(dllexport)   // building the DLL
  #else
      #define MICROTEX_EXPORT __declspec(dllimport)   // consuming the DLL
  #endif

There is no static-library branch. Static-lib consumers see __declspec(dllimport) and emit __imp_* references that cannot be resolved against the static microtex.lib (which only contains plain symbols, no _imp stubs).

This PR adds a third branch: when MICROTEX_STATIC is defined, expand MICROTEX_EXPORT to nothing.

….lib links on MSVC

The MSVC branch only knows dllexport (MICROTEX_LIBRARY defined) and dllimport (not defined):
consumers of a static microtex.lib see dllimport and fail to link (unresolved __imp_* symbols,
e.g. __imp_??0Stroke@microtex@@qeaa@XZ). With MICROTEX_STATIC defined, MICROTEX_EXPORT is empty.

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant