Author Topic: wxWidgets Project (cannot find -lwxmsw26) [Solved]  (Read 13508 times)

Offline Slider

  • Multiple posting newcomer
  • *
  • Posts: 10
wxWidgets Project (cannot find -lwxmsw26) [Solved]
« on: December 04, 2005, 10:00:48 pm »
Hi, I hope someone can help me with this problem, I've read as much as I can about it, but can find no difinitive solution.

I'm using Code::Blocks 1.0 RC2 with the MinGW compiler - this works fine.

I've installed wxWidgets and compiled them by:
cd C:\wxWidgets\build\msw
mingw32-make -f makefile.gcc BUILD=release SHARED=1 MONOLITHIC=1 USE_XRC=1 UNICODE=0 VENDOR=cb
cd ..\..\contrib\build\stc
mingw32-make -f makefile.gcc BUILD=release SHARED=1 MONOLITHIC=1 USE_XRC=1 UNICODE=0 VENDOR=cb

I've created a new wxWidgets project using the supplied template, but when building I get the following error:
cannot find -lwxmsw26

I've checked the project "build options", under "link libraries" wxmsw26 is listed. (I understand using this type of link lib is best)

However, I can't find libwxmsw.a in C:\wxWidgets\lib\gcc_dll

Any ideas?
« Last Edit: December 06, 2005, 10:23:05 pm by Slider »

Offline Urxae

  • Regular
  • ***
  • Posts: 376
Re: wxWidgets Project (cannot find -lwxmsw26)
« Reply #1 on: December 04, 2005, 11:49:31 pm »
Two questions:
  • What version of wx did you compile? If it wasn't 2.6.* you might have to change that filename to reflect the library created.
  • Did you add the lib's directory to the linker search path?

Offline Slider

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: wxWidgets Project (cannot find -lwxmsw26)
« Reply #2 on: December 05, 2005, 12:48:14 am »
Hi,

I compiled version 2.6.2

As for the linker search path, I haven't added or changed anything manually. In Project>>Build Options>>Directories tab>>Linker tab I have:
$(WX_DIR)\lib\gcc_dll$(WX_CFG)

sethjackson

  • Guest
Re: wxWidgets Project (cannot find -lwxmsw26)
« Reply #3 on: December 05, 2005, 12:53:25 am »
Hi,

I compiled version 2.6.2

As for the linker search path, I haven't added or changed anything manually. In Project>>Build Options>>Directories tab>>Linker tab I have:
$(WX_DIR)\lib\gcc_dll$(WX_CFG)

Add to linker.

$(WX_DIR)\lib\gcc_dll
$(WX_DIR)\lib\gcc_dll\msw

Add to compiler.

$(WX_DIR)\include
$(WX_DIR)\lib\gcc_dll
$(WX_DIR)\lib\gcc_dll\msw

And change your WX_DIR to "C:\wxWidgets".

Your compiler defines should have WXUSINGDLL or something like that. I use static can't remerber what that option was....
« Last Edit: December 05, 2005, 12:57:23 am by Seth Jackson »

Offline Slider

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: wxWidgets Project (cannot find -lwxmsw26)
« Reply #4 on: December 05, 2005, 01:02:07 am »
Hi,

I compiled version 2.6.2

As for the linker search path, I haven't added or changed anything manually. In Project>>Build Options>>Directories tab>>Linker tab I have:
$(WX_DIR)\lib\gcc_dll$(WX_CFG)

Add to linker.

$(WX_DIR)\lib\gcc_dll
$(WX_DIR)\lib\gcc_dll\msw

Add to compiler.

$(WX_DIR)\include
$(WX_DIR)\lib\gcc_dll
$(WX_DIR)\lib\gcc_dll\msw

And change your WX_DIR to "C:\wxWidgets".

Your compiler defines should have WXUSINGDLL or something like that. I use static can't remerber what that option was....

Thanks for the suggestion, I've followed what you said, but its still throwing up the same error.

sethjackson

  • Guest
Re: wxWidgets Project (cannot find -lwxmsw26)
« Reply #5 on: December 05, 2005, 01:05:56 am »
Could you attach your project file (*.cbp)?

Offline Slider

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: wxWidgets Project (cannot find -lwxmsw26)
« Reply #6 on: December 05, 2005, 01:11:11 am »
Could you attach your project file (*.cbp)?

Here it is, minus the corrections you suggested earlier.

<?xml version="1.0"?>
<!DOCTYPE CodeBlocks_project_file>
<CodeBlocks_project_file>
   <FileVersion major="1" minor="1"/>
   <Project>
      <Option title="wxWidgets application"/>
      <Option makefile="Makefile"/>
      <Option makefile_is_custom="0"/>
      <Option compiler="0"/>
      <Build>
         <Target title="default">
            <Option output="C:\test\wxWidgets.exe"/>
            <Option working_dir="."/>
            <Option object_output=".objs"/>
            <Option deps_output=".deps"/>
            <Option type="0"/>
            <Option compiler="0"/>
            <Option projectResourceIncludeDirsRelation="0"/>
         </Target>
         <Environment>
            <Variable name="WX_DIR" value="C:\wxWidgets"/>
            <Variable name="WX_CFG" value=""/>
         </Environment>
      </Build>
      <Compiler>
         <Add option="-pipe"/>
         <Add option="-mthreads"/>
         <Add option="-Winvalid-pch"/>
         <Add option="-include &quot;wx_pch.h&quot;"/>
         <Add option="-D__GNUWIN32__"/>
         <Add option="-D__WXMSW__"/>
         <Add option="-DWXUSINGDLL"/>
         <Add option="-DUSE_PCH"/>
         <Add directory="$(WX_DIR)\include"/>
         <Add directory="$(WX_DIR)\lib\gcc_dll$(WX_CFG)\msw"/>
         <Add directory="$(WX_DIR)\contrib\include"/>
      </Compiler>
      <ResourceCompiler>
         <Add directory="$(WX_DIR)\include"/>
      </ResourceCompiler>
      <Linker>
         <Add library="wxmsw26"/>
         <Add directory="$(WX_DIR)\lib\gcc_dll$(WX_CFG)"/>
      </Linker>
      <Unit filename="wx_pch.h">
         <Option compilerVar="CPP"/>
         <Option link="0"/>
         <Option weight="0"/>
         <Option target="default"/>
      </Unit>
   </Project>
</CodeBlocks_project_file>

Offline cyberkoa

  • Plugin developer
  • Almost regular
  • ****
  • Posts: 145
    • http://
Re: wxWidgets Project (cannot find -lwxmsw26)
« Reply #7 on: December 05, 2005, 03:42:03 am »
Could you attach your project file (*.cbp)?

Here it is, minus the corrections you suggested earlier.

<?xml version="1.0"?>
<!DOCTYPE CodeBlocks_project_file>
<CodeBlocks_project_file>
   <FileVersion major="1" minor="1"/>
   <Project>
      <Option title="wxWidgets application"/>
      <Option makefile="Makefile"/>
      <Option makefile_is_custom="0"/>
      <Option compiler="0"/>
      <Build>
         <Target title="default">
            <Option output="C:\test\wxWidgets.exe"/>
            <Option working_dir="."/>
            <Option object_output=".objs"/>
            <Option deps_output=".deps"/>
            <Option type="0"/>
            <Option compiler="0"/>
            <Option projectResourceIncludeDirsRelation="0"/>
         </Target>
         <Environment>
            <Variable name="WX_DIR" value="C:\wxWidgets"/>
            <Variable name="WX_CFG" value=""/>
         </Environment>
      </Build>
      <Compiler>
         <Add option="-pipe"/>
         <Add option="-mthreads"/>
         <Add option="-Winvalid-pch"/>
         <Add option="-include &quot;wx_pch.h&quot;"/>
         <Add option="-D__GNUWIN32__"/>
         <Add option="-D__WXMSW__"/>
         <Add option="-DWXUSINGDLL"/>
         <Add option="-DUSE_PCH"/>
         <Add directory="$(WX_DIR)\include"/>
         <Add directory="$(WX_DIR)\lib\gcc_dll$(WX_CFG)\msw"/>
         <Add directory="$(WX_DIR)\contrib\include"/>
      </Compiler>
      <ResourceCompiler>
         <Add directory="$(WX_DIR)\include"/>
      </ResourceCompiler>
      <Linker>
         <Add library="wxmsw26"/>
         <Add directory="$(WX_DIR)\lib\gcc_dll$(WX_CFG)"/>
      </Linker>
      <Unit filename="wx_pch.h">
         <Option compilerVar="CPP"/>
         <Option link="0"/>
         <Option weight="0"/>
         <Option target="default"/>
      </Unit>
   </Project>
</CodeBlocks_project_file>

It seems like you still have not defined WX_DIR...

Go to Project > Build Options > Custom variables  , Add a variable "WX_DIR" (without quotes), value as "C:\wxWidgets " (without quotes) , it should work now :)

Offline Slider

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: wxWidgets Project (cannot find -lwxmsw26)
« Reply #8 on: December 05, 2005, 04:06:29 pm »
WX_DIR is defined, according to the cbp file above:
...
<Variable name="WX_DIR" value="C:\wxWidgets"/>
...

Offline cyberkoa

  • Plugin developer
  • Almost regular
  • ****
  • Posts: 145
    • http://
Re: wxWidgets Project (cannot find -lwxmsw26)
« Reply #9 on: December 05, 2005, 05:29:11 pm »
WX_DIR is defined, according to the cbp file above:
...
<Variable name="WX_DIR" value="C:\wxWidgets"/>
...
:oops: I use the search function to find in your .cbp file seems like I missed out ..

anyway , did you find your any library files under WX_DIR\lib\gcc_dll\  ? if not , try to search under WX_DIR with the file name wxmsw*  see where it is . If cannot be found , maybe your compilation of wxwidgets is not successful.



Offline Slider

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: wxWidgets Project (cannot find -lwxmsw26)
« Reply #10 on: December 05, 2005, 05:58:53 pm »
When searching for wxmsw* nothing was found.

The follwing files are present in \lib\gcc_dll:

libwxexpat.a, libwxjpeg.a, libwxpng.a, libwxregex.a, libwxtiff.a, libwxzlib.a

The problem is really starting to annoy me. Thanks for your help.

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Re: wxWidgets Project (cannot find -lwxmsw26)
« Reply #11 on: December 05, 2005, 06:33:24 pm »
Just copy your libwxmsw26.a to that directory. It should be there around somewhere... search for lib*wx*.a:

Code: [Select]
C:\> CD \wxWidgets
C:\wxWidgets> DIR lib*wx*.a /s /b

And tell us what you find.

Offline Slider

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: wxWidgets Project (cannot find -lwxmsw26)
« Reply #12 on: December 05, 2005, 06:41:19 pm »
No libwxmsw26.a was found in c:\wxWidgets, has something gone wrong when I compiled wxWidgets?

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4291
    • Code::Blocks IDE
Re: wxWidgets Project (cannot find -lwxmsw26)
« Reply #13 on: December 05, 2005, 06:47:34 pm »
When searching for wxmsw* nothing was found.

...

The problem is really starting to annoy me. Thanks for your help.

Check your wxWidgets build. If you don't have the wxMSW DLL (and import library) already built, how do you expect it to work?  :shock:
Be patient!
This bug will be fixed soon...

Offline Slider

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: wxWidgets Project (cannot find -lwxmsw26)
« Reply #14 on: December 05, 2005, 06:53:02 pm »
I followed the instructions using mingw32-make to compile the libraries, no errors were encountered. Part of the problem is there are no definitive instructions for getting wxWidgets working with Code::Blocks - the Wiki says something different to the wxWidgets "instructions" posted in this forum.

Offline Slider

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: wxWidgets Project (cannot find -lwxmsw26)
« Reply #15 on: December 05, 2005, 07:07:57 pm »
ok, I've gone through the build again, but still no libwxmsw26.a is created anywhere.

Offline cyberkoa

  • Plugin developer
  • Almost regular
  • ****
  • Posts: 145
    • http://
Re: wxWidgets Project (cannot find -lwxmsw26)
« Reply #16 on: December 06, 2005, 08:40:06 pm »
very strange ... a question , do you have  wxmsw26_gcc_cb.dll ?


One of the possibility may due to non-default wxwidgets installation path.

Try to add an OS environment variable in your windows  (My computer right click>  properties > Advanced > Environment variable  , it may a bit different win2k & winxp )

set WX_DIR as c:\wxwidgets

Recompile wxwidgets (do a make clean before recompile)

Offline Slider

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: wxWidgets Project (cannot find -lwxmsw26)
« Reply #17 on: December 06, 2005, 10:22:42 pm »
Thanks for your suggestion cyberkoa, turns out it there was no environment variable for the MinGW compiler, putting it in place solved the problem. Thanks.

sviten

  • Guest
Re: wxWidgets Project (cannot find -lwxmsw26) [Solved]
« Reply #18 on: December 16, 2005, 04:11:52 pm »
Can you be more specific with your fix please?  I'm having the same issue.  What particular environment variable did you set?

Offline 280Z28

  • Regular
  • ***
  • Posts: 397
  • *insert unicode here*
Re: wxWidgets Project (cannot find -lwxmsw26) [Solved]
« Reply #19 on: December 16, 2005, 04:13:34 pm »
Can you be more specific with your fix please?  I'm having the same issue.  What particular environment variable did you set?

Yeah a bunch of people are having trouble with this still. I'll make a new thread today in the compilation forum and make it obvious, like "How-To: Compile svn head C::B in Unicode configuration"
78 280Z, "a few bolt-ons" - 12.71@109.04
99 Trans Am, "Daily Driver" - 525rwhp/475rwtq
 Check out The Sam Zone :cool:

sviten

  • Guest
Re: wxWidgets Project (cannot find -lwxmsw26) [Solved]
« Reply #20 on: December 16, 2005, 05:02:07 pm »
Yeah a bunch of people are having trouble with this still. I'll make a new thread today in the compilation forum and make it obvious, like "How-To: Compile svn head C::B in Unicode configuration"

That's great and I appreciate it but I think this thread is about compiling/linking other projects, not C::B.

sviten

  • Guest
Re: wxWidgets Project (cannot find -lwxmsw26) [Solved]
« Reply #21 on: December 16, 2005, 05:59:36 pm »
OK, I found my issue.  My issue was I could get it to compile correctly but it would not run ( as in "Process terminated with status 1" ).  My solution was to copy the dll file into the path.  To keep things clean, I copied it into the project folder.

Offline Michael

  • Lives here!
  • ****
  • Posts: 1608
Re: wxWidgets Project (cannot find -lwxmsw26) [Solved]
« Reply #22 on: December 16, 2005, 06:03:45 pm »
My solution was to copy the dll file into the path.  To keep things clean, I copied it into the project folder.

You can also add the path of the dll(s) directory in the system path (environmental variable). This is useful if other applications used the same dll(s).

Michael