Author Topic: Is this a linker error.  (Read 8234 times)

abhinav

  • Guest
Is this a linker error.
« on: February 20, 2007, 12:02:26 pm »
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

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: Is this a linker error.
« Reply #1 on: February 20, 2007, 12:14:35 pm »
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. :)
Be a part of the solution, not a part of the problem.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Is this a linker error.
« Reply #2 on: February 20, 2007, 12:59:25 pm »
It seems that you didn't compile wxWidgets. Please compile it.
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.
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

abhinav

  • Guest
Re: Is this a linker error.
« Reply #3 on: February 20, 2007, 02:04:43 pm »
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 

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: Is this a linker error.
« Reply #4 on: February 20, 2007, 02:12:02 pm »
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
Be a part of the solution, not a part of the problem.

abhinav

  • Guest
Re: Is this a linker error.
« Reply #5 on: February 20, 2007, 02:32:13 pm »
Hi Biplab,

Could you please give me a lick for required latest nightly?

Thanks,

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: Is this a linker error.
« Reply #6 on: February 20, 2007, 02:53:30 pm »
Visit the following section of Code::Blocks forum.

http://forums.codeblocks.org/index.php?board=20.0

Then read the latest release announcement and download links are available in the corresponding thread. At the time of writing latest nightly can be downloaded from the following thread.

http://forums.codeblocks.org/index.php?topic=5214.0

Regards,

Biplab
Be a part of the solution, not a part of the problem.

abhinav

  • Guest
Re: Is this a linker error.
« Reply #7 on: February 28, 2007, 02:29:03 pm »
Hi Biplab,

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.

I have check all options and setting but same problem are occured again and again.

 

Project   : test
Compiler  : GNU GCC Compiler (called directly)
Directory : C:\Documents and Settings\Icreon\Desktop\testpro\dl2\test\
--------------------------------------------------------------------------------
Switching to target: Debug
mingw32-g++.exe   -LC:\wxWidgets-2.8.0\lib\gcc_dll -LC:\wxWidgets-2.8.0\lib\gcc_dll  -LC:\CodeBlocks\lib -o bin\Debug\test.exe        -lwxmsw26 -lcomctl32 -lgdi32 -lole32 -loleaut32 -luuid -lwxmsw26 -lcomctl32 -lgdi32 -lole32 -loleaut32 -luuid
C:\CodeBlocks\bin\..\lib\gcc\mingw32\3.4.4\..\..\..\..\mingw32\bin\ld.exe: cannot find -lwxmsw26
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 0 seconds)

thanks
Abhinav

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: Is this a linker error.
« Reply #8 on: February 28, 2007, 02:47:30 pm »
Hi Abhinav,

I'm quite sure that you are using a old version of C::B. Please download a latest nightly version from the link that I've provided earlier and recreate your project files. It should solve the problem.

I'm posting the link of last nightly.
http://forums.codeblocks.org/index.php/topic,5289.0.html

If you still face the problem, try uploading your project file so that I can have a look.

Regards,

Biplab :)
Be a part of the solution, not a part of the problem.

abhinav

  • Guest
Re: Is this a linker error.
« Reply #9 on: February 28, 2007, 04:31:51 pm »
Hi Biplab,

Thanks for reply.

You are right i am using old version of C::B(v1). I have already downloaded new nightly version but not set it yet.
I will set it after your reply.
Here i write the steps what i fallow to generate a new test project (very simple).

1. Opened C::B editor.
2. Clicked on Create a new project Link.
3. New Form Template  opened.
4. Selected wxwidgets Application option.
4.1 i had set Project Options :"Using wzwidgets dll".
4.2 I had set Files options: "No Header File".
5. Clicked on create button.
6. Create default wxwidgets project.
   " When ever i have create new project A notice windows appear with following message." while i have set that variable before creating new project.
      "This template expects wxwidgets to be located at c:wxWidgets-2.6.2 if this is not the case, you will have to update the relevant custom variable accordingly. to do this click on "Project->building option->Custom variable" "

following out put occurred when ever i try to build.


Project   : wxWidgets application
Compiler  : GNU GCC Compiler (called directly)
Directory : C:\Documents and Settings\Icreon\Desktop\testpro\dl2\test\New Folder\New Folder\
--------------------------------------------------------------------------------
Switching to target: default
mingw32-g++.exe   -Wall -g -pipe -mthreads -Winvalid-pch -include "wx_pch.h" -D__GNUWIN32__ -D__WXMSW__ -DWXUSINGDLL -DUSE_PCH    -IC:\wxWidgets-2.8.0\include -IC:\wxWidgets-2.8.0\lib\gcc_dll\msw -IC:\wxWidgets-2.8.0\contrib\include  -IC:\CodeBlocks\include -c wx_pch.h -o wx_pch.h.gch
mingw32-g++.exe   -Wall -g -pipe -mthreads -Winvalid-pch -include "wx_pch.h" -D__GNUWIN32__ -D__WXMSW__ -DWXUSINGDLL -DUSE_PCH    -IC:\wxWidgets-2.8.0\include -IC:\wxWidgets-2.8.0\lib\gcc_dll\msw -IC:\wxWidgets-2.8.0\contrib\include  -IC:\CodeBlocks\include -c main.cpp -o .objs\main.o
mingw32-g++.exe   -LC:\wxWidgets-2.8.0\lib\gcc_dll  -LC:\CodeBlocks\lib -o "C:\Documents and Settings\Icreon\Desktop\testpro\dl2\test\New Folder\New Folder\wxWidgets.exe" .objs\main.o        -lwxmsw26  -mwindows
C:\CodeBlocks\bin\..\lib\gcc\mingw32\3.4.4\..\..\..\..\mingw32\bin\ld.exe: cannot find -lwxmsw26
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 13 seconds)


Waiting for suggestion.
Thanks
Abhinav :)


 
   
 

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: Is this a linker error.
« Reply #10 on: February 28, 2007, 05:01:21 pm »
Hi Abhinav,

I'm well aware of this problem and that is the reason why I'm requesting you to upgrade.

In old wizard, support for wxWidgets was Hard-Coded. Means you can't change it easily without manual editing of Project file outside C::B. And it was hard-coded for wxWidgets-2.6.

In newer wizard, you follow step by step procedures and it will create you a proper project file for wx-2.6, 2.8 or 2.9. It support for wx has been completely revamped.

So my request to you, don't play with Old RC2 or even a nightly build which has been released in January 2007 to start working with wxWidgets. For other features, you can use older releases though I would recommend you for a latest nightly.

Suggestion for old RC2: Open project file in Notepad and Replace -lwxmsw26 with -lwxmsw28 Hopefully this will work in your case. :)

Regards,

Biplab :)
Be a part of the solution, not a part of the problem.

abhinav

  • Guest
Re: Is this a linker error.
« Reply #11 on: March 01, 2007, 07:44:21 am »
Hi Biplab,

I have upgrede my C::B and installed new nightly and following message appear in build log.


-------------- Build: Debug in test1 ---------------
Skipping file (no compiler program set): wx_pch.h
mingw32-g++.exe -LC:\wxWidgets-2.8.0\lib\gcc_dll -LC:\wxWidgets-2.8.0\lib\gcc_dll  -o bin\Debug\test1.exe obj\Debug\main.o obj\Debug\app.o    -lwxmsw26u -lcomctl32 -lgdi32 -lole32 -loleaut32 -luuid -lwxmsw26u -lcomctl32 -lgdi32 -lole32 -loleaut32 -luuid
C:\CodeBlocks\bin\..\lib\gcc\mingw32\3.4.4\..\..\..\..\mingw32\bin\ld.exe: cannot find -lwxmsw26u
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 0 seconds)
1 errors, 0 warnings

same problem with new nightly.


Regards,
Abhinav

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: Is this a linker error.
« Reply #12 on: March 01, 2007, 07:57:50 am »
Did you recreate the project file?? This is very important. Wizard creates a project file and C::B tries to compile that project.

So if you are using old project file with wrong settings in new nightly, the wrong settings will not be corrected automatically by the new wizard. Please recreate the project.

In new wizard select the wxWidgets version 2.8.x at the beginning and then proceed with other options.
Be a part of the solution, not a part of the problem.