views:

125

answers:

2

Hello. I'm teaching myself OpenGL and I'm implementing ttf text rendering using FreeType 2. I downloaded the library from

http://gnuwin32.sourceforge.net/packages/freetype.htm

and after a couple of minor issues I got it running properly. The thing that's bothering me is that I have to place a copy of freetype6.dll in the directory with my executable in order for the thing to run. I generally try to avoid a bunch of unnecessary dll files floating around. I'm sort of new to windows programming, but from what I understand most libraries can be built to run fully from a lib rather than requiring a dll at runtime. Looking through the documentation from FT is making my brain melt, so I thought I would ask here to see if there were any devs that have worked with FT before and if so, do they know how to build the library such that no dll is required at runtime.

Thank you in advance for any advice or support.

A: 

you can generate static lib by getting source code of it... then you won't need dll...and i think freetype2's source is available...

mihirpmehta
You *can* get the source code but it's insanely difficult to compile.
caspin
Yes, the source is available, but trying to read the build documentation is making me pull my hair out. Static linking is what I'm after here, I'm just looking for advice on building the static lib for Win32. I'm using VC++2008 if that helps.
Khatharr
what exact difficulties you're facing in compiling static lib...?
mihirpmehta
I don't see instructions in the docs on how to compile a static lib.
Khatharr
http://msdn.microsoft.com/en-us/library/ms235627%28VS.80%29.aspxuse setting of this tutorial
mihirpmehta
A: 

It is something DLL generic. All your DLLs should be in PATH similarly to LD_LIBRARY_PATH. Also under Windows (unlike Unix) the current directory is always in the PATH. So you just need to set your PATH variable to point to location of this dll.

Now, for Unix... you probably just have this library installed by default like hundreds of other useful libraries that are not present under Windows by default.

So... No unless you link statically you should use DLL somehow. And my suggestion - use dll.

Artyom
Er... Yes, I understand how to use a dll. I just want to link statically in this case. The only reason I could see to use dynamic linking is that I may want to do component upgrades in the future, but in the case of freetype I can't really see this ever happening.
Khatharr