Trouble with wxReportWriter Topic is solved

Talk here about issues with one of the components hosted at wxCode, or suggest features for it.
Post Reply
jmason1182
Earned some good credits
Earned some good credits
Posts: 149
Joined: Fri Dec 14, 2007 3:40 pm
Location: Midland, TX
Contact:

Trouble with wxReportWriter

Post by jmason1182 »

I am still asking myself why wxReportWriter isn't a part of wxCode.... but anyway, it uses databaselayer so I figured this would be a place to start.

I am doing a UNICODE project and boy am I finding a lot of non-unicode ...er... code. So No big deal, just go through and change all constant strings to _("") or wxT("") strings. Time consuming, but no big deal. Then suddenly I wanted to build the demo. The generator and writer compile just fine into the libraries. Not a biggie at all.

But the demo adds the databaselayer aspect to it. While I have databaselayer compiled under a separate project (my full project will use sqlite3, mysql, or ODBC depending on the end user's wishes and needs) I can't get the demo to compile.

The reasons it won't compile are weird to. So.. here goes.

Errors:

Code: Select all

..\..\reportgen\include\wxReportWriter.h|25|error: `ULONG' does not name a type|
..\..\reportgen\include\wxReportWriter.h|26|error: `USHORT' does not name a type|
..\..\reportgen\include\wxReportWriter.h|28|error: `UWORD' does not name a type|
..\..\reportgen\include\wxReportWriter.h|29|error: `ULONG' does not name a type|
..\..\reportgen\include\wxReportWriter.h|30|error: `UDWORD' does not name a type|
..\..\reportgen\include\wxReportWriter.h|33|error: `SQLUSMALLINT' does not name a type|
..\..\reportgen\include\wxReportWriter.h|34|error: `SQLUSMALLINT' does not name a type|
..\..\reportgen\include\wxReportWriter.h|35|error: `SQLUSMALLINT' does not name a type|
..\..\reportgen\include\wxReportWriter.h|36|error: `SQLUSMALLINT' does not name a type|
..\..\reportgen\include\wxReportWriter.h|37|error: `SQLUSMALLINT' does not name a type|
..\..\reportgen\include\wxReportWriter.h|38|error: `SQLUINTEGER' does not name a type|
..\..\reportgen\include\wxReportWriter.h|152|error: `wxPoint' does not name a type|
..\..\reportgen\include\wxReportWriter.h|153|error: `wxSize' does not name a type|
..\..\reportgen\include\wxReportWriter.h|154|error: `wxSize' does not name a type|
..\..\reportgen\include\wxReportWriter.h|155|error: `wxPoint' does not name a type|
..\..\reportgen\include\wxReportWriter.h|203|error: ISO C++ forbids declaration of `wxPoint' with no type|
..\..\reportgen\include\wxReportWriter.h|203|error: expected `;' before '&' token|
..\..\reportgen\include\wxReportWriter.h|204|error: ISO C++ forbids declaration of `wxSize' with no type|
..\..\reportgen\include\wxReportWriter.h|204|error: expected `;' before '&' token|
..\..\reportgen\include\wxReportWriter.h|205|error: ISO C++ forbids declaration of `wxSize' with no type|
..\..\reportgen\include\wxReportWriter.h|205|error: expected `;' before '&' token|
..\..\reportgen\include\wxReportWriter.h|206|error: ISO C++ forbids declaration of `wxPoint' with no type|
..\..\reportgen\include\wxReportWriter.h|206|error: expected `;' before '&' token|
..\..\reportgen\include\wxReportWriter.h|216|error: ISO C++ forbids declaration of `wxPoint' with no type|
..\..\reportgen\include\wxReportWriter.h|216|error: expected `;' before '&' token|
..\..\reportgen\include\wxReportWriter.h|217|error: ISO C++ forbids declaration of `wxPoint' with no type|
..\..\reportgen\include\wxReportWriter.h|217|error: expected `;' before '&' token|
..\..\reportgen\include\wxReportWriter.h|221|error: `wxPoint' has not been declared|
..\..\reportgen\include\wxReportWriter.h|221|error: ISO C++ forbids declaration of `pt' with no type|
..\..\reportgen\include\wxReportWriter.h||In member function `void wxReportObj::SetCurrPos(int)':|
..\..\reportgen\include\wxReportWriter.h|221|error: `m_ptCurrPos' was not declared in this scope|
C:\dev\wxReportWriter\reportdemo\src\wxDbLayerHandler.cpp||In member function `virtual bool wxDbLayerHandler::GetSectionData(wxReportDataSection*, wxReportFiller*)':|
C:\dev\wxReportWriter\reportdemo\src\wxDbLayerHandler.cpp|44|error: conversion from `const char[7]' to `const wxString' is ambiguous|
C:\dev\wx\wxWidgets-2.8.10\include\wx\string.h|693|note: candidates are: wxString::wxString(wxChar, size_t) <near match>|
C:\dev\wx\wxWidgets-2.8.10\include\wx\string.h|682|note:                 wxString::wxString(int) <near match>|
C:\dev\wxReportWriter\reportdemo\src\wxDbLayerHandler.cpp|51|error: conversion from `const char[7]' to `const wxString' is ambiguous|
C:\dev\wx\wxWidgets-2.8.10\include\wx\string.h|693|note: candidates are: wxString::wxString(wxChar, size_t) <near match>|
C:\dev\wx\wxWidgets-2.8.10\include\wx\string.h|682|note:                 wxString::wxString(int) <near match>|
C:\dev\wxReportWriter\reportdemo\src\wxDbLayerHandler.cpp|60|error: conversion from `const char[7]' to `const wxString' is ambiguous|
C:\dev\wx\wxWidgets-2.8.10\include\wx\string.h|693|note: candidates are: wxString::wxString(wxChar, size_t) <near match>|
C:\dev\wx\wxWidgets-2.8.10\include\wx\string.h|682|note:                 wxString::wxString(int) <near match>|
C:\dev\wxReportWriter\reportdemo\src\wxDbLayerHandler.cpp|69|error: conversion from `const char[7]' to `const wxString' is ambiguous|
C:\dev\wx\wxWidgets-2.8.10\include\wx\string.h|693|note: candidates are: wxString::wxString(wxChar, size_t) <near match>|
C:\dev\wx\wxWidgets-2.8.10\include\wx\string.h|682|note:                 wxString::wxString(int) <near match>|
C:\dev\wxReportWriter\reportdemo\src\wxDbLayerHandler.cpp|78|error: conversion from `const char[7]' to `const wxString' is ambiguous|
C:\dev\wx\wxWidgets-2.8.10\include\wx\string.h|693|note: candidates are: wxString::wxString(wxChar, size_t) <near match>|
C:\dev\wx\wxWidgets-2.8.10\include\wx\string.h|682|note:                 wxString::wxString(int) <near match>|
C:\dev\wxReportWriter\reportdemo\src\wxDbLayerHandler.cpp|88|warning: cannot pass objects of non-POD type `const class wxCharBuffer' through `...'; call will abort at runtime|
C:\dev\wxReportWriter\reportdemo\src\wxDbLayerHandler.cpp|95|warning: cannot pass objects of non-POD type `const class wxCharBuffer' through `...'; call will abort at runtime|
C:\dev\wxReportWriter\reportdemo\src\wxDbLayerHandler.cpp|102|error: conversion from `const char[10]' to `const wxString' is ambiguous|
C:\dev\wx\wxWidgets-2.8.10\include\wx\string.h|693|note: candidates are: wxString::wxString(wxChar, size_t) <near match>|
C:\dev\wx\wxWidgets-2.8.10\include\wx\string.h|682|note:                 wxString::wxString(int) <near match>|
C:\dev\wxReportWriter\reportdemo\src\wxDbLayerHandler.cpp|102|error: no matching function for call to `wxReportFiller::FilterVariableString(const wxCharBuffer)'|
..\..\reportgen\include\wxReportFiller.h|145|note: candidates are: wxString wxReportFiller::FilterVariableString(wxString)|
C:\dev\wxReportWriter\reportdemo\src\wxDbLayerHandler.cpp|110|warning: cannot pass objects of non-POD type `const class wxCharBuffer' through `...'; call will abort at runtime|
C:\dev\wxReportWriter\reportdemo\src\wxDbLayerHandler.cpp|183|warning: cannot pass objects of non-POD type `const class wxCharBuffer' through `...'; call will abort at runtime|
C:\dev\wxReportWriter\reportdemo\src\wxDbLayerHandler.cpp|183|warning: cannot pass objects of non-POD type `const class wxCharBuffer' through `...'; call will abort at runtime|
C:\dev\wxReportWriter\reportdemo\src\wxDbLayerHandler.cpp|191|warning: cannot pass objects of non-POD type `const class wxCharBuffer' through `...'; call will abort at runtime|
C:\dev\wxReportWriter\reportdemo\src\wxDbLayerHandler.cpp|201|warning: cannot pass objects of non-POD type `const class wxCharBuffer' through `...'; call will abort at runtime|
C:\dev\wxReportWriter\reportdemo\src\wxDbLayerHandler.cpp|201|warning: cannot pass objects of non-POD type `const class wxCharBuffer' through `...'; call will abort at runtime|
C:\dev\wxReportWriter\reportdemo\src\wxDbLayerHandler.cpp|209|warning: cannot pass objects of non-POD type `const class wxCharBuffer' through `...'; call will abort at runtime|
C:\dev\wxReportWriter\reportdemo\src\wxDbLayerHandler.cpp||In member function `virtual bool wxDbLayerHandler::LoadSectionProperties(wxXmlNodeEx*, wxReportDataSection*)':|
C:\dev\wxReportWriter\reportdemo\src\wxDbLayerHandler.cpp|227|error: conversion from `const char[7]' to `const wxString' is ambiguous|
C:\dev\wx\wxWidgets-2.8.10\include\wx\string.h|693|note: candidates are: wxString::wxString(wxChar, size_t) <near match>|
C:\dev\wx\wxWidgets-2.8.10\include\wx\string.h|682|note:                 wxString::wxString(int) <near match>|
C:\dev\wxReportWriter\reportdemo\src\wxDbLayerHandler.cpp|229|error: conversion from `const char[7]' to `const wxString' is ambiguous|
C:\dev\wx\wxWidgets-2.8.10\include\wx\string.h|693|note: candidates are: wxString::wxString(wxChar, size_t) <near match>|
C:\dev\wx\wxWidgets-2.8.10\include\wx\string.h|682|note:                 wxString::wxString(int) <near match>|
C:\dev\wxReportWriter\reportdemo\src\wxDbLayerHandler.cpp|231|error: conversion from `const char[7]' to `const wxString' is ambiguous|
C:\dev\wx\wxWidgets-2.8.10\include\wx\string.h|693|note: candidates are: wxString::wxString(wxChar, size_t) <near match>|
C:\dev\wx\wxWidgets-2.8.10\include\wx\string.h|682|note:                 wxString::wxString(int) <near match>|
C:\dev\wxReportWriter\reportdemo\src\wxDbLayerHandler.cpp|234|error: conversion from `const char[5]' to `const wxString' is ambiguous|
C:\dev\wx\wxWidgets-2.8.10\include\wx\string.h|693|note: candidates are: wxString::wxString(wxChar, size_t) <near match>|
C:\dev\wx\wxWidgets-2.8.10\include\wx\string.h|682|note:                 wxString::wxString(int) <near match>|
C:\dev\wxReportWriter\reportdemo\src\wxDbLayerHandler.cpp|236|error: conversion from `const char[5]' to `const wxString' is ambiguous|
C:\dev\wx\wxWidgets-2.8.10\include\wx\string.h|693|note: candidates are: wxString::wxString(wxChar, size_t) <near match>|
C:\dev\wx\wxWidgets-2.8.10\include\wx\string.h|682|note:                 wxString::wxString(int) <near match>|
C:\dev\wxReportWriter\reportdemo\src\wxDbLayerHandler.cpp|238|error: conversion from `const char[9]' to `const wxString' is ambiguous|
C:\dev\wx\wxWidgets-2.8.10\include\wx\string.h|693|note: candidates are: wxString::wxString(wxChar, size_t) <near match>|
C:\dev\wx\wxWidgets-2.8.10\include\wx\string.h|682|note:                 wxString::wxString(int) <near match>|
C:\dev\wxReportWriter\reportdemo\src\wxDbLayerHandler.cpp|240|error: conversion from `const char[9]' to `const wxString' is ambiguous|
C:\dev\wx\wxWidgets-2.8.10\include\wx\string.h|693|note: candidates are: wxString::wxString(wxChar, size_t) <near match>|
C:\dev\wx\wxWidgets-2.8.10\include\wx\string.h|682|note:                 wxString::wxString(int) <near match>|
C:\dev\wxReportWriter\reportdemo\src\wxDbLayerHandler.cpp|247|error: conversion from `const char[10]' to `const wxString' is ambiguous|
C:\dev\wx\wxWidgets-2.8.10\include\wx\string.h|693|note: candidates are: wxString::wxString(wxChar, size_t) <near match>|
C:\dev\wx\wxWidgets-2.8.10\include\wx\string.h|682|note:                 wxString::wxString(int) <near match>|
C:\dev\wxReportWriter\reportdemo\src\wxDbLayerHandler.cpp|258|warning: cannot pass objects of non-POD type `const class wxCharBuffer' through `...'; call will abort at runtime|
||=== Build finished: 45 errors, 10 warnings ===|
||=== Build finished: 45 errors, 10 warnings ===|

I know that usually I have to include windows.h somewhere to get ULONG, USHORT, etc. but I can't figure out where to put it. Also, hasn't someone else built this unicode? (I'm doing static-build unicode, FYI) Surely someone has gotten this to work and I'm not the only doofus running into errors!?
John A. Mason
Midland, TX
jmason1182
Earned some good credits
Earned some good credits
Posts: 149
Joined: Fri Dec 14, 2007 3:40 pm
Location: Midland, TX
Contact:

Post by jmason1182 »

And wait a minute... doesn't wx.h contain all the includes etc. I need for ULONG etc? (including windows.h?)
John A. Mason
Midland, TX
jmason1182
Earned some good credits
Earned some good credits
Posts: 149
Joined: Fri Dec 14, 2007 3:40 pm
Location: Midland, TX
Contact:

Post by jmason1182 »

OK. So I go into wxReportWriter.h and change the following (in this order... very top of file.)

Code: Select all

...
#endif
//Added this line
#include <windows.h>
#include <wx/filename.h>
#include <wx/ffile.h>
#include <wx/datetime.h>
//And this line
#include <wx/gdicmn.h>
#ifdef __WXMSW__
typedef long SDWORD;
typedef short SWORD;
...
Then I had to also go in and change all the wxLogError statements that had a character stream (mb_str) to the c_str equivalent. I then check the libraries (rptvwr and rptgen) and they still work. But now I can go through the compile of the demo and it all works... up to the linking stage.

The version of wxReportWriter I've gotten ahold of says it was last modified by Scott Fant on 26th of July, 2005.

Now.... it looks like he used wxWidgets 2.6 at the time. I'm using 2.8.10. So naturally I've got some undefined references to a few things (I think they are now obsolete.)

SO... my next question... what to replace these with?

Code: Select all

mingw\rptdemoud\src\demo.o:demo.cpp:(.rdata$_ZTV7MyFrame[vtable for MyFrame]+0x44)||undefined reference to `wxEvtHandler::GetClassInfoW() const'|
mingw\rptdemoud\src\demo.o:demo.cpp:(.rdata$_ZTV5MyApp[vtable for MyApp]+0x44)||undefined reference to `wxApp::GetClassInfoW() const'|
mingw\rptdemoud\src\wxDbLayerHandler.o:wxDbLayerHandler.cpp:(.text+0x19d1)||undefined reference to `DatabaseErrorReporter::GetErrorMessage()'|
||=== Build finished: 3 errors, 0 warnings ===|
John A. Mason
Midland, TX
jmason1182
Earned some good credits
Earned some good credits
Posts: 149
Joined: Fri Dec 14, 2007 3:40 pm
Location: Midland, TX
Contact:

Post by jmason1182 »

In demo.cpp, right after including wxReportFiller.h I had to include #include "wx/msw/winundef.h". Duh! I added windows.h to wxReportWriter which is included by wxReportFiller.... so that means I have to undefine the windows.h stuff that will mess with wxWidgets.

Viola. Now I have one more linker error to deal with.... this is definitely a wxCode question.... the new databaselayer source apparently doesn't have DatabaseErrorReporter::GetErrorMessage because that linker error is still there.

Any ideas?
John A. Mason
Midland, TX
jmason1182
Earned some good credits
Earned some good credits
Posts: 149
Joined: Fri Dec 14, 2007 3:40 pm
Location: Midland, TX
Contact:

Post by jmason1182 »

So I thought to myself... linker issue... maybe I'm not linking with the database layer library?

Sure enough, I corrected the databaselayer library path and added the library (databaselayer_odbc) to the linker stage and it worked.

Thanks for your help (myself?).
John A. Mason
Midland, TX
Post Reply