Author Topic: Building Code::Blocks Plugin Wizard w/MSW  (Read 32301 times)

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Re: Building Code::Blocks Plugin Wizard w/MSW
« Reply #15 on: October 28, 2005, 10:29:18 pm »
I recall wxWidgets 2.6.1 needing a patch...

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2750
Re: Building Code::Blocks Plugin Wizard w/MSW
« Reply #16 on: October 28, 2005, 11:38:50 pm »
Mandrav, thanks for the reply

A *new* test project generated by the wizard works fine.
That's not the problem. The problem is re-compiling the
wizards, such as the pluginwizard, distributed from source
with RC2+SDK. It crashes C::B. No problem with RC1.1

If you mean that you want to see the compiler/linker settings
used to compile the wizards, I'll cut and paste 'em to
this forum shortly.  I have to feed the dog first.

thanks
Pecan

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: Building Code::Blocks Plugin Wizard w/MSW
« Reply #17 on: October 29, 2005, 12:14:46 am »
Quote
The problem is re-compiling the
wizards, such as the pluginwizard, distributed from source
with RC2+SDK. It crashes C::B. No problem with RC1.1

In that case, check the flags (mainly #defines) used in codeblocks*.cbp for PluginWizard. The PluginWizard-generated wizards *don't* have the same flags, IIRC.
Be patient!
This bug will be fixed soon...

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2750
Re: Building Code::Blocks Plugin Wizard w/MSW
« Reply #18 on: October 29, 2005, 12:44:32 am »
Thanks mandrav

Here are the settings used by the project to re-compile the pluginwizard
(same for ClassWizard). I used absolute paths in an attempt to get
control of the problem (and to simplify).

Code
[Project PluginWizard]
  sources
    enterinfodlg.cpp
    pluginwizard.cpp
    pluginwizarddlg.cp
  Headers
    enterinfodlg.h
    pluginwizard.h
    pluginwizarddlg.h

[Selected Compiler
  GNU GCC Compiler

[Compiler]
  Policy: blank
  Compiler Flags
    Enable all compiler warnings(overrides...)
  Other options
    blank
  #defines
    __GNUWIN32__
    WXUSINGDLL
    BUILDING_PLUGIN
[Linker]
  Link libraries:
    C:\Usr\CodeBlocks\codeblocks.dll
    C:\Usr\CodeBlocks\wxscintilla.dll
    C:\Usr\CodeBlocks\exchndl.dll
    C:\Usr\CodeBlocks\wxmsw26_gcc_cb.dll
[Directories]
  Compiler
    C:\Usr\CodeBlocks\codeblocks-1.0rc2-sdk\include
    C:\Usr\codeblocks\codeblocks-1.0rc2-sdk\include\wxscintilla\include
    C:\Usr\Proj\wxWidgets261\include           <--wx/wxprec.h
    C:\Usr\Proj\wxWidgets261\lib\gcc_dll\msw   <--wx/setup.h
  Linker
    blank
  Resource Compiler
    blank
Commands
  blank
Custom variables
  blank

Thanks, Pecan

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2750
Re: Building Code::Blocks Plugin Wizard w/MSW
« Reply #19 on: October 29, 2005, 01:02:40 am »
Ok, I cut this out of codeblocks.cbp from the rc2 src file.
Note that it was linked with 2.4.2. Is this what we should do?
I'm willing, I'm able. I'll do it if that's what it takes. BUT....


Code
</Target>
<Target title="plugin_PluginsWizard">
<Option output="devel\share\CodeBlocks\plugins\pluginwizard.dll"/>
<Option working_dir="."/>
<Option object_output=".objs"/>
<Option deps_output=".deps"/>
<Option external_deps=""/>
<Option type="3"/>
<Option compiler="0"/>
<Option projectLinkerOptionsRelation="1"/>
<Option projectIncludeDirsRelation="2"/>
<Option projectLibDirsRelation="2"/>
<Compiler>
<Add option="-DBUILDING_PLUGIN"/>
<Add option="-D_WINDLL"/>
<Add directory="sdk"/>
</Compiler>
<Linker>
<Add option="-Wl,--enable-auto-image-base"/>
<Add option="-Wl,--add-stdcall-alias"/>
<Add library="libcodeblocks.a"/>
<Add library="libwxscintilla.a"/>
<Add library="libwxxrc.a"/>
<Add library="wxmsw242"/>
<Add directory="devel"/>
</Linker>
</Target>

thanks, Pecan

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2750
Re: Building Code::Blocks Plugin Wizard w/MSW
« Reply #20 on: October 29, 2005, 01:11:48 am »
wups, or is this the right one ???
Code
			</Target>
<Target title="plugin_PluginsWizard">
<Option output="devel\share\CodeBlocks\plugins\pluginwizard.dll"/>
<Option working_dir="devel\share\CodeBlocks\plugins"/>
<Option object_output=".objs\2.6"/>
<Option deps_output=".deps"/>
<Option type="3"/>
<Option compiler="0"/>
<Option projectLinkerOptionsRelation="1"/>
<Option projectIncludeDirsRelation="2"/>
<Option projectLibDirsRelation="2"/>
<Compiler>
<Add option="-DBUILDING_PLUGIN"/>
<Add directory="sdk"/>
</Compiler>
<Linker>
<Add option="-Wl,--enable-auto-image-base"/>
<Add option="-Wl,--add-stdcall-alias"/>
<Add library="libcodeblocks.a"/>
<Add library="libwxscintilla.a"/>
<Add library="C:\Usr\Proj\wxWidgets261\lib\gcc_dll\wxmsw26_gcc_cb.dll"/>
<Add directory="devel"/>
</Linker>
</Target>


Pecan

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: Building Code::Blocks Plugin Wizard w/MSW
« Reply #21 on: October 29, 2005, 01:15:23 am »
Code
[Linker]
  Link libraries:
    C:\Usr\CodeBlocks\codeblocks.dll
    C:\Usr\CodeBlocks\wxscintilla.dll
    C:\Usr\CodeBlocks\exchndl.dll
    C:\Usr\CodeBlocks\wxmsw26_gcc_cb.dll

WHAT'S THIS?
You 're linking the DLLs directly?  :shock: :?
Remove those and link the following:

Code
libcodeblocks.a
libwxscintilla.a
libwxmsw26.a
Be patient!
This bug will be fixed soon...

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2750
Re: Building Code::Blocks Plugin Wizard w/MSW
« Reply #22 on: October 29, 2005, 01:48:33 am »
Thanks mandrav

Here is my attempt to translate the src codeblocks.cbp to re-compiling
pluginwizard as a project:
Code
?xml version="1.0"?>
<!DOCTYPE CodeBlocks_project_file>
<CodeBlocks_project_file>
<FileVersion major="1" minor="1"/>
<Project>
<Option title="PluginWizard"/>
<Option makefile="Makefile"/>
<Option makefile_is_custom="0"/>
<Option compiler="0"/>
<Build>
<Target title="default">
<Option output="pluginwizard.dll"/>
<Option working_dir="."/>
<Option object_output=".objs"/>
<Option deps_output=".deps"/>
<Option type="3"/>
<Option compiler="0"/>
</Target>
</Build>
<Compiler>
<Add option="-Wall"/>
<Add option="-D__GNUWIN32__"/>
<Add option="-DBUILDING_PLUGIN"/>
<Add directory="C:\Usr\CodeBlocks\codeblocks-1.0rc2-sdk\include"/>
<Add directory="c:\Usr\codeblocks\codeblocks-1.0rc2-sdk\include\wxscintilla\include"/>
<Add directory="C:\Usr\Proj\wxWidgets261\include"/>
<Add directory="C:\Usr\Proj\wxWidgets261\lib\gcc_dll\msw"/>
</Compiler>
<Linker>
<Add option="-Wl,--enable-auto-image-base"/>
<Add option="-Wl,--add-stdcall-alias"/>
<Add library="C:\Usr\CodeBlocks\codeblocks-1.0rc2-sdk\lib\libcodeblocks.a"/>
<Add library="C:\Usr\CodeBlocks\codeblocks-1.0rc2-sdk\lib\libwxscintilla.a"/>
<Add library="C:\Usr\CodeBlocks\codeblocks-1.0rc2-sdk\lib\libwxmsw26.a"/>
</Linker>
<Unit filename="enterinfodlg.cpp">
<Option compilerVar="CPP"/>
<Option target="default"/>
</Unit>
<Unit filename="enterinfodlg.h">
<Option compilerVar=""/>
<Option compile="0"/>
<Option link="0"/>
<Option target="default"/>
</Unit>
<Unit filename="pluginwizard.cpp">
<Option compilerVar="CPP"/>
<Option target="default"/>
</Unit>
<Unit filename="pluginwizard.h">
<Option compilerVar=""/>
<Option compile="0"/>
<Option link="0"/>
<Option target="default"/>
</Unit>
<Unit filename="pluginwizarddlg.cpp">
<Option compilerVar="CPP"/>
<Option target="default"/>
</Unit>
<Unit filename="pluginwizarddlg.h">
<Option compilerVar=""/>
<Option compile="0"/>
<Option link="0"/>
<Option target="default"/>
</Unit>
</Project>
</CodeBlocks_project_file>


These are the err I get:
Code
roject   : PluginWizard
Compiler  : GNU GCC Compiler (called directly)
Directory : C:\Usr\Proj\plugnwiz\
--------------------------------------------------------------------------------
Switching to target: default
Compiling: pluginwizard.cpp
Compiling: pluginwizarddlg.cpp
Compiling: enterinfodlg.cpp
Linking dynamic library: pluginwizard.dll
Info: resolving _wxEmptyString by linking to __imp__wxEmptyString (auto-import)
Info: resolving wxStringBase::npos       by linking to __imp___ZN12wxStringBase4nposE (auto-import)
Info: resolving _wxDefaultPosition by linking to __imp__wxDefaultPosition (auto-import)
Info: resolving vtable for wxMessageDialogby linking to __imp___ZTV15wxMessageDialog (auto-import)
Info: resolving wxDialog::sm_eventTable       by linking to __imp___ZN8wxDialog13sm_eventTableE (auto-import)
Info: resolving vtable for wxDialogby linking to __imp___ZTV8wxDialog (auto-import)
Info: resolving vtable for wxDialogBaseby linking to __imp___ZTV12wxDialogBase (auto-import)
Info: resolving vtable for wxTopLevelWindowby linking to __imp___ZTV16wxTopLevelWindow (auto-import)
Info: resolving vtable for wxTopLevelWindowMSWby linking to __imp___ZTV19wxTopLevelWindowMSW (auto-import)
Info: resolving _wxEVT_UPDATE_UI by linking to __imp__wxEVT_UPDATE_UI (auto-import)
Info: resolving _wxEVT_COMMAND_BUTTON_CLICKED by linking to __imp__wxEVT_COMMAND_BUTTON_CLICKED (auto-import)
Info: resolving _wxEVT_COMMAND_TEXT_UPDATED by linking to __imp__wxEVT_COMMAND_TEXT_UPDATED (auto-import)
Info: resolving _wxEVT_NULL by linking to __imp__wxEVT_NULL (auto-import)
.objs\pluginwizard.o:pluginwizard.cpp:(.text$_ZN15wxMessageDialogD1Ev[wxMessageDialog::~wxMessageDialog()]+0xb): variable 'vtable for wxMessageDialog' can't be auto-imported. Please read the documentation for ld's --enable-auto-import for details.
.objs\pluginwizarddlg.o:pluginwizarddlg.cpp:(.text$_ZN8wxDialogC2Ev[wxDialog::wxDialog()]+0x4c): variable 'vtable for wxDialog' can't be auto-imported. Please read the documentation for ld's --enable-auto-import for details.
.objs\pluginwizarddlg.o:pluginwizarddlg.cpp:(.text$_ZN12wxDialogBaseD2Ev[wxDialogBase::~wxDialogBase()]+0xb): variable 'vtable for wxDialogBase' can't be auto-imported. Please read the documentation for ld's --enable-auto-import for details.
.objs\pluginwizarddlg.o:pluginwizarddlg.cpp:(.text$_ZN12wxDialogBaseC2Ev[wxDialogBase::wxDialogBase()]+0x4c): variable 'vtable for wxDialogBase' can't be auto-imported. Please read the documentation for ld's --enable-auto-import for details.
.objs\pluginwizarddlg.o:pluginwizarddlg.cpp:(.text$_ZN16wxTopLevelWindowD2Ev[wxTopLevelWindow::~wxTopLevelWindow()]+0xb): variable 'vtable for wxTopLevelWindow' can't be auto-imported. Please read the documentation for ld's --enable-auto-import for details.
.objs\pluginwizarddlg.o:pluginwizarddlg.cpp:(.text$_ZN16wxTopLevelWindowC2Ev[wxTopLevelWindow::wxTopLevelWindow()]+0x4c): variable 'vtable for wxTopLevelWindow' can't be auto-imported. Please read the documentation for ld's --enable-auto-import for details.
.objs\pluginwizarddlg.o:pluginwizarddlg.cpp:(.text$_ZN19wxTopLevelWindowMSWC2Ev[wxTopLevelWindowMSW::wxTopLevelWindowMSW()]+0x4c): variable 'vtable for wxTopLevelWindowMSW' can't be auto-imported. Please read the documentation for ld's --enable-auto-import for details.
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 11 seconds)
0 errors, 0 warnings
 


I smell "nearly" success again, after 4 days. An' that's pretty smelly  :D

thanks, Pecan


Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: Building Code::Blocks Plugin Wizard w/MSW
« Reply #23 on: October 29, 2005, 09:59:33 am »
Where's WXUSINGDLL?
Be patient!
This bug will be fixed soon...

Zlika

  • Guest
Re: Building Code::Blocks Plugin Wizard w/MSW
« Reply #24 on: October 29, 2005, 10:33:55 am »
rickg22, which patch do you speak about?  :oops:

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2750
Re: Building Code::Blocks Plugin Wizard w/MSW
« Reply #25 on: October 29, 2005, 03:34:07 pm »
mandrav

Thanks for the suggestion
I put WXUSINGDLL into the #defines. Pluginwizard compiled and
linked ok. But it still hangs C::B. the size of the dll is 191,515 bytes if
thats any importance. Here is the latest .cbp
Code
<?xml version="1.0"?>
<!DOCTYPE CodeBlocks_project_file>
<CodeBlocks_project_file>
<FileVersion major="1" minor="1"/>
<Project>
<Option title="PluginWizard"/>
<Option makefile="Makefile"/>
<Option makefile_is_custom="0"/>
<Option compiler="0"/>
<Build>
<Target title="default">
<Option output="pluginwizard.dll"/>
<Option working_dir="."/>
<Option object_output=".objs"/>
<Option deps_output=".deps"/>
<Option type="3"/>
<Option compiler="0"/>
</Target>
</Build>
<Compiler>
<Add option="-Wall"/>
<Add option="-D__GNUWIN32__"/>
<Add option="-DBUILDING_PLUGIN"/>
<Add option="-DWXUSINGDLL"/>
<Add directory="C:\Usr\CodeBlocks\codeblocks-1.0rc2-sdk\include"/>
<Add directory="c:\Usr\codeblocks\codeblocks-1.0rc2-sdk\include\wxscintilla\include"/>
<Add directory="C:\Usr\Proj\wxWidgets261\include"/>
<Add directory="C:\Usr\Proj\wxWidgets261\lib\gcc_dll\msw"/>
</Compiler>
<Linker>
<Add option="-Wl,--enable-auto-image-base"/>
<Add option="-Wl,--add-stdcall-alias"/>
<Add library="C:\Usr\CodeBlocks\codeblocks-1.0rc2-sdk\lib\libcodeblocks.a"/>
<Add library="C:\Usr\CodeBlocks\codeblocks-1.0rc2-sdk\lib\libwxscintilla.a"/>
<Add library="C:\Usr\CodeBlocks\codeblocks-1.0rc2-sdk\lib\libwxmsw26.a"/>
</Linker>
<Unit filename="enterinfodlg.cpp">
<Option compilerVar="CPP"/>
<Option target="default"/>
</Unit>
<Unit filename="enterinfodlg.h">
<Option compilerVar=""/>
<Option compile="0"/>
<Option link="0"/>
<Option target="default"/>
</Unit>
<Unit filename="pluginwizard.cpp">
<Option compilerVar="CPP"/>
<Option target="default"/>
</Unit>
<Unit filename="pluginwizard.h">
<Option compilerVar=""/>
<Option compile="0"/>
<Option link="0"/>
<Option target="default"/>
</Unit>
<Unit filename="pluginwizarddlg.cpp">
<Option compilerVar="CPP"/>
<Option target="default"/>
</Unit>
<Unit filename="pluginwizarddlg.h">
<Option compilerVar=""/>
<Option compile="0"/>
<Option link="0"/>
<Option target="default"/>
</Unit>
</Project>
</CodeBlocks_project_file>

thanks
Pecan

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2750
Re: Building Code::Blocks Plugin Wizard w/MSW
« Reply #26 on: October 29, 2005, 03:45:44 pm »
Zlika,
I found this at www.wxwindows.org/patch/htm
But I dont know that it has anything to do with
the problem.
If applied, I think you'd have to re-compile C::B. That
would fix the problem alright. But it doesnt solve the
current hang with the distributed C::B.
You can re-compile C::B now (without the patch) and the
problem goes away too.
BUT... it does not guarentee that any plugin you write under
the re-compiled C::B will work for anyone else who is using
the distributed C::B RC2 package.

Pecan

Patches for 2.6.1

Various wxMSW fixes

    This patch fixes the following problems on Windows:

        * Crash on exit when destroying wxCHMHelpController in wxApp::OnExit.
        * wxListBox, wxCheckListBox scrolling glitch when Windows effects are enabled.
        * Wrong area sometimes being refreshed after a window is resized.
        * Notebook refreshing the wrong area when resized.
        * Problem for non-VC++ compilers where some toolbar tooltips cause a crash.
        * An eVC++ 3 compile error.

    Please download wxWidgets-2.6.1-Patch01.zip and unarchive from the top level of your wxWidgets tree.

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: Building Code::Blocks Plugin Wizard w/MSW
« Reply #27 on: October 29, 2005, 04:17:01 pm »
Pecan,

we have a two pages long topic here for you trying to build the pluginwizard outside c::b. May I know what this is for?!?
You already said tha plugins generated by the wizard work ok for you...
Be patient!
This bug will be fixed soon...

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2750
Re: Building Code::Blocks Plugin Wizard w/MSW
« Reply #28 on: October 29, 2005, 05:35:29 pm »
mandrav

I am not building pluginwizard outside C::B. I'm trying
to re-compile it *inside* C::B.

The purpose? I think the best way to learn is to read the
experts code. The C::B plugins use both the facilities of
C::B code and the wxWidgets code. What better way to
learn.

I wanted to learn to  modify the pluginwizard to generate
.cbp's that point to the locations/folders on my system.
I wanted to use GDB on pluginwizard to walk the code.
I wanted to learn and contribute.

So.. I tried to compile the pluginwizard. And that's when
it all started....

thanks
Pecan

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5490
Re: Building Code::Blocks Plugin Wizard w/MSW
« Reply #29 on: October 29, 2005, 05:51:18 pm »
I am having alike problems, freezing CB, also by 'trying' to rebuild an existing plug-in (see my post about class wizard in Plugins devlopment section), I did not try this with RC1.1, only with RC2. I wonder if the problems might be related.

Lieven