Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow static linking on Windows #83

Open
umlaeute opened this issue Nov 8, 2022 · 0 comments · May be fixed by #84
Open

allow static linking on Windows #83

umlaeute opened this issue Nov 8, 2022 · 0 comments · May be fixed by #84

Comments

@umlaeute
Copy link

umlaeute commented Nov 8, 2022

it seems that it's impossible to create a dll that statically links against flite.

the problem, is that for static builds you shouldn't export variables with __declspec(dllexport), as found in

flite/include/flite.h

Lines 68 to 73 in 6c9f20d

#ifdef WIN32
/* For Visual Studio 2012 global variable definitions */
#define GLOBALVARDEF __declspec(dllexport)
#else
#define GLOBALVARDEF
#endif
and

flite/src/synth/flite.c

Lines 47 to 52 in 6c9f20d

#ifdef WIN32
/* For Visual Studio 2012 global variable definitions */
#define GLOBALVARDEF __declspec(dllexport)
#else
#define GLOBALVARDEF
#endif

i think the canonical way to handle this is to use a define indicating a static build (and don't use the __declspec(dllexport) decorator if it is set), like so:

#ifdef FLITE_STATIC
# define GLOBALVARDEF 
#else
# ifdef WIN32
/* For Visual Studio 2012 global variable definitions */
#  define GLOBALVARDEF __declspec(dllexport)
# else
#  define GLOBALVARDEF
# endif
#endif

obviously, whoever wants to link flite statically, will then have to define FLITE_STATIC.

umlaeute added a commit to umlaeute/flite that referenced this issue Nov 8, 2022
umlaeute added a commit to umlaeute/flite that referenced this issue Nov 8, 2022
…g for static linking

Closes: festvox#83

Signed-off-by: IOhannes m zmölnig <[email protected]>
umlaeute added a commit to pd-externals/flite that referenced this issue Nov 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant