Static Linking GUI in Win32

Hi,

I’m trying to make a static link of my ROOT GUI. I

  1. downloaded the source (5.32.rc2), and performed the following steps in Cygwin
    2 ./configure win32
  2. make
  3. make static

libroot.a is created, but when linking roota, a lot of the following link errors occur. Similar errors occur, when linking my application to libroot.a in Visual C++ 9. It guess, it has something to do with the /MD compiler switch, but I really can’t figure it out, how to solve this problem. Any help is appreciated.

Jürgen

libRoot.a(TRootBrowserLite.o) : error LNK2019: Verweis auf nicht aufgelöstes ext
ernes Symbol “”__declspec(dllimport) char const * const gHelpRemote" (_imp?gHe
lpRemote@@3QBDB)" in Funktion ““public: virtual bool _thiscall TRootBrowserLite
::ProcessMessage(long,long,long)" (?ProcessMessage@TRootBrowserLite@@UAE_NJJJ@Z)
".
libRoot.a(TRootBrowser.o) : error LNK2001: Nicht aufgelöstes externes Symbol “”

_declspec(dllimport) char const * const gHelpRemote” (_imp?gHelpRemote@@3QBDB)
”.
libRoot.a(TRootBrowserLite.o) : error LNK2019: Verweis auf nicht aufgelöstes ext
ernes Symbol “”__declspec(dllimport) char const * const gHelpBrowserLite" (__imp
_?gHelpBrowserLite@@3QBDB)" in Funktion ““public: virtual bool __thiscall TRootB
rowserLite::ProcessMessage(long,long,long)” (?ProcessMessage@TRootBrowserLite@@U
AE_NJJJ@Z)”.
libRoot.a(TGTextEditor.o) : error LNK2019: Verweis auf nicht aufgelöstes externe
s Symbol “”__declspec(dllimport) char const * const gHelpTextEditor" (_imp?gHe
lpTextEditor@@3QBDB)" in Funktion ““public: virtual bool __thiscall TGTextEditor
::ProcessMessage(long,long,long)” (?ProcessMessage@TGTextEditor@@UAE_NJJJ@Z)”.
libRoot.a(TNetFile.o) : error LNK2019: Verweis auf nicht aufgelöstes externes Sy
mbol “”__declspec(dllimport) char const * * gRootdErrStr" (_imp?gRootdErrStr@@
3PAPBDA)" in Funktion ““protected: void __thiscall TNetFile::PrintError(char con
st *,int)” (?PrintError@TNetFile@@IAEXPBDH@Z)”.
libRoot.a(TSocket.o) : error LNK2001: Nicht aufgelöstes externes Symbol “”__decl
spec(dllimport) char const * * gRootdErrStr" (_imp?gRootdErrStr@@3PAPBDA)".
libRoot.a(TUDPSocket.o) : error LNK2001: Nicht aufgelöstes externes Symbol “”__d
eclspec(dllimport) char const * * gRootdErrStr" (_imp?gRootdErrStr@@3PAPBDA)".

libRoot.a(Win32Splash.o) : error LNK2019: Verweis auf nicht aufgelöstes externes
Symbol “imp__RealizePalette@4" in Funktion ""void cdecl DisplayGraphic(stru
ct HWND
*,struct HDC
*)” (?DisplayGraphic@@YAXPAUHWND__@@PAUHDC__@@@Z)".
libRoot.a(Win32Splash.o) : error LNK2019: Verweis auf nicht aufgelöstes externes
Symbol “imp__SelectPalette@12" in Funktion ""void cdecl DisplayGraphic(stru
ct HWND
*,struct HDC
*)” (?DisplayGraphic@@YAXPAUHWND__@@PAUHDC__@@@Z)".
libRoot.a(Win32Splash.o) : error LNK2019: Verweis auf nicht aufgelöstes externes
Symbol “__imp__UnregisterClassA@8” in Funktion ““void __cdecl DestroySplashScre
en(void)” (?DestroySplashScreen@@YAXXZ)”.
libRoot.a(Win32Splash.o) : error LNK2019: Verweis auf nicht aufgelöstes externes
Symbol “__imp__DestroyWindow@4” in Funktion ““void __cdecl DestroySplashScreen(
void)” (?DestroySplashScreen@@YAXXZ)”.
libRoot.a(Win32Splash.o) : error LNK2019: Verweis auf nicht aufgelöstes externes
Symbol “imp__CreateWindowExA@48" in Funktion "“int cdecl CreateSplashScreen
(struct HWND
*)” (?CreateSplashScreen@@YAHPAUHWND
@@@Z)”.
libRoot.a(Win32Splash.o) : error LNK2019: Verweis auf nicht aufgelöstes externes
Symbol “imp__DefWindowProcA@16" in Funktion "“long stdcall SplashWndProc(st
ruct HWND
*,unsigned int,unsigned int,long)” (?SplashWndProc@@YGJPAUHWND
@@II
J@Z)”.

Hi Jürgen,

Static linking of ROOT is not supported on Windows. The “.a” files are cygwin files, not native win32 static libraries.

Cheers, Bertrand

Hi Bertrand,

thank you for your information. This leaves one question open for me (as pointed out in an earlier post here): I’d like to distribute an application for Win32 based on ROOT. It’s quite likely, that potential users won’t need a full ROOT installation.

Which form of distribution would you recommend?

Regards, Jürgen

Well, at least %ROOTSYS% must be defined, and the subdirectories bin, etc, fonts, icons must be there (with their content)… so most of the full ROOT binary distribution. Note you can still strip down the dlls to use only the needed ones, but be careful with plugins…
You could just try on a clean computer :wink:

Cheers, Bertrand.

That’s what I tried to avoid with static linking :slight_smile: I’ve already done this on a ‘clean’ computer and it works. Thanks for your quick reply.

Regards, Jürgen

No problem! And glad to know it works! :slight_smile:

Cheers, Bertrand.