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

Slider

  • Guest
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?

Slider

  • Guest
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 »

Slider

  • Guest
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)?

Slider

  • Guest
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 :)

Slider

  • Guest
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.



Slider

  • Guest
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
C:\> CD \wxWidgets
C:\wxWidgets> DIR lib*wx*.a /s /b

And tell us what you find.

Slider

  • Guest
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: 4315
    • 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...

Slider

  • Guest
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.