{"id":2680,"date":"2013-03-14T01:59:32","date_gmt":"2013-03-14T01:59:32","guid":{"rendered":"http:\/\/www.readytext.co.uk\/?p=2680"},"modified":"2013-11-28T08:12:32","modified_gmt":"2013-11-28T08:12:32","slug":"compiling-lcdf-typetools-under-windows-using-mingw","status":"publish","type":"post","link":"https:\/\/www.readytext.co.uk\/?p=2680","title":{"rendered":"Compiling LCDF Typetools under Windows using MinGW"},"content":{"rendered":"<h1>Introduction<\/h1>\n<p>This is just a short post to share a workaround to a problem I ran into when building Eddie Kohler&#8217;s superb <a href=\"http:\/\/www.lcdf.org\/type\/\">LCDF Typetools<\/a> under Windows using MinGW. After running <code>.\/configure<\/code> to create the make files I hit a problem during compilation with lots of error messages referring to <code>undefined reference to `ntohl@4'<\/code><\/p>\n<p><code><br \/>\n..\/typetools\/libefont\/otf.cc:863: undefined reference to `ntohl@4'<br \/>\n..\/typetools\/libefont\/otf.cc:861: undefined reference to `ntohs@4'<br \/>\n..\/typetools\/libefont\/otf.cc:861: undefined reference to `ntohs@4'<br \/>\n<\/code><\/p>\n<h1>One solution<\/h1>\n<p>The cause of the error is failure to link to the library <code>libwsock32.a<\/code> (contained in the <code>c:\\MinGW\\lib\\<\/code> directory on my PC). The following workaround solves the problem but I&#8217;m sure there are better ways of doing it. Several tools within the Typetools collection depend on <code>libwsock32.a<\/code> to compile successfully. There are:<\/p>\n<ul>\n<li>otfinfo<\/li>\n<li>otftotfm<\/li>\n<li>cfftot1<\/li>\n<\/ul>\n<p>To build these programs you need to make a small edit to the generated makefiles.<\/p>\n<ol>\n<li>Create a directory called (say) <code>libs<\/code> within the Typetools directory tree.<\/li>\n<li>Copy <code>libwsock32.a<\/code> into that directory.<\/li>\n<li>For each application listed above, that depends on <code>libwsock32.a<\/code>, open the <code>makefile<\/code> in the appropriate application directory and look for a line starting with<code> XXXXX_LDADD<\/code> where XXXX is <code><strong>otfinfo<\/strong><\/code> or <code><strong>otftotfm<\/strong><\/code> or <code><strong>cfftot1<\/strong><\/code><\/li>\n<li>Edit that line to include <code>libwsock32.a<\/code><\/li>\n<li>Example: <code>cfftot1_LDADD = ..\/libefont\/libefont.a ..\/libs\/libwsock32.a ..\/liblcdf\/liblcdf.a<\/code><\/li>\n<\/ol>\n<p>You should now be able to run <code>make <\/code>and achieve a successful compilation. It worked for me, I hope it works for you.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction This is just a short post to share a workaround to a problem I ran into when building Eddie Kohler&#8217;s superb LCDF Typetools under Windows using MinGW. After running .\/configure to create the make files I hit a problem during compilation with lots of error messages referring to undefined reference to `ntohl@4&#8242; ..\/typetools\/libefont\/otf.cc:863: undefined [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[28,29],"tags":[],"class_list":["post-2680","post","type-post","status-publish","format-standard","hentry","category-c-programming-miscellaneous","category-post-about-about-fonts-glyphs-and-characters"],"blocksy_meta":[],"_links":{"self":[{"href":"https:\/\/www.readytext.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/2680","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.readytext.co.uk\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.readytext.co.uk\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.readytext.co.uk\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.readytext.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2680"}],"version-history":[{"count":13,"href":"https:\/\/www.readytext.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/2680\/revisions"}],"predecessor-version":[{"id":3223,"href":"https:\/\/www.readytext.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/2680\/revisions\/3223"}],"wp:attachment":[{"href":"https:\/\/www.readytext.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2680"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.readytext.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2680"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.readytext.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2680"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}