Author Topic: Eyecare in wxWidgets 2.8.3  (Read 13213 times)

parrimin

  • Guest
Eyecare in wxWidgets 2.8.3
« on: May 08, 2007, 08:15:28 am »
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 ===

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

  • Guest
Re: Eyecare in wxWidgets 2.8.3
« Reply #1 on: May 08, 2007, 08:21:32 am »
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

  • Guest
Re: Eyecare in wxWidgets 2.8.3
« Reply #2 on: May 08, 2007, 09:23:40 am »
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 ===

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

  • Guest
Re: Eyecare in wxWidgets 2.8.3
« Reply #3 on: May 08, 2007, 09:44:57 am »
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 ===

parrimin

  • Guest
Re: Eyecare in wxWidgets 2.8.3
« Reply #4 on: May 08, 2007, 11:30:47 am »
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

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.

Offline eckard_klotz

  • Almost regular
  • **
  • Posts: 194
Re: Eyecare in wxWidgets 2.8.3
« Reply #5 on: May 08, 2007, 01:21:12 pm »
Hello Parrimin.

I think you have to add the wx-librarys to the linker-settings of your project.

Try the following:
Open the project build options and sellect the linker-settings.
Here you can add precompiled libraries with add and then the ...-button.
Search the lib-directory in your wx-path where you find the *.a files.
First take them all and try it out. If it works try to skip those libs you don't need.

If your examples have project-files of DevC++ or MS Visual C++ it may be an alternative to import this project-files (file-menu) instead to create an own project.

I hope this helps.

By the way this works only if you have a compiled version of wxWidgets. It is not enough to download the sources only. Try the DevC++ installer/updater plugin to install a precompiled version from "http://devpaks.org/".

Regards,
             Eckard Klotz.

parrimin

  • Guest
Re: Eyecare in wxWidgets 2.8.3
« Reply #6 on: May 09, 2007, 12:47:29 pm »
Hey! Thanks for your reply.
I tried to add more libraries, but there aren´t no more libraries to add. There like 19 libraries added, like libwxmsw28u_richtext.a, libwxmsw28u_dbgrid.a, libwxbase28u_odbc.a, libwxmsw28u_xrc.a... libwxmsw28u_dbgrid i think is the library i need. Perhaps there is a problem with that library, but, i dont know how to solve it. My error message while compiling is:
Quote
:: === EyeCare, Release ===
ld.exe:: cannot find -lwxmsw28u_dbgrid
:: === Build finished: 1 errors, 0 warnings ===

Offline eckard_klotz

  • Almost regular
  • **
  • Posts: 194
Re: Eyecare in wxWidgets 2.8.3
« Reply #7 on: May 09, 2007, 01:30:39 pm »
Hello Parrimin.

Do you use the right search-directory for the linker. You can check it in the project build options.
Until now I still use "2.6.3" for my wxWidgets projects, so I can't say some thing about the grid-library of "2.8.3".
How did you get your "2.8.3"? Did you compiled it by your self or do you use a precompiled version?
Have you the same trouble with "2.6.3"?

Most of your libraries are called "libwxxxxxx_dbyyy.a" wich means they are debug-versions. Do you the same problem it in the normal release-mode where you have to use the libraries of the type "libwxxxxxx_yyy.a" (I think so).

Regards,
            Eckard Klotz.

parrimin

  • Guest
Re: Eyecare in wxWidgets 2.8.3
« Reply #8 on: May 09, 2007, 02:58:17 pm »
Hi eckard.

Surely i had a bad installation or something similar, but i can´t see what i did wrong.
I have installed wxWidgets 2.8.3 in D:\wxWidgets-2.8.3 directory.
If i go to search-directory in build options, it says
     Resource compiler ------> D:\wxWidgets-2.8.3\lib\gcc_lib\mswu
     Linker------------------> D:\wxWidgets-2.8.3\lib\gcc_lib
     Compiler----------------> D:\wxWidgets-2.8.3\lib\gcc_lib\mswu

How did i get 2.8.3? I can´t remember exactly, but i followed some tutorial on how to install mingw & wxwidgets. This manual explained how to compile my wxWidget. First i compiled like it said exactly, but after having problems to run wxWidgets apps, someone helped to me to recompile as a static library, build = release, monolithic = 0, unicode = 1. I think those were the compile options i think. Then i was able to create a simgle wxWidget window, and run properly.
After that I tried to compile the demos, creating projects like i said before, and i have problems with some of them...
The libraries added to my project are linked automatically, since the project has been created from a wizard, where i can select all the libraries i need. Seeing i had compiling problems, i added all the libraries, and now there is only one error.
The projects are compiling in release mode, and i think the libraries added are of release-mode type, as i compiled wxwidgets in release mode.
And, 2.6.3 running? Don´t tested, but i have to say that i have no problem drawing single windows with my 2.8.3, but before trying to make more complex things, i´m trying to solve this error, because i think i´ll find it another time
That is the summary

Offline eckard_klotz

  • Almost regular
  • **
  • Posts: 194
Re: Eyecare in wxWidgets 2.8.3
« Reply #9 on: May 09, 2007, 06:25:59 pm »
Hello Parimin

Another way to test, is to use a precompiled version of wxWidgets. Take a look at "http://devpaks.org/". Here you will find a lot of precompiled c/c++ libraries as so caled dev-paks. Originaly this file format was introduced for an other ide but C::B has a plugin to install this packeges too. Rename your "2.8.3" folder and try to install the devpack perhaps you have to change the search-directories.

By the way you wrote :
Quote
      Resource compiler ------> D:\wxWidgets-2.8.3\lib\gcc_lib\mswu
     Linker------------------> D:\wxWidgets-2.8.3\lib\gcc_lib
     Compiler----------------> D:\wxWidgets-2.8.3\lib\gcc_lib\mswu

Are you shure that the compiler-directory is realy "\wxWidgets-2.8.3\lib\gcc_lib\mswu" and not
"\wxWidgets-2.8.3\include\ xxx". In my wxWidget-version the include-header have their own directory. But on the other way if an include-directory is missing the compiler will give an other error.

Regards,
             Eckard Klotz.

Offline eckard_klotz

  • Almost regular
  • **
  • Posts: 194
Re: Eyecare in wxWidgets 2.8.3
« Reply #10 on: May 10, 2007, 05:43:19 am »
Hello Paramin.

I never used the decpak-plugin before yesterday evening. But after my last post I tried it out and had to learn that it could be dificult to download all current devpacks (for example wxWidegts 2.8.3). But that's no problem for you.

If you visit the site directly you can download every devpak you want manualy. To install a devpak you only have to change the file-attachment ".devpak" into ".tar.bz". Than you are able to unpack the archive with a programm like 7zip. So they wrote on the devpak-side.

I tried it out and it works (I mean the download and installation not the compilation-process). This has also the advantage that you can install alternative versions on your system. After that you can change the search-directories in your project to find out, if on version has an incorect library. Ok if you change between "2.8.3" and "2.6.3", I think this will work only for simple projects, but perhaps it is a chance to find the corse of your problem.


Regards,
            Eckard Klotz.

Offline eckard_klotz

  • Almost regular
  • **
  • Posts: 194
Re: Eyecare in wxWidgets 2.8.3
« Reply #11 on: May 10, 2007, 05:52:40 am »
Hello Paramin.

Sory one more mistake. You are not able to download "2.6.3" as devpak. It is "2.6.1" or an older version if you take the link on the right of the devpak-side (look under GUI).

Regards,
              Eckard Klotz.

parrimin

  • Guest
Re: Eyecare in wxWidgets 2.8.3
« Reply #12 on: May 10, 2007, 10:51:30 am »

Are you shure that the compiler-directory is realy "\wxWidgets-2.8.3\lib\gcc_lib\mswu" and not
"\wxWidgets-2.8.3\include\ xxx". In my wxWidget-version the include-header have their own directory. But on the other way if an include-directory is missing the compiler will give an other error.

I dont have no idea if that directory is the wxWidgets compiler directory, neither i cant understand how c::b have a new wxWidgets wizard after compiling manually wxwidgets with mingw... As you see, i have many doubts.

I have downloaded devpak, now i´m trying to use it. A plugin? Ok, i´ll search a howto of plugins... :P

And, very very thanks for your help. I´m very interested in having this running. Im so stubborn, that i need this to run, although i dont know if we´ll use for anything :)

parrimin

  • Guest
Re: Eyecare in wxWidgets 2.8.3
« Reply #13 on: May 10, 2007, 11:44:55 am »
Hmmm,
I think im a jinx... Im not able to run devpak.
I downloaded the devpak from where you said... OK
I click on plugins -> devpak installer/uninstaller, and there is an error.
So I thought all i need is the devpak. So i go to build options->search directories-> and... im trying to change the default directories i have, thats:
Quote
Resource compiler ------> D:\wxWidgets-2.8.3\lib\gcc_lib\mswu
     Linker------------------> D:\wxWidgets-2.8.3\lib\gcc_lib
     Compiler----------------> D:\wxWidgets-2.8.3\lib\gcc_lib\mswu
but, i dont have the same folders!.
I have been searching a few tutorials or forum posts, but i cant understand what i have to do.
Anybody knows?

I´ll open a new topic for installing devpak, thanks a lot!
« Last Edit: May 10, 2007, 12:08:30 pm by parrimin »

Offline eckard_klotz

  • Almost regular
  • **
  • Posts: 194
Re: Eyecare in wxWidgets 2.8.3
« Reply #14 on: May 10, 2007, 12:33:51 pm »
Hello Paramin.

As I learnd yesterday evening on the devpak-site devpak is a "tar.bz2-archive" wich means first the folder-system was put into a tar-archive and then this tar-file was compressed to a bz-archive. The plugin is a downloader-tool and is only able to extract those devpaks wich were downloaded by itself.

But you can extract the devpak with the tool 7-zip (www.7-zip.org). Rename the pevpak "xyz.devpak" into "xyz.tar.bz2" and open it with 7-zip. First you have to extract the bz2-archive. after that you can drag and drop the files and folders in the directory you want.

Take look to the text under the list of categories on the devpak-site.

Regards,
             Eckard Klotz.

parrimin

  • Guest
Re: Eyecare in wxWidgets 2.8.3
« Reply #15 on: May 10, 2007, 12:42:40 pm »
Hi eckard,
Yes i read, what they say, but im not able...
In this topic http://forums.codeblocks.org/index.php/topic,5875.0.html, i explain the problems i had. I opened i new topic, because the subject has changed, and more people could giver their suggestions

Thanks a lot echark

Offline eckard_klotz

  • Almost regular
  • **
  • Posts: 194
Re: Eyecare in wxWidgets 2.8.3
« Reply #16 on: May 11, 2007, 05:58:20 am »
Hello Paramin.

Yesterday evening I tried to change my wx-project to "2.8.3" (I still use an older version). And I have also some problems. But if I took a look to the C::B-forum I wonder if we are realy the only which have this problem.

Perhaps it is not a C::B-problem but a wxWidgets-problem. So this is the wrong place to discuss it.
Did you try to use the wx-forum?

At this moment I don't have the time to spend to much time with this problem because my current project (Moritz an freeware-strucogrammer as addon for doxygen) has a higher priority for me. And this program is a terminal-application and not a gui-programm.

Regards,
            Eckard Klotz.

parrimin

  • Guest
Re: Eyecare in wxWidgets 2.8.3
« Reply #17 on: May 11, 2007, 10:46:53 am »
Ok, I´ll try to post my questions there.

Good Luck eckard.