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

Trying to build callswizard plug-in (help needed, got stuck)

(1/3) > >>

killerbot:
While struggling on my own plug-ins I got the bright idea to see how the pro's are doing it.
So I was looking at the source code of the classwizard (build in) plug-in.
I created a cbp for it and started compiling. So far, so good.
I replace my dll, which seems to be 150 KB instead of 300KB : starting to be smelly ..., for the original one.
Start cb, choose the plug-in, getting the GUI part. BUT at that point everything is frozen.

The problem has to be in my cbp file, some compiler/linker switches missing ?

Who can help me out, and tell me what's wrong and what's needed.

This is my hand-made cbp file :
<?xml version="1.0"?>
<!DOCTYPE CodeBlocks_project_file>
<CodeBlocks_project_file>
   <FileVersion major="1" minor="1"/>
   <Project>
      <Option title="classwizard"/>
      <Option makefile="Makefile"/>
      <Option makefile_is_custom="0"/>
      <Option compiler="0"/>
      <Build>
         <Target title="default">
            <Option output="classwizard.dll"/>
            <Option working_dir="."/>
            <Option object_output=".objs"/>
            <Option deps_output=".deps"/>
            <Option type="3"/>
            <Option compiler="0"/>
         </Target>
         <Environment>
            <Variable name="WX_VER" value="26"/>
            <Variable name="WX_DIR" value="C:\wxWidgets-2.6.1"/>
            <Variable name="WX_CFG" value="NonUnicode"/>
            <Variable name="CB_SDK" value="C:\Program Files\CodeBlocks"/>
         </Environment>
      </Build>
      <Compiler>
         <Add option="-Wall"/>
         <Add option="-D__GNUWIN32__"/>
         <Add option="-DWXUSINGDLL"/>
         <Add option="-DBUILDING_PLUGIN"/>
         <Add directory="$(WX_DIR)\include"/>
         <Add directory="$(WX_DIR)\lib\gcc_dll\msw"/>
         <Add directory="$(WX_DIR)\lib\gcc_dll$(WX_CFG)\msw"/>
         <Add directory="$(WX_DIR)\contrib\include"/>
         <Add directory="$(CB_SDK)\include"/>
         <Add directory="$(CB_SDK)\sdk\include"/>
         <Add directory="$(CB_SDK)\sdk\include\wxscintilla\include"/>
      </Compiler>
      <Linker>
         <Add library="wxmsw$(WX_VER)"/>
         <Add library="codeblocks"/>
         <Add directory="$(CB_SDK)\sdk\lib"/>
      </Linker>
      <Unit filename="classwizard.cpp">
         <Option compilerVar="CPP"/>
         <Option target="default"/>
      </Unit>
      <Unit filename="classwizard.h">
         <Option compilerVar=""/>
         <Option compile="0"/>
         <Option link="0"/>
         <Option target="default"/>
      </Unit>
      <Unit filename="classwizarddlg.cpp">
         <Option compilerVar="CPP"/>
         <Option target="default"/>
      </Unit>
      <Unit filename="classwizarddlg.h">
         <Option compilerVar=""/>
         <Option compile="0"/>
         <Option link="0"/>
         <Option target="default"/>
      </Unit>
   </Project>
</CodeBlocks_project_file>


I saw in some other projects stuff like this, but don't know what it means.
         <Add option="-Winvalid-pch"/>
         <Add option="-mthreads"/>
         <Add option="-include &quot;sdk.h&quot;"/>
         <Add option="-DCB_PRECOMP"/>
         <Add option="-DWX_PRECOMP"/>
         <Add option="-DHAVE_W32API_H"/>
         <Add option="-D__WXMSW__"/>
         <Add option="-DcbDEBUG"/>
         <Add option="-DTIXML_USE_STL"/>


I gues, the pch and PRECOMP have to do with precompiled headers (bah)
I link against the wx lib provied in the cb-sdk. And to get the setup.h of wx I builded wx 2.6.1.

Many thanks,
Lieven

thomas:
Hand-made? Heaven! Don't do that :lol:
Never do something by hand at the risk of messing up things if a program does it for you in a safe, reliable way, anyway :)

Use the plugin wizard, so you get a complete, reliably working .cbp file. Plugins made with the plugin wizard work.
Or, at your option, copy the file from the original plugin, remove the sources and add your own sources.

What must be in your project is "build as dll" under Targets-->Options (obviously), at least the following compiler flags : __GNUWIN32__ WXUSINGDLL BUILDING_PLUGIN, and the link libraries wxmsw26 and codeblocks.

Also, you should absolutely make sure that you...

either compile your own wxWidgets and compile your own Code::Blocks to use the plugin

or build your plugin for use with "official" RC2 -- in that case you must use the link library that comes with the SDK.

A plugin linked against your selfmade wxmsw26 and used with RC2 will crash as soon as the plugin is loaded. Every time.

killerbot:
Well actually it was indeed a semi hand made. The cbp file was the result of the plug-in wizard and replaced the sources/units.
And I do link with the wx lib from the sdk (RC2), as you can see in the pasted cbp content. In the linker section I have even removed the dir directives to the wx directory, so I won't use the 'self compiled wx'. The only links left to the self made wx is the include paths for the compiler ('wx' headers and that setup.h).

I build the stuff on windows XP SP2.

Pecan:
killerbot

You're not alone. I'm having the same problem. C::B RC2 can
recompile the distributed RC2 plugins but I have not been
able to get any of them to run once re-compiled. They
hang C::B.

I was able to get them to run when I re-built Codeblocks from
source. But that makes my C::B something like "myRC2". Not the
distributed version.

I wanted to modify pluginwizard source, then walk the code to
learn both C::B plugins and wxWidgets. But so far I've
been unsuccessful.

But.. unfortunately, I'm glad to see I'm not alone in the
universe here...

thanks for the info
Pecan

rickg22:
I've had problems rebuilding codeblocks on my own. If I rebuild codeblocks and try to run (while using the distributed wxwidgets lib) things get awry. May be the compiler version, the wxwidgets version, a minor flag compiling wxwidgets, a minor flag compiling a library or plugin... or the setup.h. I really don't know.

Edit: This was a while ago, haven't tried with RC2.

So, this makes me wonder if the SDK distribution is sufficient for rebuilding a plugin...

Anyway, while if this problem is not solved, just try downloading the full Codeblocks sourcecode.

Navigation

[0] Message Index

[#] Next page

Go to full version