Page 1 of 1

Problems when starting from the very beginning.

Posted: Mon Jun 18, 2012 5:25 pm
by Ken Andrews
This is going to be a bit wordy as I'm trying to give detailed information on the problems I'm running into and why I'm running into them.

I'm a totally new user, never used any C/C++ IDE before and therefore never used CodeLite before. The only source of "how to do things" is the tutorials and examples provided. The result is that any form of error during installation / testing is a serious one because I've got nothing prior to draw on.

Objectives: 1) Install CodeLite, MinGW, and wxWidgets. 2) Successfully build Hello World. 3) Successfully build a Hello World GUI equivalent or any simple GUI test.

Attempt A) I installed CodeLite, MinGW, and wxWidgets separately.

I had some problems getting them together, but I seemed to have success.

Hello World A) I used the website's Documentation / Setup and Settings / Simple Hello World.

It was successful.

GUI Hello World A) I used the website's Documentation / Video / General / Hello World.

The video goes too fast, but use of backup / pause solved that problem. Followed the steps up to clicking on the Red/Blue/Yellow "New wxWidgets Project" and ran into my first hard problem. No Red/Blue/Yellow icon to click on. Tried bringing up other toolbars, no luck. Looked around some, but as I wasn't sure what I was looking for, also no luck. Spent a while looking around, no success.

I finally decided that I'd messed up the installation. I uninstalled the three packages and started over.

Attempt B) Found the package codelite-2.6.0.4189-mingw4.4.1-wx2.8.10.exe and installed it. I can't remember now how I found that package which indicates that wherever the package is, better documentation is needed on how to get to it. Looking at the IDE after installation, I could see that I was going to have problems because the Red/Blue/Yellow icon still isn't there.

Hello World B) Again I used the website's Documentation / Setup and Settings / Simple Hello World.

It was successful.

GUI Hello World B) Again I used the website's Documentation / Video / General / Hello World.

I followed the steps up to clicking on the wxWidgets icon then started looking around again. Keep in mind that I've no experience whatsoever with this program so I have no idea where to go to find things; it takes time and lots of errors.

I checked lots of places (Plugins / Manage Plugins seemed like a good place; it wasn't) until I found it under Plugins / Gizmos. Why Gizmos? No idea. That had the "New wxWidgets Project Wizard". Close enough. And it turns out to be the right thing. Up came the window and I was able to continue on. Didn't look very much like the video, but close enough.

Expanded the final item as per the video (couldn't expand the other things that it showed; they weren't there) and found I had a "Hello World" piece of code that didn't look at all like the video. Exited, wiped the work directory, tried again. It took a couple of tries before I noticed that the wxWidgets popup didn't have the same settings as mine did. The video didn't show altering them, that's why I missed it. Mine had "Simple main with wxWidgets enabled" while the video had "GUI application with Main Frame". This time I had items under "include" and my myapp_frame.cpp file matched the video.

Clicked the buttons that the video showed (it would be nice if the video's creator had paused long enough on each button for the tooltip to appear) and up the program came. Success, to that point anyway.

Swapped the Header/Implementation files as per the video. Moved down and started typing as per the video. Got the popup while typing the word void. Put in "OnHelp(" and noticed that the video showed only the one "(" while mine did a completion "()". Continued typing in "wxCommandEvent" but didn't get the completion popup. I wondered if that was because of the following ")", so I erased from end of line back to "wx" and tried again. No success; I'm missing the completion popup for the wxWidgets. Completed the line as per the video.

Highlighted "OnHelp", then right-click / Code Generation/Refactoring / Add Function Implementation and then nothing. The video gets a popup called "Move Function Implementation Preview" but I get nothing.

So far I've not found how to get that window to pop up nor where the new bit's supposed to go.


First question: Where do I find a simple list of instructions that I can use to configure my IDE to match the configuration in the video? I haven't found such so far on the website. (Again, I know NOTHING about the various bits of the IDE, so I'm looking for the simplest possible, detailed instructions. It may well be that I've actually passed over the stuff I need simply because it assumes knowledge that I don't yet have and thus started too far into the sequence for me to recognize that it's what I'm after.)

Second question: As an alternative to a list of steps, is there a video of "these are the steps to get popups and autocompletion to work"?

Third question: Assuming that the video is out of date, given the visual differences between what it shows and what my IDE shows, is there a more recent video of "how to build a sample GUI program"?


The above is where I'm at from a stone-cold start. I hope I've explained my problem(s) clearly, and why those problems exist. Thank you for any help you can give.

Re: Problems when starting from the very beginning.

Posted: Mon Jun 18, 2012 6:10 pm
by eranif
In short:
Some of the documents on the side are not up to date (especially the video ones).

So, here is a very small tutorial, that if you will follow you should be able to create your first wxWidgets application (GUI based)

1) Cleanup your old installation:

Close codelite.
Uninstall codelite. Once the installer completes the 'uninstall' process, delete any user files from the file system, to do this, open Windows Explorer and type in the address bar the following:
%APPDATA%
Hit ENTER

Locate the folder named 'CodeLite' and delete or rename it

2) Install fresh new codelite using the bundled package which includes MinGW and wxWidgets
In particular use this package:
http://sourceforge.net/projects/codelit ... e/download

In addition, (optionally) you may want to install wxFormBuilder which you will need later from here:
http://sourceforge.net/projects/wxformb ... e/download

To make things easier, dont change any of the default values

3) Launch codelite and from the Menu bar, select: 'Workspace -> New Project'

4) In the Dialog that pops, select the 'GUI' category and then select the Template 'Executable (wxWidgets + wxFB frame)'
Give your project a name and path and click OK
IMPORTANT: Select PATH which DOES NOT CONTAIN ANY SPACES - MinGW does not like spaces in the folder paths

5) You should now have a new workspace, with one project. The file 'gui.cpp' is auto-generated file and should not be modified by hand.
You should add your code to main.cpp

6) Hit F7 to compile and then Ctrl-F5 to execute the program without debugging it. Or F5 to debug your program.

To modify the UI, double click on the file named 'gui.fbp' (the one with 3 cubes icon) - this will launch wxFormBuilder you can then edit the UI click 'save' and 'generate code'. Go to back to codelite, hit F7 (to build your changes)


Eran

Re: Problems when starting from the very beginning.

Posted: Mon Jun 18, 2012 6:30 pm
by eranif
I forgot to add:
To trigger code completion you need to use the keyboard combination Ctrl-SPACE

It will trigger automatically when typing '.' or '->'

Eran

Re: Problems when starting from the very beginning.

Posted: Mon Jun 18, 2012 10:39 pm
by Ken Andrews
Thank you for the response.

I uninstalled the prior versions of CodeLite, MinGW, and wxWidgets and the directories. I downloaded and installed the 5589 version and the wxWidgetsFormBuilder.

I started the program up, set up the new GUI project as per your instructions, then pressed F7. It built it, no problems. I then pressed Ctrl-F5. At that point I got:

"The program can't start because wxmsw294ud_gcc_custom.dll is missing from your computer. Try reinstalling the program to fix this problem."

I'll try a reinstall and see what happens. Failing that, I'll try reinstalling the earlier version and see if I can find that DLL.

Re: Problems when starting from the very beginning.

Posted: Mon Jun 18, 2012 11:48 pm
by eranif
Ken Andrews wrote:"The program can't start because wxmsw294ud_gcc_custom.dll is missing from your computer. Try reinstalling the program to fix this problem."
Did you modify your PATH environment variable from within codelite?
This DLL should exists under C:\wxWidgets-2.9.4\lib\gcc_dll

codelite should place it under your path automatically, unless you modified it, or modified the file C:\Program Files (x86)\CodeLite\registry.ini

Eran

Re: Problems when starting from the very beginning.

Posted: Tue Jun 19, 2012 12:36 am
by Ken Andrews
No, as per your instructions, no changes made.

However, when examining the Settings / Environment Variables, I found that the PATH was:

PATH=$(PATH);C:\Programs\OpenSource\MinGW\bin

I expanded it to:

PATH=$(PATH);C:\Programs\OpenSource\MinGW\bin;C:\Programs\OpenSource\wxWidgets\lib\gcc_dll

Subsequently, it ran. I then had to change the Project "Pause on exit" to stop the black window, but not a problem.

The right-click / Code Generation/Refactoring / Add Function Implementation still isn't working, though. I did figure out where to put the code in manually, so I can work around that. Or is that part of the double-clicking on the gui.fbp? I suppose I'll find out as I go along.

Re: Problems when starting from the very beginning.

Posted: Tue Jun 19, 2012 2:31 pm
by eranif
Ken Andrews wrote:However, when examining the Settings / Environment Variables, I found that the PATH was:

PATH=$(PATH);C:\Programs\OpenSource\MinGW\bin

I expanded it to:

PATH=$(PATH);C:\Programs\OpenSource\MinGW\bin;C:\Programs\OpenSource\wxWidgets\lib\gcc_dll
From your previous posts, I understand that you installed codelite-2.6.XXX - in this version I think codelite used to write its local settings
to the installation folder, so perhaps I should have mentioned that you should delete the folder C:\Program Files (x86)\CodeLite as well


Eran