Creating wxWidgets 3.1.3 project in Code::Blocks: No such file or directory

Do you have a question about makefiles, a compiler or IDE you are using and need to know how to set it up for wxWidgets or why it doesn't compile but other IDE's do ? Post your questions here.
Feelings
Earned a small fee
Earned a small fee
Posts: 21
Joined: Sun Jun 28, 2020 11:17 am

Re: Creating wxWidgets 3.1.3 project in Code::Blocks: No such file or directory

Post by Feelings »

Oh, I didin,t notice that you change MONOLITHIC from 1 to 0. I complie wxWidgets from command line again, this time using MONOLITHIC=0 and create a project in C::B and still have error "wx/app.h: No such file or directory".
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7458
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Creating wxWidgets 3.1.3 project in Code::Blocks: No such file or directory

Post by ONEEYEMAN »

Hi,
Can you post the whole build log with the error?

Thank you.
Feelings
Earned a small fee
Earned a small fee
Posts: 21
Joined: Sun Jun 28, 2020 11:17 am

Re: Creating wxWidgets 3.1.3 project in Code::Blocks: No such file or directory

Post by Feelings »

Code: Select all

Linking console executable: C:\Users\grz\Desktop\C++\Project\ProjectMain.exe
In file included from C:\Users\grz\Desktop\C++\Project\ProjectMain.h:15:0,
                 from C:\Users\grz\Desktop\C++\Project\ProjectMain.cpp:18:
C:\Users\grz\Desktop\C++\Project\ProjectApp.h:13:20: fatal error: wx/app.h: No such file or directory
compilation terminated.
Process terminated with status 1 (0 minute(s), 0 second(s))
1 error(s), 0 warning(s) (0 minute(s), 0 second(s))
Last edited by Feelings on Mon Jun 29, 2020 5:55 pm, edited 1 time in total.
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7458
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Creating wxWidgets 3.1.3 project in Code::Blocks: No such file or directory

Post by ONEEYEMAN »

Hi,
Could you please post the code you are using?

Thank you.
Feelings
Earned a small fee
Earned a small fee
Posts: 21
Joined: Sun Jun 28, 2020 11:17 am

Re: Creating wxWidgets 3.1.3 project in Code::Blocks: No such file or directory

Post by Feelings »

App.cpp

Code: Select all

#ifdef WX_PRECOMP
#include "wx_pch.h"
#endif

#ifdef __BORLANDC__
#pragma hdrstop
#endif //__BORLANDC__

#include "ProjectApp.h"
#include "ProjectMain.h"

IMPLEMENT_APP(ProjectApp);

bool ProjectApp::OnInit()
{
    ProjectFrame* frame = new ProjectFrame(0L);
    frame->SetIcon(wxICON(aaaa)); // To Set App Icon
    frame->Show();
    
    return true;
}
App.h

Code: Select all

#ifndef PROJECTAPP_H
#define PROJECTAPP_H

#include <wx/app.h>

class ProjectApp : public wxApp
{
    public:
        virtual bool OnInit();
};

#endif // PROJECTAPP_H
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7458
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Creating wxWidgets 3.1.3 project in Code::Blocks: No such file or directory

Post by ONEEYEMAN »

Hi,
Why are you including the app.h, and why do you include it in the header file?

Remove that line.

Look at the wxWidgets-3.1.3\samples\minimal file minimal.cpp.

You should include the wx/wx.h header file in the source code. Just like in the minimal sample.

Also, to make sure you have everything working - try to do the following:

Code: Select all

cd c:\wxWidgets-3.1.3\samples\minimal
mingw32-make -f makefile.gcc BUILD=debug SHARED=0 MONOLITHIC=0 UNICODE=1
./minimal.exe
from the command prompt.

If you can build and run the minimal sample - you did something wrong with the C::B setup.

Thank you.
Last edited by ONEEYEMAN on Mon Jun 29, 2020 7:20 pm, edited 1 time in total.
User avatar
doublemax
Moderator
Moderator
Posts: 19114
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Creating wxWidgets 3.1.3 project in Code::Blocks: No such file or directory

Post by doublemax »

All errors are still "No such file or directory". Just go through the project settings manually and check the include path(s). There must be a mistake somewhere. And then also check if the header files are actually there.
Use the source, Luke!
Feelings
Earned a small fee
Earned a small fee
Posts: 21
Joined: Sun Jun 28, 2020 11:17 am

Re: Creating wxWidgets 3.1.3 project in Code::Blocks: No such file or directory

Post by Feelings »

./minimal.exe ? This line is after mingw32-make -f makefile.gcc BUILD=debug SHARED=0 MONOLITHIC=0 UNICODE=1 ?
because I have problem with this command ./minimal.exe
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7458
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Creating wxWidgets 3.1.3 project in Code::Blocks: No such file or directory

Post by ONEEYEMAN »

Hi,
Yes, there are 3 lines.
Just execute them one by one.

Thank you.
Feelings
Earned a small fee
Earned a small fee
Posts: 21
Joined: Sun Jun 28, 2020 11:17 am

Re: Creating wxWidgets 3.1.3 project in Code::Blocks: No such file or directory

Post by Feelings »

I have problem with last command '.' is not recognized as an internal or external command, operable program or batch file
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7458
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Creating wxWidgets 3.1.3 project in Code::Blocks: No such file or directory

Post by ONEEYEMAN »

Hi,
OK, then just type:

Code: Select all

minimal.exe
Does it run?

Thank you.
Feelings
Earned a small fee
Earned a small fee
Posts: 21
Joined: Sun Jun 28, 2020 11:17 am

Re: Creating wxWidgets 3.1.3 project in Code::Blocks: No such file or directory

Post by Feelings »

No, is the same comment
PB
Part Of The Furniture
Part Of The Furniture
Posts: 4193
Joined: Sun Jan 03, 2010 5:45 pm

Re: Creating wxWidgets 3.1.3 project in Code::Blocks: No such file or directory

Post by PB »

The minimal sample executable (minimal.exe) for the static debug build is built in the gcc_mswud subfolder of the minimal sample folder. Just use File Explorer to see if it is there or not and launch it?
Feelings
Earned a small fee
Earned a small fee
Posts: 21
Joined: Sun Jun 28, 2020 11:17 am

Re: Creating wxWidgets 3.1.3 project in Code::Blocks: No such file or directory

Post by Feelings »

If you talking about minimal application so its okay...I get small window
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7458
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Creating wxWidgets 3.1.3 project in Code::Blocks: No such file or directory

Post by ONEEYEMAN »

Hi,
Yes, so minimal sample was built and ran fine.

Good.

Now it is only a matter of setting up the C::B.

Try to add the code from the minimal sample into your C::B project and recompile.

Or better yet - start from scratch.

Create a new C::B project and put the screenshot here as you go.

Then we can visualize and guide you what you are doing wrong.

Or check the very recent "Sticky" tread about setting up the C::B project.

Thank you.
Post Reply