Developer forums (C::B DEVELOPMENT STRICTLY!) > Plugins development

Help compiling example plugin

(1/2) > >>

Pecan:
I've tried two days to compile the example plugin generated
by the wizard. I've added no code to it, and tried following
the directions provided by the "Hello World" tutorials.
I've downloaded, and installed wxWidgets 2.6.1 (wx_msw-2.6).

The widget examples compile and run, and all my Dev-cpp projects import, compile, and execute beautifully. (win xp sp2).

However, when linking a plugin, the linker finds all sorts of duplicates
and missing references. What is causing this?

I'd appreciate any help given.
 Thanks, Pecan

[Directories/Compiler entries]
..\..\CodeBlocks\SDK\include
..\..\CodeBlocks\lib\wx\include\msw-ansi-release-static-2.6
..\..\CodeBlocks\include\wx-2.6

[Directories/Linker entries]
..\..\CodeBlocks\SDK\lib

[Compiler Options]
__GNUWIN32__
WXUSINGDLL
BUILDING_PLUGIN
__WXMSW__  <<I threw this in just to see if it had an effect. Answer: none

[Linker/Link Libraries entries]
codeblocks
wxmsw  <<this was my last try with the 2.4.2 lib

[have also tried wx_msw-2.6 and get same results]
[ as below]

[error window output]

Project   : Custom Plugin
Compiler  : GNU GCC Compiler (called directly)
Directory : C:\Usr\Proj\temp\
--------------------------------------------------------------------------------
Switching to target: default
Compiling: untitled1.cpp
Linking dynamic library: Untitled1.dll
..\..\CodeBlocks\SDK\lib/libwxmsw.a(event.o):event.cpp:(.text$_ZNK12wxEvtHandler12GetClassInfoEv[wxEvtHandler::GetClassInfo() const]+0x0): multiple definition of `wxEvtHandler::GetClassInfo() const'
..\..\CodeBlocks\SDK\lib/libcodeblocks.a(d003971.o):: first defined here
..\..\CodeBlocks\SDK\lib/libwxmsw.a(string.o):string.cpp:(.text+0x5a2): multiple definition of `wxString::operator=(char const*)'
.objs\untitled1.o:untitled1.cpp:(.text$_ZN8wxStringaSEPKc[wxString::operator=(char const*)]+0x0): first defined here
.objs\untitled1.o:untitled1.cpp:(.text$_ZN8wxStringaSEPKc[wxString::operator=(char const*)]+0x14): undefined reference to `_imp___ZN12wxStringBaseaSEPKc'
.objs\untitled1.o:untitled1.cpp:(.text$_ZN12wxStringBaseC2EPKc[wxStringBase::wxStringBase(char const*)]+0x7): undefined reference to `_imp___ZN12wxStringBase4nposE'
.objs\untitled1.o:untitled1.cpp:(.text$_ZN12wxStringBaseC2EPKc[wxStringBase::wxStringBase(char const*)]+0x27): undefined reference to `_imp___ZN12wxStringBase8InitWithEPKcjj'
.objs\untitled1.o:untitled1.cpp:(.rdata$_ZTV9Untitled1[vtable for Untitled1]+0x4c): undefined reference to `wxEvtHandler::TryParent(wxEvent&)'
.objs\untitled1.o:untitled1.cpp:(.rdata$_ZTV9Untitled1[vtable for Untitled1]+0x54): undefined reference to `wxEvtHandler::GetEventHashTable() const'
.objs\untitled1.o:untitled1.cpp:(.rdata$_ZTV12cbToolPlugin[vtable for cbToolPlugin]+0x4c): undefined reference to `wxEvtHandler::TryParent(wxEvent&)'
.objs\untitled1.o:untitled1.cpp:(.rdata$_ZTV12cbToolPlugin[vtable for cbToolPlugin]+0x54): undefined reference to `wxEvtHandler::GetEventHashTable() const'
..\..\CodeBlocks\SDK\lib/libwxmsw.a(app.o):app.cpp:(.text+0x413): undefined reference to `InitCommonControls@0'
..\..\CodeBlocks\SDK\lib/libwxmsw.a(app.o):app.cpp:(.text+0x41a): undefined reference to `OleInitialize@4'
..\..\CodeBlocks\SDK\lib/libwxmsw.a(app.o):app.cpp:(.text+0x477): undefined reference to `CreateBrushIndirect@4'
..\..\CodeBlocks\SDK\lib/libwxmsw.a(app.o):app.cpp:(.text+0x484): undefined reference to `DeleteObject@4'
..\..\CodeBlocks\SDK\lib/libwxmsw.a(app.o):app.cpp:(.text+0x8d1): undefined reference to `DeleteObject@4'
..\..\CodeBlocks\SDK\lib/libwxmsw.a(app.o):app.cpp:(.text+0x8d6): undefined reference to `OleUninitialize@0'
..\..\CodeBlocks\SDK\lib/libwxmsw.a(window.o):window.cpp:(.text+0x1758): undefined reference to `SelectObject@8'

mandrav:
You have probably missed that Code::Blocks (and therefore its plugins) need a wxWidgets DLL to link to, not a static library...

Pecan:
Ok, thanks. Are there any instructions for
making the wxWidgets.DLL somewhere?
Was it in the DevPak? Anyway, it got pass me.
Where can I get it.

Thanks,
Pecan

sethjackson:
Go here. :) I think this will help you.

http://wiki.codeblocks.org/index.php/Compiling_wxWidgets_2.6.1_to_develop_Code::Blocks_%28MSW%29

Pecan:
Thank you mandrav & sethjackson.

I followed the directions from
http://wiki.codeblocks.org/index.php/Compiling_wxWidgets_2.6.1_to_develop_Code::Blocks_%28MSW%29

All seemed to go well, creating DLLs wxmsw26_gcc_cb.dll and wxmsw26_stc_gcc_cb.dll which I moved to a dir on the search path.

..AND..the wizard generated plugin compiled, producing "untitled1.dll"
which I moved to ..\CodeBlocks\share\CodeBlocks\plugins\ .

Now, however, with the DLL in the plugins directory (win xp sp2)
C::B shows the splash screen, then crashes. Removing the plugin allows
C::B to run again.

What do I do now. I think I'm smelling something close to success!
What have I failed to do??

Another thought. Is it the case that a plugins wxWidgets version has to be the same
version as C::B's wxWidgets version??

I'm using wxWidgets 2.6.2 to make the plugin.

Thanks

Navigation

[0] Message Index

[#] Next page

Go to full version