Noobie question... Topic is solved

If you are using wxDev-C++ for your wxWidgets design, please ask your questions here instead of in IDE Related.
XTRobot
Knows some wx things
Knows some wx things
Posts: 25
Joined: Mon Jul 06, 2009 5:32 pm
Location: Macedonia

Noobie question...

Post by XTRobot » Tue Jul 07, 2009 7:32 pm

Hello,i downloaded wxDevCpp,and i created new wxFrame,but when i compile it just dont compile,and dont run,i click run it says your soruce file not compiled,but when i click compile the compile window doesnt open. And when i compile some C++ code(not wx)it says compile done but the console doesnt show up. What the heck is the problem ?

Here is pic from c++ code :

Image[/img]

And here is from wxFrame :

Image
Fifty years of programming language research, and we end up with C++ ?

tbreina
Moderator
Moderator
Posts: 1289
Joined: Thu Nov 25, 2004 7:38 pm
Location: Coronado, CA

Post by tbreina » Tue Jul 07, 2009 8:54 pm

In you first case, you'll need to put something at the end of the C++ code to pause the console window long enough. Otherwise, you'll see a console window open and close almost immediately. For example, add this at the end:

Code: Select all

    printf("Press any key to continue...");
    getchar (); /* Pause the program from exiting */
In the second example, you just did File->New->wxFrame. Instead, you'll need to do File->New->Project and select wxFrame from the window. This will setup all of the app code and compiler/linker switches you need to build the project.

Try looking at the "wxDev-C++ programming" book in the Help menu for more guidance.

-Tony
Everybody's got something to hide except for me and my monkey.

XTRobot
Knows some wx things
Knows some wx things
Posts: 25
Joined: Mon Jul 06, 2009 5:32 pm
Location: Macedonia

Post by XTRobot » Tue Jul 07, 2009 9:10 pm

About the first thing you are not right,i added system("pause"); and return 0; but like i said "When i click compile it just says Done,and the Compile Progress windows doesnt close,it just say that and the program dont run. I dont know what is the problem. And about the second thing,you are right about the new project,but when i compile wxFrame it give me some errors :

Code: Select all

 C:\Users\Aleksandar\Desktop\gcc installation problem, cannot exec `cc1': No such file or directory. 
[Resource Error] no resources 
 C:\Users\********\Desktop\Makefile.win [Build Error] exe: *** [Objects/MingW/Project1_private.res] Error 1 
So where is the problem ? Thanks for your help anyway :)
Fifty years of programming language research, and we end up with C++ ?

tbreina
Moderator
Moderator
Posts: 1289
Joined: Thu Nov 25, 2004 7:38 pm
Location: Coronado, CA

Post by tbreina » Tue Jul 07, 2009 9:33 pm

For the first one, did you create a new Project (File->New->Project->Console application)? Or did you just create a new source file (File->New->Source file)? You'll need to always create a new project when you first begin a new program.

For the second one, there seems to be something wrong with your path. Do you have MingW, Msys, or something like that on your machine? Is wxDev-C++ (or your project) in a directory that has spaces in the name?

-Tony
Everybody's got something to hide except for me and my monkey.

XTRobot
Knows some wx things
Knows some wx things
Posts: 25
Joined: Mon Jul 06, 2009 5:32 pm
Location: Macedonia

Post by XTRobot » Tue Jul 07, 2009 10:11 pm

The compiler is in C:Program Files but the project is in Desktop. I have MingW on my PC,so how can i solve that error ? And you are right about that first one,i was just using New Source File,thanks for this,but can you help me for the error ?
Fifty years of programming language research, and we end up with C++ ?

tbreina
Moderator
Moderator
Posts: 1289
Joined: Thu Nov 25, 2004 7:38 pm
Location: Coronado, CA

Post by tbreina » Tue Jul 07, 2009 10:34 pm

XTRobot wrote:The compiler is in C:Program Files but the project is in Desktop. I have MingW on my PC,so how can i solve that error ? And you are right about that first one,i was just using New Source File,thanks for this,but can you help me for the error ?
I think the second MingW may be interfering. If you can, please try uninstalling that other MingW installation. Or, you can look at the PATH environment variable and move C:\Program Files\Dev-Cpp\bin to the start of the PATH.

For the new source file error, create a new console project (File->New->Project->Console application). Copy your C++ code over the skeleton code that is automatically provided. Then, build the project.

-Tony

p.s. It sounds like you need to be reading the "Introduction to wxDev-C++ programming" manual in the Help menu. It will get you through a lot of the common pitfalls.
Everybody's got something to hide except for me and my monkey.

XTRobot
Knows some wx things
Knows some wx things
Posts: 25
Joined: Mon Jul 06, 2009 5:32 pm
Location: Macedonia

Post by XTRobot » Tue Jul 07, 2009 10:45 pm

I solved the first problem,and thank you about that,and i dont understand you about the second problem,(i am beginner),i have installed Mingw gcc with the wxDevCpp wizard,you can see here :

Image

Did you had this error when you installed wxDevCpp first time ? How did you solve it ? I just installed it like it need to be(default),i didnt changed nothing,so it looks everyone have this problem,so have did they solve it ? And what is that PATH you are talking about ? I know i am wx noobie so please help to this little kid because i am getting nervous :)
Fifty years of programming language research, and we end up with C++ ?

tbreina
Moderator
Moderator
Posts: 1289
Joined: Thu Nov 25, 2004 7:38 pm
Location: Coronado, CA

Post by tbreina » Tue Jul 07, 2009 11:18 pm

I'm assuming you used some sort of installer for the second MingW/MSys. Try uninstalling that.

As far as the system PATH, you can find more information via google (e.g. http://banagale.com/changing-your-syste ... -vista.htm). Essentially, PATH tells your computer what directories to look for when you try to run a program without specifying the directory of the program. My guess is that your computer is trying to use the second MingW compiler rather than the one in C:\Program Files\Dev-Cpp\bin

-Tony
Everybody's got something to hide except for me and my monkey.

XTRobot
Knows some wx things
Knows some wx things
Posts: 25
Joined: Mon Jul 06, 2009 5:32 pm
Location: Macedonia

Post by XTRobot » Wed Jul 08, 2009 12:39 am

Can you tell me how can i use that in C;Program files > DevCpp > Bin ?
Fifty years of programming language research, and we end up with C++ ?

Jophin
Knows some wx things
Knows some wx things
Posts: 41
Joined: Sun Apr 05, 2009 1:53 am
Location: Maharashtra , India

Post by Jophin » Wed Jul 08, 2009 2:43 am

Hi

1. Unistall all MingW , wxDevCpp , wxMSW applications if you have installed in your system.

2. Visit http://wxdsgn.sourceforge.net/ and download wxDev-C++ 7.0 Release Candidate 5 ( or use wxDev-C++ 6.10.2 that you already have with you ). This setup includes all required IDE , binarys, header files ,library and example files.

3. Try to install wxDevCpp in C:\ instead of C:\Program Files\.

4. After installation first try compiling C++ examples in "examples" directory by opening wxDevCpp project file which has *.dev extension.

5. And later try compiling wxWidgets examples in "examples\wxWidgets" directory.

6. Try following simple tutorials at site http://wxdsgn.sourceforge.net/?q=node/13 or try for more help http://wxdsgn.sourceforge.net/?q=node/6

7. Also visit http://biolpc22.york.ac.uk/pub/2.9.0-rc4/ and download wxWidgets-2.9.0-rc4-chm.zip for latest wxWidgets help documentation in .chm foramt.
Jophin K.
Maharashtra , India

XTRobot
Knows some wx things
Knows some wx things
Posts: 25
Joined: Mon Jul 06, 2009 5:32 pm
Location: Macedonia

Post by XTRobot » Wed Jul 08, 2009 10:23 am

Wow,great help,finaly someon understand me,i didnt tryed your steps,but i will soon,because i have some work to do now :S
Fifty years of programming language research, and we end up with C++ ?

XTRobot
Knows some wx things
Knows some wx things
Posts: 25
Joined: Mon Jul 06, 2009 5:32 pm
Location: Macedonia

Post by XTRobot » Wed Jul 08, 2009 1:20 pm

I compiled one of the examples and it started,thats great,now when i compiled wxFrame it also worked fine,i just cant beleave i made it,you are my angel,you understaned me,what would i do without you buddy,thanks for your help,and if i have other problems later i will ask you.BTW maybe this worked because i downloaded the latest version of wxdevcpp,before you told me i used older version,i dont know why it worked but i will always install it in C: and i will download version 7.0 !

Thanks again,i solved this problem :)
Fifty years of programming language research, and we end up with C++ ?

XTRobot
Knows some wx things
Knows some wx things
Posts: 25
Joined: Mon Jul 06, 2009 5:32 pm
Location: Macedonia

Post by XTRobot » Wed Jul 08, 2009 1:31 pm

There is just one more problem,i cant see the toolbox window,its not on the right side,i go to View > Toolbars and there was no toolbox window,how can i put one ?
Fifty years of programming language research, and we end up with C++ ?

buildere
Super wx Problem Solver
Super wx Problem Solver
Posts: 358
Joined: Thu Oct 28, 2004 3:45 pm
Location: Costa Rica

Post by buildere » Wed Jul 08, 2009 2:07 pm

Be advised that RC5 has one important bug that corrupts forms, so don't rely on it too much.

We have one possible solution for the problem, but we're doing some further investigation to ensure the best possible fix.

XTRobot
Knows some wx things
Knows some wx things
Posts: 25
Joined: Mon Jul 06, 2009 5:32 pm
Location: Macedonia

Post by XTRobot » Wed Jul 08, 2009 3:12 pm

Ohh,i didnt knew that,thanks for fast reply,i hope you will fix it soon :) Best regards XTRobot .
Fifty years of programming language research, and we end up with C++ ?

Post Reply