Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: DaveK on July 19, 2006, 03:10:45 am

Title: New to Code Blocks
Post by: DaveK on July 19, 2006, 03:10:45 am
Funny I would have thought a search for my question would have brought up a few results but I must one of the few people who doesn't have a clue. I need assistance with coding in Code::Blocks. That is if there is a book, online tutorials, or anything that can walk me through a few of the nuances of Code::Blocks. For instance, how to create an MDI, SDI, Graphics, dialog boxes, window views such as form view, dialog views, scroll views, etc.,

Thanks!
Title: Re: New to Code Blocks
Post by: sethjackson on July 19, 2006, 03:15:22 am
Funny I would have thought a search for my question would have brought up a few results but I must one of the few people who doesn't have a clue. I need assistance with coding in Code::Blocks. That is if there is a book, online tutorials, or anything that can walk me through a few of the nuances of Code::Blocks. For instance, how to create an MDI, SDI, Graphics, dialog boxes, window views such as form view, dialog views, scroll views, etc.,

Thanks!

Ok you need coding tutorials or..... If you want to make GUI programs that are cross-platform just use some GUI toolkit (pick your poison). However if you only code for Windows just use the Windows API. I'm really not sure what you need/are asking?????
Title: Re: New to Code Blocks
Post by: kidmosey on July 19, 2006, 03:44:54 am
I suggest reading some windows api and programming tutorials.  I make frequent trips to the MSDN library while coding straight win32.  In addition, you can find some makefile tutorials to get an idea of how targets and such work.

If you just want to create simple windows and dialog interfaces, wxWidgets is relatively easy to learn, but hides much of the internals from you, so using it for anything beyond wx is not too easy.

But it really all depends on the extent of your present knowledge and what you are wanting to develop.  You might consider creating a new project and/or design specs and working from there.  You can develop more detailed and specific questions that way instead of the general "how do I program?".  This will help you both in posting to forums and in search engines.
Title: Re: New to Code Blocks
Post by: DaveK on July 19, 2006, 12:46:20 pm
I believe the confusing question stems from the fact I misinterpreted Code::Blocks. I thought it was a Development Studio with its own framework which created cross-platform applications in C++ when actually it's just the Development Studio which supports other frameworks. I come from a .NET framework programming background and have zero experience in coding in pure Ansi C++ for Cross platform support. I have thinking Code::Blocks was like the cross-platform solution like Visual Studio is for Window applications. When I asked about a book, that was what I was asking about. My fault for misinterpreting this application. [;)]

So I'm still back to square one, however wxWidgets proves interesting. The application I plan to create is mostly a database application. With VC++ I used ADO to access a JET database. Not sure if wxWidgets will help on this. I think for me it's a question of figuring out how to code in C++ without .NET. But the nice thing about .NET was that it had many routines that performed complex tasks for you. The problem with .NET is that most of the routines worked in Windows only. I want to move away from that and create cross-platform applications. My requirements are database access, window based application containing menus, toolbars, dialog bars, wizards, etc.
Title: Re: New to Code Blocks
Post by: sethjackson on July 19, 2006, 01:44:17 pm
...

My requirements are database access, window based application containing menus, toolbars, dialog bars, wizards, etc.

wxWidgets can do all of this out of the box. However for database access you will need to get one of the addon classes. From wxCode (http://wxcode.sourceforge.net/).
Title: Re: New to Code Blocks
Post by: takeshimiya on July 20, 2006, 12:03:25 am
I have thinking Code::Blocks was like the cross-platform solution like Visual Studio is for Window applications. When I asked about a book, that was what I was asking about. My fault for misinterpreting this application. [;)]
In that sense you was right. C::B with wxSmith can be thought as a kind of Visual Studio.

...

My requirements are database access, window based application containing menus, toolbars, dialog bars, wizards, etc.

wxWidgets can do all of this out of the box. However for database access you will need to get one of the addon classes. From wxCode (http://wxcode.sourceforge.net/).

Right, you can do all of that with wxWidgets.
If one wants to do GUI programming with wxWidgets, C::B includes the plugin called wxSmith which will help you to create visually forms, dialogs, etc.
To learn programming with wxWidgets, I recommend the official book.
You can download it from here: http://www.phptr.com/content/images/0131473816/downloads/0131473816_book.pdf

That book, along with wxWidgets, wxSmith, the wxWidgets reference manual, and Code::Blocks, will get you going with all the development you wanted to do, and in a cross-platform way.
Title: Re: New to Code Blocks
Post by: iw2nhl on July 20, 2006, 01:03:13 am
Another great cross-platform C++ toolkit is Qt.
It works on Windows (95 to Vista), Linux, Unix, Mac OS X and some PDA.
It has 2 licenses:
- for closed source development (you must buy a license)
- for open source development (free of charge, GPL license)
Moreover it has 3 tools (among others) included:
- "Qt Designer" to draw your GUI graphically
- "Qt Linguist" to make your program multilanguage in an easy way
- "Qt Assistant" help system used by Qt and available for your programs too

Toolkit overview (Qt4):
http://www.trolltech.com/products/qt/features
http://www.trolltech.com/products/qt/whatsnew
http://www.trolltech.com/products/qt/learnmore

Documentation (for all versions):
http://doc.trolltech.com/

Qt 4.1 documentation:
http://doc.trolltech.com/4.1/index.html
http://doc.trolltech.com/4.1/overviews.html

It supports a lot of database systems:
http://doc.trolltech.com/4.1/sql-driver.html

Next 4.2 version (it should be available for year ending):
http://doc.trolltech.com/4.2/qt4-2-intro.html

Interesting articles on Qt programming:
http://doc.trolltech.com/qq/index.html

Community site (with forum for help):
http://www.qtcentre.org/

You can find in internet a lot of examples (all KDE programs are written with Qt) and some tutorials.
There are printed books too.

KDE and KDE applications:
http://www.kde.org/
http://www.kde-apps.org/

Tutorials for Qt3 and Qt4 respectively:
http://www.digitalfanatics.org/projects/qt_tutorial/
http://qt4.digitalfanatics.org/tiqt/
Title: Re: New to Code Blocks
Post by: agent007se on July 20, 2006, 05:44:18 am
I really don't know a lot of wxWidgets so I can't speak about.

But really '+1' for Qt suggestions. It's a really really nice Toolkit and, moreover, it's extremely well documented :D (I fall in love of their docs :p).
Title: Re: New to Code Blocks
Post by: takeshimiya on July 20, 2006, 01:52:39 pm
Probably the only two cross-platform toolkits well supported, mature, and with a big community are wxWidgets and QT.

Following the list of iw2nhl I'll give a list to start learning wxWidgets.

* The major advantage wxWidgets haves over QT is native widgets. QT haves to use in some platforms, the so called "styles" (for example, in the next 4.2 ver. it'll feature a theme simmilar to GTK's Clearlooks), but wxWidgets already haves native widgets in almost all platforms, that means in the GTK's case that it uses the own GTK widgets and rendering calls, so it's absolutely the same as a native GTK application.
The same accounts for Windows (it uses Win32, and the programs looks the same as MFC programs), in Mac, Carbon and Cocoa, in Linux, GTK, Motif and direct X11 also. That's not the case with any other existant toolkit right now.
* And the major advantage of QT over wxWidgets is perhaps that QT 4.x (not previous versions) haves a more advanced C++ API, altrough that haves disvantages, like making more difficult to get things working on other compilers, and more importantly, it's more difficult to make bindings to other languages. wxWidgets 3.x will feature an up-to-date C++ API nonetheless.

wxWidgets currently haves bindings in the following languages: C++ (not a binding), Python, Ruby, Perl, Basic, Smalltalk, Java, JavaScript, Haskell, Eiffel, C#.NET, Lisp, Lua, among others.

It works on Windows (3.1 to Vista, including Windows CE), Linux, Unix, DOS, Mac OS 9/X, OpenVMS, OS/2, and some PDA.
It has 1 license:
- for closed source development (free of charge, LGPL-alike license, very permissive)
- for open source development (free of charge, LGPL-alike license, very permissive)
Moreover it has a lot of tools (among others) including:
- "DialogBlocks" to draw your GUI graphically
- "wxSmith" to draw your GUI graphically (included in Code::Blocks)
- "poEdit" to make your program multilanguage in an easy way
- "HTB" a help system used by wxWidgets and available for your programs too

Toolkit overview:
http://wxwidgets.org/about/feature2.htm
http://wxwidgets.org/
http://wxwidgets.org/about/

Documentation:
http://wxwidgets.org/docs/

It supports a lot of database systems:
http://www.wxwidgets.org/wiki/index.php/ODBC

Next 3.x version:
http://www.wxwidgets.org/wiki/index.php/WxWidgets3

Interesting articles on wxWidgets programming:
http://wxwidgets.org/docs/tutorials.htm
http://wxwidgets.org/about/reviews2.htm

Community site:
http://www.wxcommunity.com/

Forum site (for help):
http://wxforum.shadonet.com/

You can find in internet a lot of examples and some tutorials.
Recently, the official book has been published, you can buy a printed copy from here:
http://wxwidgets.org/docs/book/

Also, it has been made available as a free PDF download from here: http://www.phptr.com/content/images/0131473816/downloads/0131473816_book.pdf

wxWidgets applications:
http://wxwidgets.org/about/users.htm
http://www.wxcommunity.com/modules.php?op=modload&name=Downloads&file=index&req=viewdownload&cid=5

wxWidgets compared to other toolkits:
http://www.wxwidgets.org/wiki/index.php/WxWidgets_Compared_To_Other_Toolkits
Title: Re: New to Code Blocks
Post by: iw2nhl on July 20, 2006, 08:25:14 pm
Ok, Takeshi Miya, but mine was not a Qt vs. wxWidgets comparison, I only presented a little overview of Qt!
If you want a true comparison, give also a description of the faults of wxWidgets.

First of all, native widgets: is this really a problem?
1) they are NOT slow (they use native drawing primitives) and are exactly like the native ones
2) Microsoft for some of his programs (most important ones) does NOT use native widgets: MS Office used 13 different widget implementations between the various releases, and they are still present in recent releases, some dialogs use one, some use others); Internet Explorer too does not uses native widgets to draw web pages.
3) under Windows XP and Mac OS X native widgets are used (most of people use theese OS)
4) under KDE (Linux, BSD and Unix) Qt IS the native widget
5) under PDA wich support Qt, it IS the native widget
6) under Windows 9x/2000 it draws (using native, hardware accelerated drawing functions) widgets that are visually identical to native ones
Speaking of wxWidgets:
1) Windows 3.1 is no more supported (means: code has been removed)
2) not all widgets are native under wxWidgets too (see: http://www.wxwindows.org/manuals/2.6.3/wx_wxrenderernative.html#wxrenderernative)
3) there is no "style" for KDE (while this is not true for Qt under GNOME)

I don't know wxWidgets very well, but I read this (probably this is a reductive list):
- very simple painting system (see here for a very-short description of the powerful Qt painting system, with anti-aliasing, gradients, double-buffering, styles and others: http://doc.trolltech.com/4.2/paintsystem.html)
- documentation is very far from the Qt one
- Qt is all pure C++ programming (if you like full OOP), while in wxWidgets you have a lot of macros and this makes programming less natural to a C++ developer
- Qt supports different programming style (loops and iterators): C++, STL, Java-like
- Qt (human) support from Trolltech is excellent (this is important for large projects)
- with Qt/Embedded you can use a Qt program without anything else than QT/Embedded itself! It includes the OS (Linux based) and a graphic system: nothing more (no X server) is required, so CPU and RAM are free for your application. Now (Qt4) it has become Qtopia (http://www.trolltech.com/products/qtopia/qtopia_platform)
- at a first sight, wxWidgets has much less classes, both GUI and not-GUI related than Qt (means less developer time with Qt: less code and use of well-tested classes)
- also Qt has bindings (althought less than wxWidgets), most used ones are Python (PyQt), C# (Qt#) and Ruby (QtRuby), others are Tcl (Froglogic Tq), Java, Perl, and Smoke; in the past there was also C but it is no more mantained
- there are also transition tools for MFC, Motif, Tcl/Tk and others
- Qt supports also his own scripting language with Qt Script for Applications (QSA: http://www.trolltech.com/products/qt/addon/qsa)

Like anything else, Qt is not perfect and has its drawbacks, anyway remains among the best C++ toolkits available today (and is continously evolving).
The main drawback is that it requires more RAM and CPU power than native applications, but it is well payed by the easy of developing, the features it offers and the easy of portability.

For a list of supported platforms and compilers:
http://www.trolltech.com/developer/notes/supported_platforms

Obviously I'm not an expert of both Qt and wxWidgets: if there are mistakes, please let me now!

Best regards,
Alessandro
Title: Re: New to Code Blocks
Post by: takeshimiya on July 21, 2006, 01:54:23 am
Ok, Takeshi Miya, but mine was not a Qt vs. wxWidgets comparison, I only presented a little overview of Qt!

It was not a comparison, the intention is to give helpful links as you gave, for people like DaveK who is wanting to get out of .NET.
In that sense, as I've said, I think the two cross-platform toolkits well supported, mature, and with a big community are wxWidgets and QT.
So with the info from both, he can test and learn both of them.

Quote
6) under Windows 9x/2000 it draws (using native, hardware accelerated drawing functions) widgets that are visually identical to native ones
This is the biggest thing I don't like about QT, I use Windows, and I use a theme that is not Luna, and believe me, "visually identical to native" is far away from "native", and to say the least, it does not feels good. :P

Quote
Obviously I'm not an expert of both Qt and wxWidgets: if there are mistakes, please let me now!
No, no mistakes. We're here just to provide information to anyone who is wanting to start to learn cross-platform programming. :)
Title: Re: New to Code Blocks
Post by: iw2nhl on July 21, 2006, 04:37:13 pm
Quote
6) under Windows 9x/2000 it draws (using native, hardware accelerated drawing functions) widgets that are visually identical to native ones
This is the biggest thing I don't like about QT, I use Windows, and I use a theme that is not Luna, and believe me, "visually identical to native" is far away from "native", and to say the least, it does not feels good. :P
I use Windows 2000 and it is almost indistinguishable, I don't know on Windows XP not using Luna theme, but I read it should support XP theming. Now I know it does not :-(

Anyway no war at all! I think wxWidgets is good too. Surely there will be people who like Qt, people who like wxWidgets... and people who hate both  :)
Title: Re: New to Code Blocks
Post by: DaveK on July 21, 2006, 09:44:20 pm
Wow thank you everyone for the list of replies. I will definitely look into downloading wxSmith and I will try and get Code::Blocks to work with wxWidgets. Is there a good walkthrough online that helps me setup wxWidgets with Code::Blocks?

Thanks!

I have one walkthrough that had a VC++ and a MinGW32 which I really don't know what that is. Perhaps I'm just not putting two and two together.

Title: Re: New to Code Blocks
Post by: sethjackson on July 21, 2006, 10:35:09 pm
Wow thank you everyone for the list of replies. I will definitely look into downloading wxSmith and I will try and get Code::Blocks to work with wxWidgets. Is there a good walkthrough online that helps me setup wxWidgets with Code::Blocks?

Thanks!

I have one walkthrough that had a VC++ and a MinGW32 which I really don't know what that is. Perhaps I'm just not putting two and two together.



http://wiki.codeblocks.org/index.php?title=Compiling_wxWidgets_2.6.2_to_develop_Code::Blocks_%28MSW%29
Title: Re: New to Code Blocks
Post by: DaveK on July 22, 2006, 04:05:38 am
Cool! Well I downloaded all the files they mentioned and compiled what they said to compile. The compile went through so I created a new wxWidget project. I was getting wx/setup.h file not found. I tried adding the directory to the Project Settings but that didn't work so I just copied the setup.h file to where I believed the compile was trying to find it. I got past that error but now get this error

D:\CodeBlocks\wx263\include\wx\buffer.h line 96 error: 'strdup undeclared (first use this function)

I'm kinda at a loss here. I don't think I really should have had to move setup.h to begin with. Not sure why even adding the right directory didn't get that file recognized but now code in wxWidget files is coming back with error makes me think I may have forgotten a step.

Anyone else run into similar problems that could help?

i'm sorry if this has already been covered a ton of times. If so, thanks for a forwarding link anyways. :)



Title: Re: New to Code Blocks
Post by: Seronis on July 22, 2006, 07:29:54 am
Are you using the RC2 build or a nightly build or SVN ?   You get the most stable response if you are using something that has been released SINCE RC2.
Title: Re: New to Code Blocks
Post by: DaveK on July 22, 2006, 12:41:07 pm
version 1.0rc2 is the version I have.
Title: Re: New to Code Blocks
Post by: DaveK on July 22, 2006, 04:05:22 pm
this gets worse. I can't even compile the sample programs found in the wx/samples directory. For example I try to compile Calendar and I get wxStatusBarBeneric has not been declared. I try to compile access and it gets to linking but it gives me a few (well a lot) of undefined references. Here is the first undefined line

vc_mswunivudll\base\src\common\filename.o:filename.cpp:(.text+0x180e): undefined reference to 'CoCreateInstance@20'
vc_mswunivudll\base\src\common\filename.o:filename.cpp:(.text+0x1830): undefined reference to 'IID_IPersistFile'
vc_mswunivudll\base\src\common\regex.o:regex.cpp:(.text+0x84): undefined reference to 'wx_regfree'

I apologize if the solution for this is extremely simple or I forgot to perform some task, however I believe I followed the instructions to installing mingw32 and for compiling wxWidgets. That is I followed that tutorial linked above. Do these error mean I haven't fully compiled wxWidgets or forgot a step? Should I perhaps recompile? The version of wxWidgets I downloaded was a stable version so I'm a bit skeptical that wxWidgets is faulty.

Thanks for any help!  :o
Title: Re: New to Code Blocks
Post by: Ceniza on July 22, 2006, 08:33:17 pm
Please remove RC2 and install a nightly build first :)

BTW, are you trying to link a version of wxWidgets compiled with MSVC using MinGW?

vc_mswunivudll <-- look suspicious.... VC and Univ...
Title: Re: New to Code Blocks
Post by: Pecan on July 22, 2006, 08:34:54 pm
this gets worse. I can't even compile the sample programs found in the wx/samples directory. For example I try to compile Calendar and I get wxStatusBarBeneric has not been declared. I try to compile access and it gets to linking but it gives me a few (well a lot) of undefined references. Here is the first undefined line

vc_mswunivudll\base\src\common\filename.o:filename.cpp:(.text+0x180e): undefined reference to 'CoCreateInstance@20'
vc_mswunivudll\base\src\common\filename.o:filename.cpp:(.text+0x1830): undefined reference to 'IID_IPersistFile'
vc_mswunivudll\base\src\common\regex.o:regex.cpp:(.text+0x84): undefined reference to 'wx_regfree'

I apologize if the solution for this is extremely simple or I forgot to perform some task, however I believe I followed the instructions to installing mingw32 and for compiling wxWidgets. That is I followed that tutorial linked above. Do these error mean I haven't fully compiled wxWidgets or forgot a step? Should I perhaps recompile? The version of wxWidgets I downloaded was a stable version so I'm a bit skeptical that wxWidgets is faulty.

Thanks for any help!  :o
CoCreateInstance is in a minGW libole32.a, so include ole32 in build options; linker; link libraries.

IPersistFile is in libuuid in minGW, so include uuid in build options; linker; link libraries.

wx_regfree in is the widgets /lib either in the libwxmsw26u (if you use unicode monolithic) or libwxregexu for (unicode non-monolithic) Its' name will be without  the 'u' if you made an ansi widgets.



EDIT: Ceniza posted before me. You guys need to give me a turn  :D
  Oh well.. guess I shouldn't leave that slug trail...
Title: Re: New to Code Blocks
Post by: DaveK on July 23, 2006, 12:33:20 am
Please remove RC2 and install a nightly build first :)

BTW, are you trying to link a version of wxWidgets compiled with MSVC using MinGW?

vc_mswunivudll <-- look suspicious.... VC and Univ...

Actually, I recompiled wxWidgets using mingw32-make. I ran a clean first then I recompiled. Was this a bad move? Should I remove wxWidgets complete. Redownload and then recompile?

I will try removing rc2 installing the night build then installing the stable build if that is what you mean to do.

Thanks!  :)
Title: Re: New to Code Blocks
Post by: Ceniza on July 23, 2006, 12:57:58 am
Just be sure to follow the steps to compile it just like the wiki suggests. A clean followed by a recompile should be OK.

Quote from: DaveK
I will try removing rc2 installing the night build then installing the stable build if that is what you mean to do.

Stable build? Just remove RC2 and install a nightly build :)
Title: Re: New to Code Blocks
Post by: DaveK on July 23, 2006, 02:05:27 pm
Well I did read the nightly build page on how to install this thing but perhaps I had a few expectations that I didn't see right off. One of them was since I was asked to remove RC2 I was looking for an install program. Can't find it. All I see is an image, lexers, plugins, scripts directory, which only was contained in a share/CodeBlocks directory that matches the share directory in my old install. Thinking all I do is replace the old share directory with this one, that is exactly what I did. The nightly build how to page was very cryptic for me. It kept referring to an install file and codeblocks.exe, but none of that came with the nightly build so I just used my old build. However something tells me this isn't what you had in mind. I start up Codeblocks and immediately get error message after error message and now I don't have a toolbar and most of the menu options will not work. I can't even get import to work to import a sample wxWidget program.

I apologize for being slow on this. Look at it from my point of view. I've been trying to get CodeBlocks working now for almost a week and I am probably just as frustrated as those here who are wondering what is taking me so long. ;)
Title: Re: New to Code Blocks
Post by: sethjackson on July 23, 2006, 02:28:24 pm
Well I did read the nightly build page on how to install this thing but perhaps I had a few expectations that I didn't see right off. One of them was since I was asked to remove RC2 I was looking for an install program. Can't find it. All I see is an image, lexers, plugins, scripts directory, which only was contained in a share/CodeBlocks directory that matches the share directory in my old install. Thinking all I do is replace the old share directory with this one, that is exactly what I did. The nightly build how to page was very cryptic for me. It kept referring to an install file and codeblocks.exe, but none of that came with the nightly build so I just used my old build. However something tells me this isn't what you had in mind. I start up Codeblocks and immediately get error message after error message and now I don't have a toolbar and most of the menu options will not work. I can't even get import to work to import a sample wxWidget program.

I apologize for being slow on this. Look at it from my point of view. I've been trying to get CodeBlocks working now for almost a week and I am probably just as frustrated as those here who are wondering what is taking me so long. ;)

You can't replace the old share directory with the new one that will never work.

Just uninstall RC2, download 7-zip (http://7-zip.org/), get the dlls, and the Code::Blocks build from the nightly build posts. Then extract everything, and place the dlls inside wherever you extracted the Code::Blocks build.
Title: Re: New to Code Blocks
Post by: iw2nhl on July 23, 2006, 03:34:30 pm
Download latest nightly build from here:
http://forums.codeblocks.org/index.php?board=20.0

e.g. (for Windows with MinGW installed):
23 July build message
http://forums.codeblocks.org/index.php?topic=3639.0
Code::Blocks (extract in a dir and it is ready, no installer)
http://prdownload.berlios.de/codeblocks/CB_20060723_rev2778_win32.7z
Required DLL (extract this in the same dir as Code::Blocks)
http://prdownload.berlios.de/codeblocks/wxmsw26u_gcc_cb_wx2.6.3p2.7z

Remember to install a newer version of GDB.
MinGW comes with gdb 5.2.1 which does not work with C::B, please dowload 6.3-2 version here (or anywhere else):
http://sourceforge.net/project/showfiles.php?group_id=2435
Title: Re: New to Code Blocks
Post by: DaveK on July 23, 2006, 05:36:50 pm
I think we are close. Here is what I have done for a summary

installed nightly build July 23rd.
Installed wxmsw26u_gcc_cb.dll. This is located in the CodeBlocks directory.
installed 6.3-2 version of GDB. which was zipped with specific path information. I simply unzipped the 7z file into the CodeBlocks directory maintaining the path information found in the zip file.
reinstalled wxWidgets 2.6.3
Recompiled wxWidgets using the mingw32 version I already had. Compile ran through fine
Opened codeBlocks. Works wonderfully now and looks better!
Open a wxWidgets sample called access. Said yes to all questions as it opened.
Compiled access and was able to make it past the wx/msw/wx.rc not found by setting up the right directory structure under the project options->directory tab. Got past a wx/setup.h not found error by just copying setup.h from wx/msw into wx/
It compiles but will not link
link errors:
undefined reference to 'wxAppConsole::CheckBuildOptions(char...)
undefined reference to 'wxApp::wxApp()
and so on to 50. Says there is more.

Obviously my linking information in not correct? Can anyone provide me with help in what I need to fix so this can link?

Thanks for the help thus far! :)
Title: Re: New to Code Blocks
Post by: iw2nhl on July 23, 2006, 05:53:32 pm
installed 6.3-2 version of GDB. which was zipped with specific path information. I simply unzipped the 7z file into the CodeBlocks directory maintaining the path information found in the zip file.
GDB had to be put in the MinGW dir, not the C::B one!
Title: Re: New to Code Blocks
Post by: Pecan on July 23, 2006, 06:03:47 pm
I think we are close. Here is what I have done for a summary

installed nightly build July 23rd.
Installed wxmsw26u_gcc_cb.dll. This is located in the CodeBlocks directory.
installed 6.3-2 version of GDB. which was zipped with specific path information. I simply unzipped the 7z file into the CodeBlocks directory maintaining the path information found in the zip file.
reinstalled wxWidgets 2.6.3
Recompiled wxWidgets using the mingw32 version I already had. Compile ran through fine
Opened codeBlocks. Works wonderfully now and looks better!
Open a wxWidgets sample called access. Said yes to all questions as it opened.
Compiled access and was able to make it past the wx/msw/wx.rc not found by setting up the right directory structure under the project options->directory tab. Got past a wx/setup.h not found error by just copying setup.h from wx/msw into wx/
It compiles but will not link
link errors:
undefined reference to 'wxAppConsole::CheckBuildOptions(char...)
undefined reference to 'wxApp::wxApp()
and so on to 50. Says there is more.

Obviously my linking information in not correct? Can anyone provide me with help in what I need to fix so this can link?

Thanks for the help thus far! :)
You're mixing up a ansi setup.h with a unicode widgets dll.

If you're going to copy setup.dll there is one for .../mswu (unicode) and one for .../msw (ansi). But I wouldnt copy them at all. I'd just add a reference to the correct one into the build options/directories/compiler section.
Title: Re: New to Code Blocks
Post by: DaveK on July 23, 2006, 09:10:41 pm
I am literally at my wits end. I have spent hours on this and I can't seem to get further even if I remove and reinstall everything according to the links you provide me. I either get a "wx/setup.h directory not found (even after adding the directory to the project build options, or I get linking errors like _imp__wxframeNameStr. I really don't understand why this is so hard for me to figure out or even setup, but after spending 3 hours today, 2 hours yesterday and 1 hour the day before and haven't still be able to compile a single wxWidgets file in codeblocks I'm getting to the point where i'm about to throw my hands up in the air and say this is worth my time. But I really would love to see wxWidgets work for here. I have no clue what I am doing wrong. I believe I have followed the instructions. They seem like a no-brainer. Why would Codeblocks be giving me this much grief.

I'm taking a nap.  :(
Title: Re: New to Code Blocks
Post by: Pecan on July 24, 2006, 01:17:53 am
Turn on Menu/Settings/compiler and debugger/other/compiler logging/Full command line.

Run your compile and copy/paste the compiler command line from Build Log message window to the forum here.

Lets see what cflags and libs are specified.
Title: Re: New to Code Blocks
Post by: DaveK on July 24, 2006, 02:55:41 am
mingw32-g++.exe -LC:\MinGW\lib  -o D:\CodeBlocks\wx263\samples\access\vc_mswunivudll\access.exe vc_mswunivudll\accesstest\accesstest.o  vc_mswunivudll\accesstest\accesstest.res    -mwindows

undefined references sample
vc_mswunivudll\accesstest\accesstest.o(.text+0x42):accesstest.cpp: undefined reference to `_imp___ZN12wxAppConsole17CheckBuildOptionsEPKcS1_'
vc_mswunivudll\accesstest\accesstest.o(.text+0x6c):accesstest.cpp: undefined reference to `_imp___ZN5wxAppC2Ev'
vc_mswunivudll\accesstest\accesstest.o(.text+0xd2):accesstest.cpp: undefined reference to `_imp___ZN12wxAppConsole14ms_appInstanceE'

Title: Re: New to Code Blocks
Post by: Ceniza on July 24, 2006, 03:50:53 am
If that's all then you'ren't providing the library to the linker and you didn't show the line where accesstest.o is compiled.

BTW, access isn't one of the enabled samples when I compiled it, even though I compiled it with MSYS, and that vc_mswunivudll still looks suspicious if you're using MinGW.

Are you sure you used this line to build the library: mingw32-make -f makefile.gcc  MONOLITHIC=1 SHARED=1 UNICODE=1 BUILD=release
Title: Re: New to Code Blocks
Post by: DaveK on July 24, 2006, 03:34:23 pm
Success!!! But under a different vien.

For some reason I try to compile the calendar sample and I get wx/msw/wx.rc not found EVEN with the directories specified under Build options. So I moved to build a HelloWorld example. Just created a new wxWidgets project out of the box in Codeblocks. Compiled that and it worked.

I didn't mention though.... I WAS driving these programs without the engine. Ceniza provided that missing link that I completely forgot and am now banging my head against the keyboard for forgetting. Hard to run wxWidgets without a wxWidgets library. Yeah... I compile wxWidgets, yet forget to even include the built library in CodeBlocks. You may now commence throwing tomatoes at me.

Still confused about the calendar project not compiling, but now that I got a wxWidgets program to compile I am gearing up to get more complex! thanks for the help!

Sorry about this whole ordeal. Now I know. ;)