From: Simon L. <s.l...@gm...> - 2007-06-26 21:52:23
|
Hi all! I have been trying to get plplot with pdf support to compile on mingw for quite some time now. The goal is to have a static lib that can plot and output it in pdf. I have used postscript output before and it works perfectly. I am getting undefined references to _imp__HPDF_methodname, see below. Am I missing some lib that should be linked in? Is there some problem with name decoration? The steps i take to get this error: 1. download and compile libharu-2.0.8 source package for mingw. (cygwin with --nocygwin) 2. configure plplot-5.7.3 using cmake-setup, set PLD_pdf to on and give the library and include directories when asked. select to compile to static lib. 3. compile plplot using mingw32-make.exe The same error as below also occurs when plrender.exe is linked. Any suggestions, hints or ideas are wery welcome! Best regards, Simon g++.exe main.o logprocessor.o -o "out.exe" -L"C:/Dev-Cpp/plplot-5.7.3/lib" -L"C:/Dev-Cpp/plplot-5.7.3/buildmingw/bindings/c++" -L"C:/Dev-Cpp/plplot- 5.7.3/buildmingw/src" -L"C:/Dev-Cpp/plplot-5.7.3/buildmingw/lib/csa" -L"C:/Dev-Cpp/libharu-2.0.8" -llibboost_regex-mgw-mt-s-1_33_1 -llibboost_filesystem-mgw-mt-s-1_33_1 -lplplotcxxd -lplplotd -lcsirocsa -lgdi32 -lcomdlg32 -lhpdf C:/Dev-Cpp/plplot-5.7.3/buildmingw/src/libplplotd.a(pdf.obj)(.text+0x24e): pdf.c: undefined reference to `_imp__HPDF_New@8' C:/Dev-Cpp/plplot-5.7.3/buildmingw/src/libplplotd.a(pdf.obj)(.text+0x286): pdf.c: undefined reference to `_imp__HPDF_Free@4' C:/Dev-Cpp/plplot-5.7.3/buildmingw/src/libplplotd.a(pdf.obj)(.text+0x2c8): pdf.c: undefined reference to `_imp__HPDF_AddPage@4' C:/Dev-Cpp/plplot-5.7.3/buildmingw/src/libplplotd.a(pdf.obj)(.text+0x2ee): pdf.c: undefined reference to `_imp__HPDF_Page_SetSize@12' C:/Dev-Cpp/plplot-5.7.3/buildmingw/src/libplplotd.a(pdf.obj)(.text+0x337): pdf.c: undefined reference to `_imp__HPDF_Page_Concat@28' C:/Dev-Cpp/plplot-5.7.3/buildmingw/src/libplplotd.a(pdf.obj)(.text+0x3a3): pdf.c: undefined reference to `_imp__HPDF_Page_SetRGBFill@16' C:/Dev-Cpp/plplot-5.7.3/buildmingw/src/libplplotd.a(pdf.obj)(.text+0x3b6): pdf.c: undefined reference to `_imp__HPDF_Page_GetWidth@4' C:/Dev-Cpp/plplot-5.7.3/buildmingw/src/libplplotd.a(pdf.obj)(.text+0x3dc): pdf.c: undefined reference to `_imp__HPDF_Page_GetHeight@4' C:/Dev-Cpp/plplot-5.7.3/buildmingw/src/libplplotd.a(pdf.obj)(.text+0x414): pdf.c: undefined reference to `_imp__HPDF_Page_MoveTo@12' C:/Dev-Cpp/plplot-5.7.3/buildmingw/src/libplplotd.a(pdf.obj)(.text+0x437): pdf.c: undefined reference to `_imp__HPDF_Page_LineTo@12' C:/Dev-Cpp/plplot-5.7.3/buildmingw/src/libplplotd.a(pdf.obj)(.text+0x458): pdf.c: undefined reference to `_imp__HPDF_Page_LineTo@12' C:/Dev-Cpp/plplot-5.7.3/buildmingw/src/libplplotd.a(pdf.obj)(.text+0x47b): pdf.c: undefined reference to `_imp__HPDF_Page_LineTo@12' C:/Dev-Cpp/plplot-5.7.3/buildmingw/src/libplplotd.a(pdf.obj)(.text+0x48e): pdf.c: undefined reference to `_imp__HPDF_Page_Fill@4' C:/Dev-Cpp/plplot-5.7.3/buildmingw/src/libplplotd.a(pdf.obj)(.text+0x4e2): pdf.c: undefined reference to `_imp__HPDF_Page_SetLineWidth@8' C:/Dev-Cpp/plplot-5.7.3/buildmingw/src/libplplotd.a(pdf.obj)(.text+0x4fd): pdf.c: undefined reference to `_imp__HPDF_Page_SetLineCap@8' C:/Dev-Cpp/plplot-5.7.3/buildmingw/src/libplplotd.a(pdf.obj)(.text+0x561): pdf.c: undefined reference to `_imp__HPDF_Page_SetRGBStroke@16' C:/Dev-Cpp/plplot-5.7.3/buildmingw/src/libplplotd.a(pdf.obj)(.text+0x57c): pdf.c: undefined reference to `_imp__HPDF_Page_SetLineJoin@8' C:/Dev-Cpp/plplot-5.7.3/buildmingw/src/libplplotd.a(pdf.obj)(.text+0x59d): pdf.c: undefined reference to `_imp__HPDF_Page_MoveTo@12' C:/Dev-Cpp/plplot-5.7.3/buildmingw/src/libplplotd.a(pdf.obj)(.text+0x5be): pdf.c: undefined reference to `_imp__HPDF_Page_LineTo@12' C:/Dev-Cpp/plplot-5.7.3/buildmingw/src/libplplotd.a(pdf.obj)(.text+0x5d1): pdf.c: undefined reference to `_imp__HPDF_Page_Stroke@4' C:/Dev-Cpp/plplot-5.7.3/buildmingw/src/libplplotd.a(pdf.obj)(.text+0x636): pdf.c: undefined reference to `_imp__HPDF_SaveToStream@4' C:/Dev-Cpp/plplot-5.7.3/buildmingw/src/libplplotd.a(pdf.obj)(.text+0x648): pdf.c: undefined reference to `_imp__HPDF_GetStreamSize@4' C:/Dev-Cpp/plplot-5.7.3/buildmingw/src/libplplotd.a(pdf.obj)(.text+0x676): pdf.c: undefined reference to `_imp__HPDF_ResetStream@4' C:/Dev-Cpp/plplot-5.7.3/buildmingw/src/libplplotd.a(pdf.obj)(.text+0x6a6): pdf.c: undefined reference to `_imp__HPDF_ReadFromStream@12' C:/Dev-Cpp/plplot-5.7.3/buildmingw/src/libplplotd.a(pdf.obj)(.text+0x714): pdf.c: undefined reference to `_imp__HPDF_Free@4' C:/Dev-Cpp/plplot-5.7.3/buildmingw/src/libplplotd.a(pdf.obj)(.text+0x7a0): pdf.c: undefined reference to `_imp__HPDF_Page_SetLineWidth@8' C:/Dev-Cpp/plplot-5.7.3/buildmingw/src/libplplotd.a(pdf.obj)(.text+0x7bb): pdf.c: undefined reference to `_imp__HPDF_Page_SetLineCap@8' C:/Dev-Cpp/plplot-5.7.3/buildmingw/src/libplplotd.a(pdf.obj)(.text+0x7d6): pdf.c: undefined reference to `_imp__HPDF_Page_SetLineJoin@8' C:/Dev-Cpp/plplot-5.7.3/buildmingw/src/libplplotd.a(pdf.obj)(.text+0x83a): pdf.c: undefined reference to `_imp__HPDF_Page_SetRGBStroke@16' C:/Dev-Cpp/plplot-5.7.3/buildmingw/src/libplplotd.a(pdf.obj)(.text+0x89e): pdf.c: undefined reference to `_imp__HPDF_Page_SetRGBFill@16' C:/Dev-Cpp/plplot-5.7.3/buildmingw/src/libplplotd.a(pdf.obj)(.text+0x8c3): pdf.c: undefined reference to `_imp__HPDF_Page_MoveTo@12' C:/Dev-Cpp/plplot-5.7.3/buildmingw/src/libplplotd.a(pdf.obj)(.text+0x905): pdf.c: undefined reference to `_imp__HPDF_Page_LineTo@12' C:/Dev-Cpp/plplot-5.7.3/buildmingw/src/libplplotd.a(pdf.obj)(.text+0x926): pdf.c: undefined reference to `_imp__HPDF_Page_FillStroke@4' C:/Dev-Cpp/plplot-5.7.3/buildmingw/src/libplplotd.a(pdf.obj)(.text+0x93b): pdf.c: undefined reference to `_imp__HPDF_Page_Stroke@4' collect2: ld returned 1 exit status mingw32-make: *** [out.exe] Error 1 Execution terminated |
From: Alan W. I. <ir...@be...> - 2007-06-26 23:13:10
|
On 2007-06-26 23:52+0200 Simon Lundell wrote: > Hi all! > > I have been trying to get plplot with pdf support to compile on mingw for > quite some time now. The goal is to have a static lib that can plot and > output it in pdf. I have used postscript output before and it works > perfectly. > > I am getting undefined references to _imp__HPDF_methodname, see below. Am I > missing some lib that should be linked in? Is there some problem with name > decoration? > The steps i take to get this error: > 1. download and compile libharu-2.0.8 source package for mingw. (cygwin with > --nocygwin) > 2. configure plplot-5.7.3 using cmake-setup, set PLD_pdf to on and give the > library and include directories when asked. select to compile to static lib. > 3. compile plplot using mingw32-make.exe > > The same error as below also occurs when plrender.exe is linked. > > Any suggestions, hints or ideas are wery welcome! > > Best regards, > Simon > > > g++.exe main.o logprocessor.o -o "out.exe" -L"C:/Dev-Cpp/plplot-5.7.3/lib" > -L"C:/Dev-Cpp/plplot-5.7.3/buildmingw/bindings/c++" -L"C:/Dev-Cpp/plplot- > 5.7.3/buildmingw/src" -L"C:/Dev-Cpp/plplot-5.7.3/buildmingw/lib/csa" > -L"C:/Dev-Cpp/libharu-2.0.8" -llibboost_regex-mgw-mt-s-1_33_1 > -llibboost_filesystem-mgw-mt-s-1_33_1 -lplplotcxxd -lplplotd -lcsirocsa > -lgdi32 -lcomdlg32 -lhpdf > > C:/Dev-Cpp/plplot-5.7.3/buildmingw/src/libplplotd.a(pdf.obj)(.text+0x24e): > pdf.c: undefined reference to `_imp__HPDF_New@8' > C:/Dev-Cpp/plplot-5.7.3/buildmingw/src/libplplotd.a(pdf.obj)(.text+0x286): > pdf.c: undefined reference to `_imp__HPDF_Free@4' [...] > > mingw32-make: *** [out.exe] Error 1 > > Execution terminated > Disclaimer: I have no practical experience with the Cygwin platform. Nevertheless, I can make some general comments. HPDF_FREE, for example, is part of the libharu library, and it appears you are finding the headers for that library without problems for the compile stage, but not the library itself during the link stage. * Where is the location of that library on your system? Is the appropriate -L option -L"C:/Dev-Cpp/libharu-2.0.8 (taken from above) or is the library located in some sub-directory of that location? * Have you set up cmake to look for the static version of the library, and that library only occurs as the shared version? * LD_LIBRARY_PATH on Linux (and most Unix platforms) is required to find libraries at run time if they are installed in a non-standard location. So you are going to need that set properly for run-time. But I assume it doesn't have anything to do with your above link-time troubles. Hope these questions/comments help you to find the answer. Alan __________________________ Alan W. Irwin Astronomical research affiliation with Department of Physics and Astronomy, University of Victoria (astrowww.phys.uvic.ca). Programming affiliations with the FreeEOS equation-of-state implementation for stellar interiors (freeeos.sf.net); PLplot scientific plotting software package (plplot.org); the libLASi project (unifont.org/lasi); the Loads of Linux Links project (loll.sf.net); and the Linux Brochure Project (lbproject.sf.net). __________________________ Linux-powered Science __________________________ |
From: Werner S. <sm...@ia...> - 2007-06-27 06:16:08
|
Hi Simon, Simon Lundell wrote: > I am getting undefined references to _imp__HPDF_methodname, see below. > Am I missing some lib that should be linked in? Is there some problem > with name decoration? I think plplot awaits a shared pdf lib, while you compiled the static lib. You can see from the output of the compiler what functions it wants (the _imp_HPDF stuff). You can check with various tools what functions a library contains, e.g. with the mingw command "nm" or "impdef" - you'll see that these function names are not provided in the library. Reason is that in "cmake/modules/pdf.cmake" I added "-DHPDF_DLL" into the compiler options, since I assumed for the moment, that everybody is using the shared library. If you delete this from the cmake file, it should than compile. I haven't tested it, but this should be the solution. Regards, Werner -- Dipl. Ing. Werner Smekal Institut fuer Allgemeine Physik Technische Universitaet Wien Wiedner Hauptstr 8-10 A-1040 Wien Austria email: sm...@ia... web: http://www.iap.tuwien.ac.at/~smekal phone: +43-(0)1-58801-13463 (office) +43-(0)1-58801-13469 (laboratory) fax: +43-(0)1-58801-13499 |
From: Simon L. <s.l...@gm...> - 2007-06-27 09:40:41
|
Thanks. editing pdf.cmake seems to have solved that problem. I do get a few undef references to zlib when compiling plrender.exe. I can compile my program by linking it with zlib. I do get a few messages when running the program. I do not know if these are debug messages from the pdf driver or if they are error messages. //Simon plOpenFile: Opened C:\file.pdf plLibOpenPdfstr: Found file (null) the size of data is 47562 On 6/27/07, Werner Smekal <sm...@ia...> wrote: > > Hi Simon, > > Simon Lundell wrote: > > I am getting undefined references to _imp__HPDF_methodname, see below. > > Am I missing some lib that should be linked in? Is there some problem > > with name decoration? > I think plplot awaits a shared pdf lib, while you compiled the static > lib. You can see from the output of the compiler what functions it wants > (the _imp_HPDF stuff). You can check with various tools what functions a > library contains, e.g. with the mingw command "nm" or "impdef" - you'll > see that these function names are not provided in the library. > > Reason is that in "cmake/modules/pdf.cmake" I added "-DHPDF_DLL" into > the compiler options, since I assumed for the moment, that everybody is > using the shared library. If you delete this from the cmake file, it > should than compile. I haven't tested it, but this should be the solution. > > Regards, > Werner > > -- > Dipl. Ing. Werner Smekal > Institut fuer Allgemeine Physik > Technische Universitaet Wien > Wiedner Hauptstr 8-10 > A-1040 Wien > Austria > > email: sm...@ia... > web: http://www.iap.tuwien.ac.at/~smekal > phone: +43-(0)1-58801-13463 (office) > +43-(0)1-58801-13469 (laboratory) > fax: +43-(0)1-58801-13499 > > |
From: Werner S. <sm...@ia...> - 2007-06-27 10:39:21
|
Hi Simon, yes, the pdf lib needs the zlib, if it's shared it's no problem, you just need to provide the zlib.dll but since you compiled it static you than need also to compile the zlib in. Regarding the messages - these are internal message of plplot (I'm also always confused, but plLibOpenPdfstr has nothing to do with PDF :), and you should get rid of them, if you set in line 138 of drivers/pdf.c debug=0 and in line 136 verbose=0. Mind though, that the pdf driver is still beta, it's missing some features, especially the font handling might not be optimal. Regards, Werner Simon Lundell wrote: > Thanks. editing pdf.cmake seems to have solved that problem. I do get > a few undef references to zlib when compiling plrender.exe. I can > compile my program by linking it with zlib. > I do get a few messages when running the program. I do not know if > these are debug messages from the pdf driver or if they are error > messages. > //Simon > > plOpenFile: Opened C:\file.pdf > plLibOpenPdfstr: Found file (null) > the size of data is 47562 > -- Dipl. Ing. Werner Smekal Institut fuer Allgemeine Physik Technische Universitaet Wien Wiedner Hauptstr 8-10 A-1040 Wien Austria email: sm...@ia... web: http://www.iap.tuwien.ac.at/~smekal phone: +43-(0)1-58801-13463 (office) +43-(0)1-58801-13469 (laboratory) fax: +43-(0)1-58801-13499 |
From: Werner S. <sm...@ia...> - 2007-06-27 11:14:42
|
Hi Simon, at least for Linux and MacOSX there is the xttf driver which is based on cairo and therefore it can also export to pdf, svg and so on. But since it's complicated to make cairo run on Windows (and since the driver is based on xwindows), this driver will not be an option for Windows at the moment. But in case you also use Linux/MacOSX this might be another option. I intend to improve the pdf driver any time soon, if you want to invest some time in it, you're welcome to supply patches, but the font handling is quite complicated and in the moment I'm not quite sure how to do it (the best way). Regards, Werner Simon Lundell wrote: > Hi Werner! > > Thanks again. I changed verbose and debug as you said. I also had to > uncomment line 268 in the same file. I am not that satisfied with the > font rendering, the fonts are to bold, and does not appear that clean. > The x and y labels are much thinner and more readable. I understand > that this is beta code but it seems wery competent and promising! > > Best wishes, > Simon -- Dipl. Ing. Werner Smekal Institut fuer Allgemeine Physik Technische Universitaet Wien Wiedner Hauptstr 8-10 A-1040 Wien Austria email: sm...@ia... web: http://www.iap.tuwien.ac.at/~smekal phone: +43-(0)1-58801-13463 (office) +43-(0)1-58801-13469 (laboratory) fax: +43-(0)1-58801-13499 |