Linker errors for wxPdfDocument

If you are using wxDev-C++ for your wxWidgets design, please ask your questions here instead of in IDE Related.
TimNew
In need of some credit
In need of some credit
Posts: 1
Joined: Fri May 13, 2016 12:39 pm

Linker errors for wxPdfDocument

Postby TimNew » Fri May 13, 2016 1:29 pm

Hi all I am trying to write an app that converts data retrieved from a DB to a PDF doc. I have installed wxDev-cpp and all looks ok. ie I can create and run a simple wxWidgets frame with a form + a few controls ant it builds and runs fine. I have downloaded and installed wxPdfDocument and it appears to be in all the right places. ie libwxpdfdoc.a is in the main lib dir and the header files are in
C:\Program Files\Dev-Cpp\include\3rdparty\wx.
I added the following code to a form :-

Code: Select all

////Header Include Start
////Header Include End
#include "wx/pdfdoc.h"
......
......
    wxPdfDocument pdf;
    pdf.AddPage();
    pdf.SetFont(_T("Arial"),_T("B"),16);
    pdf.Cell(40,10,_T("Hello World!"));
    pdf.SaveAsFile(_T("TimN wxPdf test.pdf"));


When I attempt to compile it comes back with the following error message :-

[Linker Error] undefined reference to'wxPdfDocument::wxPdfDocument( int, wxString const&, wxPaperSize)'
[Linker Error] undefined reference to'wxPdfDocument::AddPage(int)'
[Linker Error] undefined reference to'wxPdfDocument::SetFont(wxString const&, wxString const&, double )'
[Linker Error] undefined reference to'wxPdfLink::wxPdfLink(int)'
[Linker Error] undefined reference to'wxPdfDocument::Cell( double, double, wxString const&,int, int, int, int wxPdfLink const&)'
[Linker Error] undefined reference to'wxPdfLink::~wxPdfLink()'
[Linker Error] undefined reference to'wxPdfDocument::~wxPdfDocument( )'
Id returned 1 exit status
[Build Error] [ Output/MingW/sm000.exe] Error 1

I have included the pdf .h file path and the .a libray path in the Compiler directories search list and in the Project directories.
If I remove the code and just leave the #include "wx/pdfdoc.h" then the build works/runs ok.
So it would appear that the compler finds the headers ok but the linker cannot find the libwxpdfdoc.a file.
Any idea guys/gals ?
Last edited by doublemax on Fri May 13, 2016 1:37 pm, edited 1 time in total.
Reason: Added code tags

Return to “wxDev-C++”

Who is online

Users browsing this forum: Yahoo [Bot] and 1 guest