Author Topic: Compiling Plugins with the latest SDK  (Read 9477 times)

Offline jayatk

  • Multiple posting newcomer
  • *
  • Posts: 40
Compiling Plugins with the latest SDK
« on: January 26, 2006, 05:19:45 pm »
Since I found out it's best to use the latest SDK,  I'm having trouble compiling a simple plugin using the UNICODE version of Codeblocks (rev 1870) and WxWidgets 2.6.2.

Here's my error:
Linking dynamic library: MouseSearch.dll
C:\Program Files\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)
1 errors, 0 warnings
 

I don't understand why it wants to link against the non-unicode version of the wxWidgets library.

I've attached some shots of my settings which I copied from contrib plugin projects.  I had no problems compiling the contrib plugins off the SVN, once I got the directories set up correctly.

#CB and #WX are setup correctly.
WX_SUFFIX = u

Linker libraries:
libcodeblocks.a (latest build)
libwxscintilla.a
libwxmsw26u.a


I know I must be doing something stupid again, but this mingw32\WxWidgets\Codeblocks development enviroment is all new to me.


[attachment deleted by admin]

Offline tiwag

  • Developer
  • Lives here!
  • *****
  • Posts: 1196
  • sailing away ...
    • tiwag.cb
Re: Compiling Plugins with the latest SDK
« Reply #1 on: January 26, 2006, 05:24:24 pm »
what do you have in the "Linker" tab ?

maybe there is specified
wxmsw26
instead of
wxmsw26u
or some construct like
wxmsw26$(WX_SUFFIX)

takeshimiya

  • Guest
Re: Compiling Plugins with the latest SDK
« Reply #2 on: January 26, 2006, 05:26:39 pm »
Also notice that in Directores->Compiler, there is a typo: $(CB.INCLUDE)\tinyxml. It should use the syntax of global variables: $(#CB.INCLUDE)\tinyxml.

Offline jayatk

  • Multiple posting newcomer
  • *
  • Posts: 40
Re: Compiling Plugins with the latest SDK
« Reply #3 on: January 26, 2006, 05:28:39 pm »
what do you have in the "Linker" tab ?

maybe there is specified
wxmsw26
instead of
wxmsw26u
or some construct like
wxmsw26$(WX_SUFFIX)

Here it is.

I tried changing it to just:
codeblocks
wxmsw26$(WX_SUFFIX)
wxscintilla

No go. :(

[attachment deleted by admin]

Offline jayatk

  • Multiple posting newcomer
  • *
  • Posts: 40
Re: Compiling Plugins with the latest SDK
« Reply #4 on: January 26, 2006, 05:29:19 pm »
Also notice that in Directores->Compiler, there is a typo: $(CB.INCLUDE)\tinyxml. It should use the syntax of global variables: $(#CB.INCLUDE)\tinyxml.

I'll fix that. THanks.

Offline tiwag

  • Developer
  • Lives here!
  • *****
  • Posts: 1196
  • sailing away ...
    • tiwag.cb
Re: Compiling Plugins with the latest SDK
« Reply #5 on: January 26, 2006, 05:37:37 pm »
post your projectfile here

Offline jayatk

  • Multiple posting newcomer
  • *
  • Posts: 40
Re: Compiling Plugins with the latest SDK
« Reply #6 on: January 26, 2006, 05:46:32 pm »
I noticed the first linker options:

            <Linker>
               <Add library="C:\Program Files\CodeBlocks\sdk\lib\libcodeblocks.a" />
               <Add library="..\..\sdk\lib\libwxmsw26.a" />
               <Add directory="C:\Program Files\CodeBlocks\sdk\lib" />
            </Linker>

I thought I deleted that.  Same for the Compiler options up top.

I assume I need to remove that set of options?

[attachment deleted by admin]

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: Compiling Plugins with the latest SDK
« Reply #7 on: January 26, 2006, 05:55:58 pm »
Hasn't anyone noticed that in the linker options the policy is set to "Use project options only"?
Which ignores all the target settings in that page?
Be patient!
This bug will be fixed soon...

Offline jayatk

  • Multiple posting newcomer
  • *
  • Posts: 40
Re: Compiling Plugins with the latest SDK
« Reply #8 on: January 26, 2006, 06:00:26 pm »
Hasn't anyone noticed that in the linker options the policy is set to "Use project options only"?
Which ignores all the target settings in that page?

I did append target options to project options in the very beginning. No difference.

However, I removed those <Linker> options and saved my project file again.  Set it back to append target options....

Now my error has changed.

------------- Build: default in MouseSearch ---------------
Linking dynamic library: MouseSearch.dll
.objs\mousesearch.o: In function `GetPluginsCount':
C:/PROJECTS/CodeBlocksPluginDev/MouseSearch/mousesearch.cpp:325: undefined reference to `_imp___ZN12wxStringBase8InitWithEPKcjj'
C:/PROJECTS/CodeBlocksPluginDev/MouseSearch/mousesearch.cpp:325: undefined reference to `_imp___ZNK8wxLocale9GetStringEPKcS1_'
.objs\mousesearch.o: In function `ZN8cbPlugin21GetConfigurationPanelEP8wxWindow':
C:/Program Files/CodeBlocks/sdk/cbplugin.h:(.text$_ZN8wxStringaSEPKc[wxString::operator=(char const*)]+0x14): undefined reference to `_imp___ZN12wxStringBaseaSEPKc'
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 1 seconds)
2 errors, 0 warnings

BTW, the code is a empty pluging generated by the Plugins wizard.

takeshimiya

  • Guest
Re: Compiling Plugins with the latest SDK
« Reply #9 on: January 26, 2006, 06:01:37 pm »
Hasn't anyone noticed that in the linker options the policy is set to "Use project options only"?
Which ignores all the target settings in that page?

lol :lol: that's true.
I was about to say that the screenshoots and the project file wasn't even the same project. :lol:

Offline jayatk

  • Multiple posting newcomer
  • *
  • Posts: 40
Re: Compiling Plugins with the latest SDK
« Reply #10 on: January 26, 2006, 06:07:02 pm »
Is this better? :D

[attachment deleted by admin]

Offline tiwag

  • Developer
  • Lives here!
  • *****
  • Posts: 1196
  • sailing away ...
    • tiwag.cb
Re: Compiling Plugins with the latest SDK
« Reply #11 on: January 26, 2006, 06:11:39 pm »
try this one
you have to specify the global variable CB
it works for me (tested !)

[attachment deleted by admin]

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: Compiling Plugins with the latest SDK
« Reply #12 on: January 26, 2006, 06:13:12 pm »
Quote
Now my error has changed.

When you 're getting linking errors related to wxString, it's almost always the case of unicode. So re-build your plugin but remember to set wxUSE_UNICODE in #defines.
Be patient!
This bug will be fixed soon...

Offline jayatk

  • Multiple posting newcomer
  • *
  • Posts: 40
Re: Compiling Plugins with the latest SDK
« Reply #13 on: January 26, 2006, 07:46:11 pm »
Rebuild worked.

Thanks so much again!