User forums > Using Code::Blocks

Is this a linker error.

(1/3) > >>

abhinav:
hi All,


I am new in code::blocks.

Today i install code::blockand wxwidgets and try to run default project.
Following error message accoured when ever i try to compile it.
Project   : wxWidgets application
Compiler  : GNU GCC Compiler (called directly)
Directory : C:\Documents and Settings\Icreon\Desktop\testpro\test1\
--------------------------------------------------------------------------------
Switching to target: default
Precompiling header: wx_pch.h
Compiling: main.cpp
Linking executable: C:\Documents and Settings\Icreon\Desktop\testpro\test1\test1.exe
C:\MinGW\bin\..\lib\gcc\mingw32\3.4.2\..\..\..\..\mingw32\bin\ld.exe: cannot find -lwxmsw26
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 15 seconds)
1 errors, 0 warnings

Thanks
Abhinav

Biplab:
It seems that you didn't compile wxWidgets. Please compile it.

Another point, are you using latest nightlies? If not, please use latest nightlies. In the latest nightlies, wxWidgets support is greatly improved. :)

MortenMacFly:

--- Quote from: Biplab on February 20, 2007, 12:14:35 pm ---It seems that you didn't compile wxWidgets. Please compile it.

--- End quote ---
Another possibility would be that he has just forgotten to add the path to the (compiled) wx libs in the linker path options.
With regards, Morten.

abhinav:
Hi Morten,

i have set what you suggest in last post, but following message are cpming now at the compilation time.


Project   : wxWidgets application
Compiler  : GNU GCC Compiler (called directly)
Directory : C:\Documents and Settings\Icreon\Desktop\testpro\test1\
--------------------------------------------------------------------------------
Switching to target: default
mingw32-g++.exe   -LC:\wxWidgets-2.8.0\lib\gcc_dll  -LC:\MinGW\lib -LC:\wxWidgets-2.8.0\lib\gcc_dll -LC:\wxWidgets-2.8.0\lib\gcc_dll\msw -o "C:\Documents and Settings\Icreon\Desktop\testpro\test1\test2.exe" .objs\main.o        -lwxmsw26  -mwindows
C:\MinGW\bin\..\lib\gcc\mingw32\3.4.2\..\..\..\..\mingw32\bin\ld.exe: cannot find -lwxmsw26
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 0 seconds)
1 errors, 0 warnings



Thanks

Abhinav 

Biplab:
Hi Abhinav,

The error is simple. You are using wxWidgets 2.8.0 but in your project file wxWidgets-2.6.x library is added to linker.

Are you using latest nightly? If Not, then please download and recreate the project. With newer wizard you'll get option to configure your project for wxWidgets-2.8.x. Older wizard uses wxWidgets-2.6.x by default.

Regards,

Biplab

Navigation

[0] Message Index

[#] Next page

Go to full version