News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

Compile a hello world project

Started by cotede2, April 24, 2010, 02:05:15 PM

Previous topic - Next topic

cotede2

Hello, I am a newbie using codeblocks (with the compiler integrated).
I'd like to build and run an easy program.
Here how I proceed:

File -> New -> wxWidget Project.

Preferred GUI Builder :  None
Application Type : Frame Based
wxwidgets : C:\wxWidgets-2.8.10
Compiler : GNU GCC Compiler
Create "Debug" configuration
Create "Release" configuration

Then I have two warnings windows "a matching debug configuration cannot be found in the wxwidget directory you specified"
"a matching release configuration cannot be found in the wxwidget directory you specified"
Then when I do Build .
Nothing appears.
I think I lost the log window and I cannot get it back.
How can I do that?

Please help

Here is my code:
#include "NewPanel.h"

//(*InternalHeaders(NewPanel)
#include <wx/intl.h>
#include <wx/string.h>
//*)

//(*IdInit(NewPanel)
const long NewPanel::ID_BUTTON1 = wxNewId();
//*)

BEGIN_EVENT_TABLE(NewPanel,wxPanel)
//(*EventTable(NewPanel)
//*)
END_EVENT_TABLE()

NewPanel::NewPanel(wxWindow* parent,wxWindowID id)
{
//(*Initialize(NewPanel)
Create(parent, id, wxDefaultPosition, wxSize(949,283), wxTAB_TRAVERSAL, _T("id"));
Button1 = new wxButton(this, ID_BUTTON1, _("Label"), wxPoint(144,48), wxDefaultSize, 0, wxDefaultValidator, _T("ID_BUTTON1"));
//*)
}

NewPanel::~NewPanel()
{
//(*Destroy(NewPanel)
//*)
}


void NewPanel::OnButton1Click(wxCommandEvent& event)
{
}


Jenna

It looks like you are missing wxWidgets.
You have to download the sources and build it yourself or use the devpak-version.

How to install wxWdgets and set up C::B for use with it see this wiki-article: http://wiki.codeblocks.org/index.php?title=WxWindowsQuickRef

cotede2

I had installed wxwidget 2.8.10 ... only binaries, is that enough?

kencamargo

Quote from: cotede2 on April 24, 2010, 05:49:05 PM
I had installed wxwidget 2.8.10 ... only binaries, is that enough?

You have to have the debug and release versions of the libraries, and you have to tell codeblocks where they are. The easiest way to do this is to set the wx environment variable to point to the directory you had it installed. And you have to have the headers as well.

HTH,
Ken

cotede2

thank you but I really cannot find the debug and release version !
When I download the wxAll from here
http://www.wxwidgets.org/downloads/

I don't have any debug nor release folder into the archive so when I create a new project I cannot specify Debug nor Release...
I am so lost.

Jenna

Quote from: cotede2 on April 25, 2010, 09:32:20 AM
thank you but I really cannot find the debug and release version !
When I download the wxAll from here
http://www.wxwidgets.org/downloads/

I don't have any debug nor release folder into the archive so when I create a new project I cannot specify Debug nor Release...
I am so lost.
Quote from: jens on April 24, 2010, 02:20:27 PM
It looks like you are missing wxWidgets.
You have to download the sources and build it yourself or use the devpak-version.

How to install wxWdgets and set up C::B for use with it see this wiki-article: http://wiki.codeblocks.org/index.php?title=WxWindowsQuickRef

Please read the link I posted and follow the instructions, or nobody can help you.

And also read carefully what the wxWidgets-team writes on their download-page: the listpoint Source Archives (where you find the windows-installer) means that they provide source archives and not prebuild binaries for windows !

cotede2

I followed the tutorial on your link with the compilation or all sources :
mingw32-make -f makefile.gcc BUILD=release SHARED=1 MONOLITHIC=1 UNICODE=1

It ends and when I create a new code blocks project, I still cannot make work the debug or release option while I had written down the right path to the wx widget path.
It says " a matching  release configuration cannot be found ..."
Do you have any idea why?

Jenna


cotede2

Yes and I did not use the variable but I wrote down directly the path C:\wxWidgets.
I still have the same issues :(

http://yfrog.com/5n55001653j
http://yfrog.com/5dll2mj

stahta01

I suggest compiling wxWidgets with Debug build option if you wish to use the debug version of wxWidgets!

http://wiki.codeblocks.org/index.php?title=WxWindowsQuickRef#BUILD

Tim S.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

cotede2

I am sorry but I may miss something right here?
I compile wxwidget using the build = debug .
Indeed, it produces as the documentation says this:

A release build of wxWidgets creates libraries without the "d" suffix -- for example, "libwxmsw28.a"/"wxmsw28_gcc_custom.dll".
A release build of wxWidgets creates the folder "msw" or "mswu" in the wxWidgets library output folder.

But when I do create a new wxwidget project under code blocks, I cannot select any configuration among Debug or Release despite the fact I did correctly compile wxwidget.

Here is the problem http://yfrog.com/5n55001653j
Whatever the configuration I select, it says then "cannot be found"
Thank you for help.



stahta01

#11
You are doing something wrong or you found a bug; but without the steps you followed no one can confirm if it is a bug or not.

Minor things to check include:
  Does setup.h exists in the proper location under your wxWidgets sub-folder?

IIRC,  the location is about "C:\wxWidgets\Lib\gcc_dll\wx\msw???\setup.h
Where ??? is set by debug/release and ANSI/Unicode options.

 Does the wxWidgets DLLs exists?

What type of wxWidgets are you trying to use? Unicode/ANSI, Release/Debug, MultiLib/Monolithic

Tim S.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

cotede2

Yes the setup.h is present several times under the wxwidgets folder like :

Here:  C:\wxWidgets\lib\gcc_dll\mswu\wx
And
Here: C:\wxWidgets\lib\gcc_dll\mswud\wx

Indeed I launched the two commands

mingw32-make -f makefile.gcc BUILD=release SHARED=1 MONOLITHIC=1 UNICODE=1
mingw32-make -f makefile.gcc BUILD=debug SHARED=1 MONOLITHIC=1 UNICODE=1

I have also :
wxmsw28u_gcc_custom.dll
and
wxmsw28ud_gcc_custom.dll

And here is how I proceed to create a wxwidget project under code blocks:
File -> New -> WxWidget
Please make a selection wxwidget 2.8.x
Project title : testremi
Author : Empty
Preferred GUI Builder: None
Application Type: Frame Based
wxwidget locations : C:\wxWidgets
Compiler : GNU GCC Compiler
Create Release configuration (checked) : Release
Release option :bin\Release\
Objects output dir : obj\Release\
Next Page nothing checked
Next => Warning 

" A matching Release Configuration cannot be found ..."
...
So I cannot build anything .
Is that a bug?

Jenna

Check the oprojects build-options (compiler searchpath, linker searchpath).
Turn on full compiler logging and see what is really sent to compiler/linker (http://wiki.codeblocks.org/index.php?title=FAQ#Q:_How_do_I_troubleshoot_an_compiler_problem.3F).

stahta01

#14
You still have NOT stated if you are picking the Unicode DLL build during the Code::Blocks Wizard.

Note: The settings may be under advanced options in wizard.

Edit: Please try Checking the correct wxWidgets Library Settings
use wxWidgets DLL
wxWidgets is an Monolithic build
enable unicode

Tim S.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]