User forums > Using Code::Blocks

Eyecare in wxWidgets 2.8.3

(1/4) > >>

parrimin:
Hi guys,

I´ve been reading some wxWidgets tutorials, and after some troubles, i´m able to compile some simple window. Now i downloaded from http://www.codeproject.com/library/wxwidgets.asp , a sample code that says "eyecare". There is the source code, and a running executable. It has some useful utilities, like hiding the application in taskbar... I was trying to understand the code, and compiling it, but i came up into some difficulties:
The most of the errors of the code are that I need to convert all strings into wxT("String"), and some other like 'OnOK' : is not a member of 'wxDialog'. After all, i arrived to a moment that the code compiles... but when linking it says:


--- Quote ---:: === EyeCare, Release ===
obj\Release\EyeCareTaskBarIcon.o:EyeCareTaskBarIcon.cpp:(.text+0x2e):: undefined reference to `wxTaskBarIcon::wxTaskBarIcon()'
obj\Release\EyeCareTaskBarIcon.o:EyeCareTaskBarIcon.cpp:(.text+0x5e):: undefined reference to `wxTaskBarIcon::wxTaskBarIcon()'
obj\Release\EyeCareTaskBarIcon.o:EyeCareTaskBarIcon.cpp:(.text+0x93):: undefined reference to `wxTaskBarIcon::~wxTaskBarIcon()'
obj\Release\EyeCareTaskBarIcon.o:EyeCareTaskBarIcon.cpp:(.text+0xb3):: undefined reference to `wxTaskBarIcon::~wxTaskBarIcon()'
obj\Release\EyeCareTaskBarIcon.o:EyeCareTaskBarIcon.cpp:(.text+0xd4):: undefined reference to `wxTaskBarIcon::~wxTaskBarIcon()'
obj\Release\EyeCareTaskBarIcon.o:EyeCareTaskBarIcon.cpp:(.text+0xd31):: undefined reference to `wxEVT_TASKBAR_LEFT_DCLICK'
obj\Release\EyeCareTaskBarIcon.o:EyeCareTaskBarIcon.cpp:(.rdata$_ZTV19CEyeCareTaskBarIcon[vtable for CEyeCareTaskBarIcon]+0x8):: undefined reference to `wxTaskBarIcon::GetClassInfo() const'
obj\Release\EyeCareTaskBarIcon.o:EyeCareTaskBarIcon.cpp:(.rdata$_ZTV19CEyeCareTaskBarIcon[vtable for CEyeCareTaskBarIcon]+0x44):: undefined reference to `wxTaskBarIcon::SetIcon(wxIcon const&, wxString const&)'
obj\Release\EyeCareTaskBarIcon.o:EyeCareTaskBarIcon.cpp:(.rdata$_ZTV19CEyeCareTaskBarIcon[vtable for CEyeCareTaskBarIcon]+0x48):: undefined reference to `wxTaskBarIcon::RemoveIcon()'
obj\Release\EyeCareTaskBarIcon.o:EyeCareTaskBarIcon.cpp:(.rdata$_ZTV19CEyeCareTaskBarIcon[vtable for CEyeCareTaskBarIcon]+0x4c):: undefined reference to `wxTaskBarIcon::PopupMenu(wxMenu*)'
obj\Release\EyeCareTaskBarIcon.o:EyeCareTaskBarIcon.cpp:(.rdata+0x0):: undefined reference to `wxTaskBarIconBase::sm_eventTable'
:: === Build finished: 11 errors, 0 warnings ===

--- End quote ---

Anyone knows what´s happening. I´m new in codeblocks, and a beginner c++ programmer. I'd be greatful for an easy explanation.
Thanks.

parrimin:
Aps, I forgot to explain that, for make a project with the source code, i created, a eyecare project, and deleted the automatic files that the assistant creates for me. Then, i copied manually the files in the directory, and in codeblocks, in the eyecare project clicked on add files recursively. I couldnt find any other way to make a project from an existing source, am i doing the wrong way?

parrimin:
Hmmmm, no answer?  :? I guess all you are trying to compile the code 8).
I was trying to create the projects for every demo in the wxWidgets installation.
In 2 of 6, i have a similar problem when compiling. Specifically, dbbrowse demo , and forty demo.
In the last, the errors are:

--- Quote ---:: === forty, Release ===
obj\Release\forty.o:forty.cpp:(.text+0x545b):: undefined reference to `wxHtmlWindowMouseHelper::wxHtmlWindowMouseHelper(wxHtmlWindowInterface*)'
obj\Release\forty.o:forty.cpp:(.text+0x5466):: undefined reference to `vtable for wxHtmlWindow'
obj\Release\forty.o:forty.cpp:(.text+0x547c):: undefined reference to `vtable for wxHtmlWindow'
obj\Release\forty.o:forty.cpp:(.text+0x5487):: undefined reference to `vtable for wxHtmlWindow'
obj\Release\forty.o:forty.cpp:(.text+0x5498):: undefined reference to `vtable for wxHtmlWindow'
obj\Release\forty.o:forty.cpp:(.text+0x54eb):: undefined reference to `wxHtmlWindow::Init()'
obj\Release\forty.o:forty.cpp:(.text+0x5532):: undefined reference to `wxHtmlWindow::Create(wxWindow*, int, wxPoint const&, wxSize const&, long, wxString const&)'
obj\Release\forty.o:forty.cpp:(.text+0x5c85):: undefined reference to `vtable for wxHtmlWindowMouseHelper'
obj\Release\scoredg.o:scoredg.cpp:(.text+0x2da):: undefined reference to `wxGridNameStr'
obj\Release\scoredg.o:scoredg.cpp:(.text+0x34a):: undefined reference to `wxGrid::wxGrid(wxWindow*, int, wxPoint const&, wxSize const&, long, wxString const&)'
obj\Release\scoredg.o:scoredg.cpp:(.text+0x39b):: undefined reference to `wxGrid::CreateGrid(int, int, wxGrid::wxGridSelectionModes)'
obj\Release\scoredg.o:scoredg.cpp:(.text+0x45c):: undefined reference to `wxGrid::SetCellValue(int, int, wxString const&)'
obj\Release\scoredg.o:scoredg.cpp:(.text+0x4a2):: undefined reference to `wxGrid::SetCellValue(int, int, wxString const&)'
obj\Release\scoredg.o:scoredg.cpp:(.text+0x4e2):: undefined reference to `wxGrid::SetCellValue(int, int, wxString const&)'
obj\Release\scoredg.o:scoredg.cpp:(.text+0x522):: undefined reference to `wxGrid::SetCellValue(int, int, wxString const&)'
obj\Release\scoredg.o:scoredg.cpp:(.text+0x5a1):: undefined reference to `wxGrid::SetColLabelValue(int, wxString const&)'
obj\Release\scoredg.o:scoredg.cpp:(.text+0x60b):: undefined reference to `wxGrid::SetColLabelValue(int, wxString const&)'
obj\Release\scoredg.o:scoredg.cpp:(.text+0x678):: undefined reference to `wxGrid::SetColLabelValue(int, wxString const&)'
obj\Release\scoredg.o:scoredg.cpp:(.text+0x6e5):: undefined reference to `wxGrid::SetColLabelValue(int, wxString const&)'
obj\Release\scoredg.o:scoredg.cpp:(.text+0x71e):: undefined reference to `wxGrid::EnableEditing(bool)'
obj\Release\scoredg.o:scoredg.cpp:(.text+0x73b):: undefined reference to `wxGrid::SetOrCalcColumnSizes(bool, bool)'
obj\Release\scoredg.o:scoredg.cpp:(.text+0x752):: undefined reference to `wxGrid::SetOrCalcRowSizes(bool, bool)'
obj\Release\scoredg.o:scoredg.cpp:(.text+0x760):: undefined reference to `wxGrid::SetRowLabelSize(int)'
obj\Release\scoredg.o:scoredg.cpp:(.text+0x76e):: undefined reference to `wxGrid::EnableDragRowSize(bool)'
obj\Release\scoredg.o:scoredg.cpp:(.text+0x77c):: undefined reference to `wxGrid::EnableDragColSize(bool)'
obj\Release\scoredg.o:scoredg.cpp:(.text+0x78a):: undefined reference to `wxGrid::EnableDragGridSize(bool)'
obj\Release\scoredg.o:scoredg.cpp:(.text+0x792):: undefined reference to `wxGrid::ClearSelection()'
obj\Release\scoredg.o:scoredg.cpp:(.text+0x7a0):: undefined reference to `wxGrid::EnableEditing(bool)'
obj\Release\scoredg.o:scoredg.cpp:(.text+0x130a):: undefined reference to `wxGridNameStr'
obj\Release\scoredg.o:scoredg.cpp:(.text+0x137a):: undefined reference to `wxGrid::wxGrid(wxWindow*, int, wxPoint const&, wxSize const&, long, wxString const&)'
obj\Release\scoredg.o:scoredg.cpp:(.text+0x13cb):: undefined reference to `wxGrid::CreateGrid(int, int, wxGrid::wxGridSelectionModes)'
obj\Release\scoredg.o:scoredg.cpp:(.text+0x148c):: undefined reference to `wxGrid::SetCellValue(int, int, wxString const&)'
obj\Release\scoredg.o:scoredg.cpp:(.text+0x14d2):: undefined reference to `wxGrid::SetCellValue(int, int, wxString const&)'
obj\Release\scoredg.o:scoredg.cpp:(.text+0x1512):: undefined reference to `wxGrid::SetCellValue(int, int, wxString const&)'
obj\Release\scoredg.o:scoredg.cpp:(.text+0x1552):: undefined reference to `wxGrid::SetCellValue(int, int, wxString const&)'
obj\Release\scoredg.o:scoredg.cpp:(.text+0x15d1):: undefined reference to `wxGrid::SetColLabelValue(int, wxString const&)'
obj\Release\scoredg.o:scoredg.cpp:(.text+0x163b):: undefined reference to `wxGrid::SetColLabelValue(int, wxString const&)'
obj\Release\scoredg.o:scoredg.cpp:(.text+0x16a8):: undefined reference to `wxGrid::SetColLabelValue(int, wxString const&)'
obj\Release\scoredg.o:scoredg.cpp:(.text+0x1715):: undefined reference to `wxGrid::SetColLabelValue(int, wxString const&)'
obj\Release\scoredg.o:scoredg.cpp:(.text+0x174e):: undefined reference to `wxGrid::EnableEditing(bool)'
obj\Release\scoredg.o:scoredg.cpp:(.text+0x176b):: undefined reference to `wxGrid::SetOrCalcColumnSizes(bool, bool)'
obj\Release\scoredg.o:scoredg.cpp:(.text+0x1782):: undefined reference to `wxGrid::SetOrCalcRowSizes(bool, bool)'
obj\Release\scoredg.o:scoredg.cpp:(.text+0x1790):: undefined reference to `wxGrid::SetRowLabelSize(int)'
obj\Release\scoredg.o:scoredg.cpp:(.text+0x179e):: undefined reference to `wxGrid::EnableDragRowSize(bool)'
obj\Release\scoredg.o:scoredg.cpp:(.text+0x17ac):: undefined reference to `wxGrid::EnableDragColSize(bool)'
obj\Release\scoredg.o:scoredg.cpp:(.text+0x17ba):: undefined reference to `wxGrid::EnableDragGridSize(bool)'
obj\Release\scoredg.o:scoredg.cpp:(.text+0x17c2):: undefined reference to `wxGrid::ClearSelection()'
obj\Release\scoredg.o:scoredg.cpp:(.text+0x17d0):: undefined reference to `wxGrid::EnableEditing(bool)'
:: === Build finished: 48 errors, 0 warnings ===

--- End quote ---

As you can see, the errors are similar... but i can´t understand any other errors than that says error X in line Y of file Z,  :P

I´ll try to add all the libraries, but when seeing the errors log, not seems to be this the problem, dont you think?

parrimin:
Hey, in projects "forty" and "dbbrowse" from demos, now i only have 1 error! Come on, nobody had the same error anytime?
If you dont know any answer, please say hello at least, i feel lonely with no answer... :D
ah, for reduce the number of errors, when finishing the new wxWidget project wizard, i selected all the libraries available!

--- Code: ---:: === dbbrowse, Release ===
ld.exe:: cannot find -lwxmsw28u_dbgrid
:: === Build finished: 1 errors, 0 warnings ===

--- End code ---

parrimin:

--- Quote ---If I recall correctly, dbgrid is not compiled by default, un-check it and see if it works.
The other option is to compile it while building wxWidgets.

Tim S
--- End quote ---

Another day I had the same problem, and this was the answer i had in this forum. Ok, what´s dbgrid? I have this checked? You could know this isn´t a code typed for me, they are demos included in wxWidgets source.

Navigation

[0] Message Index

[#] Next page

Go to full version