Author Topic: SNAFU  (Read 3962 times)

Offline Jt

  • Multiple posting newcomer
  • *
  • Posts: 10
SNAFU
« on: July 05, 2009, 06:11:50 pm »
I'm a newbie here... first post.  But I'm not a newbie to the forum.  I've been reading it for the past month, and have found answers to many questions.

That being said... I apparently screwed something up last night.  And I can't figure it out.

I've been using C:B for the last month or so for C ++ console apps and Win32 apps (trying to learn).   Then I found out about wxSmith, and tried that out.  I went through all of BYO's brilliant tutorials.  Everything worked great.

So, being a newbie, I tried to compile a simple wxWidgets project without using the wxSmith wizard.  It gave me a compile error... it couldn't find wx.h.  So, stupid me, I changed the global settings in C:B to include C:Source/Libraries/wxWidgets2.8/incude... etc.

Now, nothing works.

I mean nothing!  I've reloaded the wxPack and CodeBlocks.  If I try to compile a console project ( like hello world), it wants to try to look at some wx include files.  I'm sure I'm doing something stupid.

I know its an environment variable that I'm not setting right.  But I don't understand that stuff... I'm teaching a C++ class in Sept, and if I don't figure this stuff out now, I'm hosed ;-)

I've also had some issues with wxSmith on Linux... but that's a question for another post.

Thanks for any help.  (This is probably an easy one)

Jt

Offline Jt

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: SNAFU
« Reply #1 on: July 06, 2009, 02:34:27 pm »
Resolved.... I think  :shock:

Through trial and error, I reset (through "C:B... Settings...Global variables..." to  C:\SourceCode\Libraries\wxWidgets2.8, which is where wxWidgets put my libraries.

Now I can compile a simple console app, like "hello world".  Also, I can compile a simple wxSmith app, through the wizard.

It no longer asks me for the (totally clueless here :() $(#wx) .

So, all is well here. 

I've tried all the IDE's out there, and find C:B the best (for me at least).  If you have a problem (like I had, which was something I did wrong, - and I still don't know what it was) just keep on keeping on...  :P

Weird behavior probably means you've set something wrong.

I still don't completely understand the "settings" in C:B...  but then, I have problems making a simple "make" script.  Call me stupid.

It would be wonderful if someone savvy would do a tutorial on this.

Thanks all!

Offline dmoore

  • Developer
  • Lives here!
  • *****
  • Posts: 1576
Re: SNAFU
« Reply #2 on: July 06, 2009, 03:42:57 pm »
Jt: GCC includes a bunch of standard libs by default. wxWidgets contains string.h and some files that share the name of standard library files. If you add the wxWidget library dir in settings, GCC will use the wxWidgets string.h, hence the errors.

For future reference: avoid setting search dirs in "settings" since these apply globally to all projects. You should set project or target specific search directories in project -> build options. The global variables (e.g. $(#wx)) are safe because they don't change compiler behavior.

Offline Jt

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: SNAFU
« Reply #3 on: July 06, 2009, 04:41:41 pm »
Woohooo!!!   :D

I'm finally able to compile and run a simple wxWidgets  console app!

Thank you, dmoore!!!  Little hints like this make life so simple!


Jt: GCC includes a bunch of standard libs by default. wxWidgets contains string.h and some files that share the name of standard library files. If you add the wxWidget library dir in settings, GCC will use the wxWidgets string.h, hence the errors.

yeah, the "global" settings were (and are) causing me no end of grief.  But I'm starting to figure that out.

For future reference: avoid setting search dirs in "settings" since these apply globally to all projects. You should set project or target specific search directories in project -> build options. The global variables (e.g. $(#wx)) are safe because they don't change compiler behavior.

The project->build option seems to solve my problem... at least for building a simple console wxWidget app. 

Thank you so much for replying to my (stupid, stupid, stupid) post.  I guess its true that there are no stupid questions.

btw, I still don't understand the global $(#wx) setting.... is that a Window environmental global?  Should I worry about it?  It seems to have gone away.

Thanks, many times, again...

Jt

Offline dmoore

  • Developer
  • Lives here!
  • *****
  • Posts: 1576
Re: SNAFU
« Reply #4 on: July 06, 2009, 05:36:55 pm »
btw, I still don't understand the global $(#wx) setting.... is that a Window environmental global?  Should I worry about it?  It seems to have gone away.

http://wiki.codeblocks.org/index.php?title=Global_compiler_variables

short answer: the global variables are a convenience for handling system specific locations for libraries. They are known in the context of the application and can be used in build settings/scripts etc (but they aren't "environment" variables)

If I recall correctly, the default wxWidgets project template uses the "wx" variable to link to your wxWidgets library (saving you from having to hardcode the path in the project file)


Offline Jt

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: SNAFU
« Reply #5 on: July 07, 2009, 02:06:45 am »
Thank you so much, dmoore.

I'm a bit embarressed... I should have studied the documentation more.

Anyway, I'm now able to build and run wxWidget projects.  wxSmith is really cool, but I want to understand what's going on "under the hood".

Now I can.  Thank you for your patience and kind assistance.

Jt