Author Topic: Error!! please help  (Read 7030 times)

Offline cshong

  • Single posting newcomer
  • *
  • Posts: 5
Error!! please help
« on: August 23, 2007, 05:57:39 am »
I'm using Microsoft Windows XP Home Edition with SP2. I had installed wxWidgets version 2.8.4. In Project - Build Options - wxWidgets application - Custom Variables, I had set WX_DIR = C:\wxWidgets-2.8.4, this is the path I installed wxWidgets to.

When I try to build my first application, a build error "C:\Program Files\CodeBlocks\bin\..\lib\gcc\mingw32\3.4.4\..\..\..\..\mingw32\bin\ld.exe: cannot find -lwxmsw26" was occured. Why?

How to solve this problem (only with wxWidgets version 2.8.4, without having to install previous version)?

Offline Ceniza

  • Developer
  • Lives here!
  • *****
  • Posts: 1441
    • CenizaSOFT
Re: Error!! please help
« Reply #1 on: August 23, 2007, 07:02:42 am »
Edit your project settings and change the name of the library to link against from wxmsw26 to wxmsw28 and you should be done.

Offline cshong

  • Single posting newcomer
  • *
  • Posts: 5
Re: Error!! please help
« Reply #2 on: August 25, 2007, 08:37:21 am »
The solution posted by Ceniza does not work. why?

I compile wxWidgets using Visual C++ 2005.

The problem occured in code::blocks
« Last Edit: August 25, 2007, 08:46:45 am by cshong »

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: Error!! please help
« Reply #3 on: August 25, 2007, 09:44:11 am »
The solution posted by Ceniza does not work. why?

I compile wxWidgets using Visual C++ 2005.

The problem occured in code::blocks

Then you should use appropriate compiler. Create a new project using wxWidgets wizard and select Microsoft Visual C++ 2005 compiler.
Be a part of the solution, not a part of the problem.

Offline nicola

  • Single posting newcomer
  • *
  • Posts: 3
Re: Error!! please help
« Reply #4 on: September 14, 2007, 04:06:27 pm »
I have the same problem.
Building wxWidgets-2.8.4 with MinGW 5.1.3 I got the same "cannot find -lwxmsw26"
in my
C:\projects\wxWidgets-2.8.4\lib\gcc_dll\
there are:
  libwxexpat.a
  libwxjpeg.a
  libwxmsw28u.a
  libwxpng.a
  libwxregexu.a
  libwxti.a
  libwxzlib.a
  wxmsw28u_gcc_custom.dll ( about 10 mb)

seems like i got 1 big library
but how to make the template project compile and work? want to see what is wx.

CB is
Name:       Code::Blocks
Version:    1.0rc2
can anybody advise smth.? or tell what was his stuff in case there was no problems? 

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Error!! please help
« Reply #5 on: September 14, 2007, 05:10:29 pm »
"cannot find -lwxmsw26"

there are:
  libwxmsw28u.a
Do you know what a library is? You setup your project to link against the v2.6 ansi version of wx but have the v2.8 unicode version. Setup your linker settings accordingly and you are done.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: Error!! please help
« Reply #6 on: September 14, 2007, 07:13:37 pm »
CB is
Name:       Code::Blocks
Version:    1.0rc2
can anybody advise smth.? or tell what was his stuff in case there was no problems? 

Please download a latest nightly build. ;)
Be a part of the solution, not a part of the problem.

Offline Seronis

  • Almost regular
  • **
  • Posts: 197
Re: Error!! please help
« Reply #7 on: September 15, 2007, 03:28:50 am »
OK, honestly can we PLEASE select a recent nightly build and remove RC2 from the main page completely?  Pretty Please?  I'll pay you $20 over paypal to an address of choice my first paycheck after RC2 is delinked from the main page.  Promiss.

Id suggest 4355 as it worked without problems with all the projects i made using rv3505.  I'll be updating svn in a bit but in general there is a LOT of confusion caused by new people grabbing RC 2 just because its an 'rc' release.   What ever the latest version that doesnt have any fatal flaws in  win/nix/mac would be better obviously.  Just anything but rc2.
« Last Edit: September 15, 2007, 03:31:59 am by Seronis »

Offline XayC

  • Multiple posting newcomer
  • *
  • Posts: 94
Re: Error!! please help
« Reply #8 on: September 15, 2007, 10:02:40 am »
Can we PLEASE select a recent nightly build and remove RC2 from the main page completely?
Actually I have to say there's something really wrong if it's suggested to not use the RC2.
I know it has been discussed already, but I don't see the point letting people download a version that anyone would discourage to use.

Just call it RC2.5 or RC2b and throw away the old RC2; it's not a matter of considering it stable or good-quality, it's only to save time to the new users.

Regards, XayC.

Offline nicola

  • Single posting newcomer
  • *
  • Posts: 3
Re: Error!! please help
« Reply #9 on: September 15, 2007, 05:35:20 pm »
nightly build (september 14) is really nice.
and now I have wxWidgets-2.8.5 (does it metters for another problem? probably no, becouse i got the same with 2.8.4)

building the default wx project in Build log I got this:
C:\wxWidgets-2.8.5\include\wx\platform.h:196: wx/setup.h: No such file or directory
followed by such lines:
C:\wxWidgets-2.8.5\include\wx\chkconf.h:103: #error "wxUSE_DYNLIB_CLASS must be defined."
C:\wxWidgets-2.8.5\include\wx\chkconf.h:111: #error "wxUSE_EXCEPTIONS must be defined."

...   ...   ...

well in C:\wxWidgets-2.8.5\include\wx\  there is setup.h in msw directory
When I changed line 196 in platform.h from #include "wx/setup.h" to #include "msw/setup.h" and tried to build I have:
C:\MinGW\bin\..\lib\gcc\mingw32\3.4.2\..\..\..\..\mingw32\bin\ld.exe: cannot find -lwxmsw28u


C:\wxWidgets-2.8.5\lib\gcc_dll\
contains wxmsw28ud.a

renaming it causes fatal error:
Mismatch between the programm and bould versions detected.
The library used 2.8 (debug,Unicode,compiler with C++ ABI 1002,wx containers, compatible with 2.6),
and your programm used 2.8 (no debug,Unicode,compiler with C++ ABI 1002,wx containers, compatible with 2.6).

Offline TDragon

  • Lives here!
  • ****
  • Posts: 943
    • TDM-GCC
Re: Error!! please help
« Reply #10 on: September 15, 2007, 06:43:13 pm »
When I changed line 196 in platform.h
...
renaming it causes fatal error:
Both of these are the wrong solutions to your errors.

To solve the first, ensure that "C:\wxWidgets-2.8.5\lib\gcc_dll\mswu" is in your project's include paths. (You'll notice that this directory contains "wx\setup.h".) This is most commonly done with a global variable named "wx", with the base path set to (in your case) "C:\wxWidgets-2.8.5", and then "$(#wx.lib)\gcc_dll\mswu" in your project's Compiler search directories.

To solve the second, change your wxWidgets library option ("Link libraries" in your project's linker settings) from "wxmsw28u" to "wxmsw28ud", or recompile wxWidgets with "BUILD=release".

As long as you select the correct options, the wxWidgets project wizard will handle all this for you. In your case, you currently have a wxWidgets DLL (SHARED=1), built as a monolithic library (MONOLITHIC=1), Unicode enabled (UNICODE=1). Additionally, the debug version of wxWidgets was built (BUILD=debug). To indicate that in the wizard, check the "Configure Advanced Options" button and select "Use __WXDEBUG__ and Debug wxWidgets lib"; however, you will never need to debug wxWidgets itself, so it's recommended that you rebuild it in release mode for a smaller and faster version.
https://jmeubank.github.io/tdm-gcc/ - TDM-GCC compiler suite for Windows (GCC 9.2.0 2020-03-08, 32/64-bit, no extra DLLs)

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: Error!! please help
« Reply #11 on: September 15, 2007, 07:36:34 pm »
To indicate that in the wizard, check the "Configure Advanced Options" button and select "Use __WXDEBUG__ and Debug wxWidgets lib"; however, you will never need to debug wxWidgets itself, so it's recommended that you rebuild it in release mode for a smaller and faster version.

TDragon has given an excellent explanation for your problem. I want to add one more point to that. The statement quoted above can safely be applied for GCC. Don't try it with MSVC or any other compilers. :)

As TDragon has suggested, don't start with a Debug version of wxWidgets unless you're interested to debug wx. You may face some strange debugging messages while running your app.
« Last Edit: September 15, 2007, 07:38:50 pm by Biplab »
Be a part of the solution, not a part of the problem.

Offline nicola

  • Single posting newcomer
  • *
  • Posts: 3
Re: Error!! please help
« Reply #12 on: September 15, 2007, 08:19:18 pm »
TDragon Thanks a lot!
now lets experiment with it ... thnx to all