Author Topic: Problems with wxWidgets Applications  (Read 19383 times)

RKCole

  • Guest
Problems with wxWidgets Applications
« on: January 25, 2006, 05:26:37 am »
I apologize if this has been placed before...

I have never used command-line compilers in the past, and I am not sure how to go about this...
My uncle and I are both having problems successfully compiling the wxWidgets template provided by Code::Blocks.  I have wxWidgets installed to the C:\wxWidgets-2.6.2 directory, but it seems to no avail.

I am not sure what I need to do to get the wxWidgets libraries to work with Code::Blocks.  I've read all I could find, including the Wiki on how to install it via the command-line tin Windows...unless I read the wrong one, my command prompt in windows states that "make" is an invalid command.

What do I need to do to get this to work?  I'm quite confused...just wish I knew more on this.

Thanks for any help provided.

Take care.

Offline Ceniza

  • Developer
  • Lives here!
  • *****
  • Posts: 1441
    • CenizaSOFT
Re: Problems with wxWidgets Applications
« Reply #1 on: January 25, 2006, 05:30:10 am »
Try mingw32-make instead of make.

RKCole

  • Guest
Re: Problems with wxWidgets Applications
« Reply #2 on: January 25, 2006, 05:54:55 am »
Thanks for the response, Ceniza.  I'm not sure what I am doing wrong.  Here is what I get from the command:
Code
C:\wxWidgets-2.6.2\build\msw>mingw32-make -f makefile.gcc clean
'mingw32-make' is not recognized as an internal or external command,
operable program or batch file.

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Re: Problems with wxWidgets Applications
« Reply #3 on: January 25, 2006, 06:01:23 am »
OK try this. Search for the file mingw32-make.exe. It should be under the codeblocks dir somewhere.  If you find it, add the respective folder to "My Computer" environment variable "path".

RKCole

  • Guest
Re: Problems with wxWidgets Applications
« Reply #4 on: January 25, 2006, 06:17:30 am »
Thanks, rickg22.

The command iswroking now, and once I get to try the instructions on the Wiki, I will post back.

Thanks again.

RKCole

  • Guest
Re: Problems with wxWidgets Applications
« Reply #5 on: January 25, 2006, 07:41:34 am »
I followed the instructions on the Wiki to the letter, but I think I still did something wrong.  After the compilation was complete, I tried to create and compile/run a wxWidgets application (the one from the template), and I received an error that stated that the program was terminated because wxmsw26_gcc_cb.dll was not found, but the dll file was in the Code::Blocks default directory.  Now when I try to open the project (the default template project) I created, I receive an error stating that "codeblocks.exe has encountered an error and needs to close"...I'm not sure what happened...

Sorry for all of the inconvenience here.  I'm going to try a fresh install tomorrow, and just go through the process again.

Thanks for the help and responses.  Hopefully I just did something minor, and hopefully I can get this fixed.

Take care and thanks for the help so far.

Offline Michael

  • Lives here!
  • ****
  • Posts: 1608
Re: Problems with wxWidgets Applications
« Reply #6 on: January 25, 2006, 10:52:11 am »
After building wxWidgets you have to put the include/lib directory(ies) in C::B. Concerning the dll(s) you can put their path in the system environmental variable PATH (do not put them in windows\sytem32 directory).

You may also want to give a try to Therion's wxWidgets 2.6.2 build.

Michael

RKCole

  • Guest
Re: Problems with wxWidgets Applications
« Reply #7 on: January 26, 2006, 01:22:54 am »
Hello again.

I uninstalled/reinstalled both Code::Blocks and wxWidgets 2.6.2.  I also went through and re-built wxWidgets.  I also registered the DLLs and I believe I set the include/lib up correctly. (The include goes into the compiler (in Settings->Compiler) and the lib folder location is placed in the Linker directories, correct?)

Now when I compile the basic wxWidge5ts template, I just receive an error that states "The program failed to start because wxmsw26_gcc_cb.dll" was not found..."

I noticed there were two DLLs (one in the CodeBlocks directory and one in the wxWidgets-2.6.2\lib\gcc_dll\ directory).  Should I register one or both of these in the Path variable under the Environment Variables settings?

I'm sorry for all of this frustration...

Thanks for the help.

Take care.

Offline Game_Ender

  • Lives here!
  • ****
  • Posts: 551
Re: Problems with wxWidgets Applications
« Reply #8 on: January 26, 2006, 01:27:02 am »
A DLL is a dynamically link library. It contains a bunch of code a program uses when it runs.  When a program starts up the OS tries its best to find the DLL the program needs.  The first place it look sis in the directory of the executable.  So if you just copy the dll to the programs directory it will run just fine.

RKCole

  • Guest
Re: Problems with wxWidgets Applications
« Reply #9 on: January 26, 2006, 01:51:52 am »
Thanks, Game_Ender.

That solved the problem.

so, whenever I create a wxWidgets app, I just need to make sure that DLL si copied into the same directory as each created application, correct?

Thanks very much for the responses, everyone.  Everythign seems to be working smoothly now.

Take care.

RKCole

  • Guest
Re: Problems with wxWidgets Applications
« Reply #10 on: January 27, 2006, 05:03:12 pm »
Well, I thought I had it working but apparently I was wrong.  It was working perfectly fine, but now I am not sure what is going on.  I only receive this message during the compilatin process:
Code
lb.exe     cannot find -lwxmsw26

Not exactly sure what is going on because it was working just fine earlier.

Thankss for all of the help; I'm definitely doing a lot better with this than I was earlier.

Take care.

Offline Michael

  • Lives here!
  • ****
  • Posts: 1608
Re: Problems with wxWidgets Applications
« Reply #11 on: January 27, 2006, 07:32:39 pm »
Well, I thought I had it working but apparently I was wrong.  It was working perfectly fine, but now I am not sure what is going on.  I only receive this message during the compilatin process:
Code
lb.exe     cannot find -lwxmsw26

It is more the linking process rather than the compiling process. The problem is that it cannot find the mentioned library. Why? It is not so easy to find out. Check if all your pathes are set correctly. You can also try with a clean and then re-build.

Michael

RKCole

  • Guest
Re: Problems with wxWidgets Applications
« Reply #12 on: January 27, 2006, 09:56:52 pm »
Thanks for the response, Michael.

I checked my directories in Code::Blocks Settings->Compiler->Directories.  I made sure that C:\wxWidgets-2.6.2\include\ was set as a directory.  In the Linker directory I set a path for C:\wxWidgets-2.6.2\lib\.  I am not sure if there is anything else I need to do pertaining to that.

I also went even farther and (I am sure this probably did not have to be done...) I uninstalled C::B and wxWidgets, deleted all registry keys, then reinstalled both and rebuilt wxWidgets using the Wiki Guide.  Unfortunately I am still receiving the same message.

Is there anything else I should do or look for?

Thanks for the help; it is much appreciated.

Take care.

Offline tiwag

  • Developer
  • Lives here!
  • *****
  • Posts: 1196
  • sailing away ...
    • tiwag.cb
Re: Problems with wxWidgets Applications
« Reply #13 on: January 27, 2006, 10:03:30 pm »
...
Is there anything else I should do or look for?

Thanks for the help; it is much appreciated.
please post your project as attachement here, i'll look at it and if i find something, i'll correct it.

RKCole

  • Guest
Re: Problems with wxWidgets Applications
« Reply #14 on: January 27, 2006, 10:33:16 pm »
tiwag,

While looking through the project folder I created (the project is just the wxWidgets template from Code::Blocks) I noticed there was a file named wx_pch.h.gch which is about 38.1MB in size.  Would this have something to do with the situation at all?

I will still post the project if you would like.  It is just the wxWidgets template with no changes.  I was going to try to compile the template to see if it would work; I was just planning on manipulating it if it compiled/linked correctly so that I could begin teaching myself wxWidgets.

Thanks for the help.

Offline tiwag

  • Developer
  • Lives here!
  • *****
  • Posts: 1196
  • sailing away ...
    • tiwag.cb
Re: Problems with wxWidgets Applications
« Reply #15 on: January 27, 2006, 10:34:28 pm »
RKCole
we can try another 100 guesses or just look what's wrong, it's up to you :)

when you get a linker error like wxmsw26 not found, it's unlikely that the pch has something to do with

[addendum]
please post the exact version of CodeBlocks you are using

go to Help->About->Information-tab and post what is written there
« Last Edit: January 27, 2006, 10:41:16 pm by tiwag »

RKCole

  • Guest
Re: Problems with wxWidgets Applications
« Reply #16 on: January 27, 2006, 10:46:50 pm »
I agree, tiwag.  Thanks for the help.

[attachment deleted by admin]

RKCole

  • Guest
Re: Problems with wxWidgets Applications
« Reply #17 on: January 27, 2006, 10:52:43 pm »
Sorry, missed the addendum.

Code::Blocks version 1.0 RC2
Build: Oct 24 23:49:28 - wx-2.6.1 (Windows, ANSI)

Offline tiwag

  • Developer
  • Lives here!
  • *****
  • Posts: 1196
  • sailing away ...
    • tiwag.cb
Re: Problems with wxWidgets Applications
« Reply #18 on: January 27, 2006, 11:12:03 pm »
ok - i ran your project with CodeBlocks 1.0RC2 and beside the fact, that i have my wxWidgets installed in D:\wx262 and therefore adjusted the custom variable WX_DIR to my needs, your project built perfectly. ( using Build->Rebuild or Ctrl-F11 )

can you please look, what files you have in your
C:\wxWidgets-2.6.2\lib\gcc_dll
directory ?

post the output-file (mylibs.txt) of
dir C:\wxWidgets-2.6.2\lib\gcc_dll > mylibs.txt

which you run in a command window

RKCole

  • Guest
Re: Problems with wxWidgets Applications
« Reply #19 on: January 27, 2006, 11:26:14 pm »
In the gcc_dll folder there is a folder called "msw" with a "build.cfg" file in it.  There is a folder in this directory called "wx" with the "setup.h" file in it.  I did not see a mylibs.txt file, though.

sethjackson

  • Guest
Re: Problems with wxWidgets Applications
« Reply #20 on: January 27, 2006, 11:29:17 pm »
In the gcc_dll folder there is a folder called "msw" with a "build.cfg" file in it.  There is a folder in this directory called "wx" with the "setup.h" file in it.  I did not see a mylibs.txt file, though.

He means run this in the command prompt (he says to in the last line of his post).  :wink:

Code
dir C:\wxWidgets-2.6.2\lib\gcc_dll > mylibs.txt
« Last Edit: January 27, 2006, 11:30:53 pm by sethjackson »

Offline tiwag

  • Developer
  • Lives here!
  • *****
  • Posts: 1196
  • sailing away ...
    • tiwag.cb
Re: Problems with wxWidgets Applications
« Reply #21 on: January 27, 2006, 11:35:27 pm »
He means run this in the command prompt (he says to in the last line of his post).  :wink:

Code
dir C:\wxWidgets-2.6.2\lib\gcc_dll > mylibs.txt
exactly , thx seth !

sethjackson

  • Guest
Re: Problems with wxWidgets Applications
« Reply #22 on: January 27, 2006, 11:36:42 pm »
He means run this in the command prompt (he says to in the last line of his post).  :wink:

Code
dir C:\wxWidgets-2.6.2\lib\gcc_dll > mylibs.txt
exactly , thx seth !

Yeah. np  8) I almost missed that you said to run in command prompt myself.  :P

RKCole

  • Guest
Re: Problems with wxWidgets Applications
« Reply #23 on: January 27, 2006, 11:44:12 pm »
Sorry guys...guess I'm not fully here today...Have had a headache all day...

[attachment deleted by admin]

Offline tiwag

  • Developer
  • Lives here!
  • *****
  • Posts: 1196
  • sailing away ...
    • tiwag.cb
Re: Problems with wxWidgets Applications
« Reply #24 on: January 27, 2006, 11:48:14 pm »
i don't wonder, why your project doesn't build,

you don't have any wxWidgets library at all in your libs directory

Volume in drive C has no label.
 Volume Serial Number is 4C72-D410

 Directory of C:\wxWidgets-2.6.2\lib\gcc_dll

01/27/2006  03:42 PM    <DIR>          .
01/27/2006  03:42 PM    <DIR>          ..
01/27/2006  03:20 PM    <DIR>          msw
               0 File(s)              0 bytes
               3 Dir(s)  71,395,835,904 bytes free



[edit]

in your case, ANSI build only, it should look like

Directory of C:\wxWidgets-2.6.2\lib\gcc_dll

2005.12.30  01:07    <DIR>          .
2005.12.30  01:07    <DIR>          ..
2006.01.01  17:25    <DIR>          msw
2006.01.01  17:27           158.734 libwxexpat.a
2006.01.01  17:26           146.784 libwxjpeg.a
2006.01.01  17:52        13.106.452 libwxmsw26.a
2006.01.01  17:26           169.592 libwxpng.a
2006.01.01  17:26            79.110 libwxregex.a
2006.01.01  17:26           327.646 libwxtiff.a
2006.01.01  17:26            73.036 libwxzlib.a
2006.01.01  17:53         9.577.786 wxmsw26_gcc.dll



[edit2]
if you have the wxwidgets object files still on your harddisk,
open a command prompt,
navigate to
C:\wxWidgets-2.6.2
and run the make process again
cd build\msw
mingw32-make -f makefile.gcc BUILD=release SHARED=1 MONOLITHIC=1 USE_XRC=1 UNICODE=0


this will rebuild the libraries
« Last Edit: January 28, 2006, 12:08:12 am by tiwag »

RKCole

  • Guest
Re: Problems with wxWidgets Applications
« Reply #25 on: January 28, 2006, 12:00:23 am »
That's odd...I wonder what happened...Everything worked just fine yesterday...

Should I just try to build wxWidgets again and see what the result is?

Thanks for taking the time to help me with this.


Offline tiwag

  • Developer
  • Lives here!
  • *****
  • Posts: 1196
  • sailing away ...
    • tiwag.cb
Re: Problems with wxWidgets Applications
« Reply #26 on: January 28, 2006, 12:03:27 am »
maybe you ran a "make clean" on your wxWidgets, this deletes all output files


RKCole

  • Guest
Re: Problems with wxWidgets Applications
« Reply #27 on: January 28, 2006, 12:13:36 am »
I may have...I will give this another try and post back later.

Thanks for all of the help, tiwag.

RKCole

  • Guest
Re: Problems with wxWidgets Applications
« Reply #28 on: January 28, 2006, 03:49:00 am »
I believe that tiwag was correct in me running a "make clean" command.  I'm very unfamiliar with working with MingW in the command prompt, so I believe this was the cause of the problem.

Everything is working just fine now.

Thanks for all of the help.

Take care.