How to build FLTK.dll with Visual Studio?

122 views
Skip to first unread message

Baal Lukor

unread,
Mar 13, 2022, 5:09:30 PM3/13/22
to fltk.general

Hi, I did everything described in the README.CMake file and I got successfully built the FLTK.sln using the command prompt.
But when I open it with Visual Studio I have only x64 solutions available, so I selected "create new" and converted everything to Win32. Then I wanted to build the FLTK.dll but in the end I got many link errors "GDIplus".

Can someone please explain to me step by step what I have to configure before building the solution?

I want to update the fltk.dll from the game "Amnesia: The Dark Descent" which is from 2010 so can I even replace the old fltk.dll with a new from version 1.4.0 ?

I got successfully built FLTK 1.3.8 by opening the "ide" folder which has a vs2010 solution and the game works with it. But even here I got warnings during the build process and I don't know whether everything is correct inside.

Or please can you pre-build an official fltk.dll when the stable version of FLTK 1.4.0 is released?
For you developers it should be done in 2 minutes I think and everyone would be happy to have an easier life.

Thank you.

imm

unread,
Mar 13, 2022, 5:22:20 PM3/13/22
to General FLTK
On Sun, 13 Mar 2022, 21:09 Baal Lukor wrote:

Hi, I did everything described in the README.CMake file and I got successfully built the FLTK.sln using the command prompt.
But when I open it with Visual Studio I have only x64 solutions available, so I selected "create new" and converted everything to Win32. Then I wanted to build the FLTK.dll but in the end I got many link errors "GDIplus".

Can someone please explain to me step by step what I have to configure before building the solution?

I want to update the fltk.dll from the game "Amnesia: The Dark Descent" which is from 2010 so can I even replace the old fltk.dll with a new from version 1.4.0 ?

This is unlikely to work: whilst the API of 1.4 is compatible with prior releases, the ABI is substantially different, to allow for more flexibility in rendering solutions (such as GDI+, as you noted) and so the 1.4 DLL will not be backwards compatible.

The 1.3 ABI may be compatible with the existing game files you have, but I am far from certain of that!


I got successfully built FLTK 1.3.8 by opening the "ide" folder which has a vs2010 solution and the game works with it. But even here I got warnings during the build process and I don't know whether everything is correct inside.

Or please can you pre-build an official fltk.dll when the stable version of FLTK 1.4.0 is released?
For you developers it should be done in 2 minutes I think and everyone would be happy to have an easier life.


This is not likely to happen: we do not distribute any binary files, only source, and DLL files in particular are problematic in terms of dependencies and compatability, so it's always better for the end users to build their own.

Our preference is that, where people are distributing applications that depend on fltk, they statically link, avoiding any future ABI or dependency issues. This is generally the most effective option since fltk is so compact that static linking is generally the better choice, compared to dynamically linking to a DLL.

--
Ian
From my Fairphone FP3

Philip Rose

unread,
Mar 13, 2022, 6:05:11 PM3/13/22
to fltkg...@googlegroups.com

Hi Baal,

 

I posted a couple of weeks ago the tweaks I had to make to VS2019 flow to build the 1.4 snapshot at the time. From what you say all you need to add is the MS library gdiplus.lib to the list of static libraries you need to include in the linker.

 

To build 32-bit you need to add a switch to CMake (-A Win32).

 

Regards Phil.

 

Sent from Mail for Windows

--
You received this message because you are subscribed to the Google Groups "fltk.general" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fltkgeneral...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkgeneral/d30f2479-c5a3-4a80-86f3-b6f46205ba77n%40googlegroups.com.

 

Baal Lukor

unread,
Mar 13, 2022, 7:42:21 PM3/13/22
to fltkg...@googlegroups.com
Thank you all. Okay I understand that 1.4 ABI is incompatible to previous versions but nevertheless I want to try it. Maybe the game will work and maybe I'll notice some positive effects. So I definitely want the FLTK 1.4 to build.

I will try the switch and get to link the gdiplus library.

Baal Lukor

unread,
Mar 20, 2022, 7:57:49 AM3/20/22
to fltk.general
Hey, can you tell me which is the GDI+ I have to use? There are many different sources on Github by different companies and I don't know which is the right one to build FLTK.
Thanks for help.

imm

unread,
Mar 20, 2022, 8:05:34 AM3/20/22
to General FLTK
On Sun, 20 Mar 2022, 11:57 Baal Lukor wrote:
Hey, can you tell me which is the GDI+ I have to use? There are many different sources on Github by different companies and I don't know which is the right one to build FLTK.

None of them.

GDI+ is a part of the Windows system and should be available as a DLL in your build system.

With the MS tools you would link against gdiplus.lib (if I recall correctly, I seldom use VS tooling) or with the mingw tools it would be libgdiplus.a.

You do not need any third party library for this.

If you don't already have the requisite libs on your system, then your tools installation is broken.

pvrose

unread,
Mar 20, 2022, 12:09:25 PM3/20/22
to fltkg...@googlegroups.com

On 20 March 2022, at 12:05, imm <imaca...@gmail.com> wrote:

>
>
>On Sun, 20 Mar 2022, 11:57 Baal Lukor wrote:
>
>Hey, can you tell me which is the GDI+ I have to use? There are many different sources on Github by different companies and I don't know which is the right one to build FLTK.
>
>None of them.
>
>GDI+ is a part of the Windows system and should be available as a DLL in your build system.

I just added to the list of .lib to link. As I was already linking ms libraries, I already had the location.

Phik.


>
>With the MS tools you would link against gdiplus.lib (if I recall correctly, I seldom use VS tooling) or with the mingw tools it would be libgdiplus.a.
>
>You do not need any third party library for this.
>
>If you don't already have the requisite libs on your system, then your tools installation is broken.
>
>--
>Ian
>From my Fairphone FP3
>

>--
>You received this message because you are subscribed to the Google Groups "fltk.general" group.
>To unsubscribe from this group and stop receiving emails from it, send an email to fltkgeneral...@googlegroups.com.

>To view this discussion on the web visit https://groups.google.com/d/msgid/fltkgeneral/CAGFM6daY%2BuyetyBOgU02E0ZG4s%2B3qq5sej6A7u4ugtF07GO59g%40mail.gmail.com.

Reply all
Reply to author
Forward
0 new messages