Author Topic: Default Plugin Doesnt Compile  (Read 11149 times)

Offline bear24rw

  • Multiple posting newcomer
  • *
  • Posts: 15
Default Plugin Doesnt Compile
« on: August 05, 2007, 12:39:04 am »
Hi, i've been using code blocks for about a year now. I have it set up to use the mcc18 compiler for microchip and it works great with that. I want to get started developing plugins but i've been trying to get it to work now for a couple hours and I am gettin go were. I have the wxwidgets 2.8 compiled and i have the cb and wx global variables set. I also have minGW installed. After I go through the wizard and get the plugin template I try to compile and at first i get 'codeblocks' library can't be found so i go to build options and remove it from linker list then i try to compile again and i get this
Code: [Select]
.objs\HelloWorld.o:: In function `ZN10HelloWorldC2Ev':C:/Documents and Settings/User/Desktop/HelloWorld/HelloWorld.cpp:14: undefined reference to `cbToolPlugin::cbToolPlugin()'
:C:\Documents and Settings\User\Desktop\HelloWorld\HelloWorld.cpp:18: undefined reference to `_imp___ZN7Manager12LoadResourceERK8wxString'
.objs\HelloWorld.o:: In function `ZN10HelloWorldC1Ev':C:/Documents and Settings/User/Desktop/HelloWorld/HelloWorld.cpp:14: undefined reference to `cbToolPlugin::cbToolPlugin()'
:C:\Documents and Settings\User\Desktop\HelloWorld\HelloWorld.cpp:18: undefined reference to `_imp___ZN7Manager12LoadResourceERK8wxString'
.objs\HelloWorld.o:: In function `ZNK9__gnu_cxx17__normal_iteratorIPPN14BlockAllocatorI19CodeBlocksDockEventLj75ELb0EE11LinkedBlockIS2_EESt6vectorIS6_SaIS6_EEEdeEv':C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/stl_vector.h:(.text$_ZN12cbToolPluginD2Ev[cbToolPlugin::~cbToolPlugin()]+0x16): undefined reference to `cbPlugin::~cbPlugin()'
.objs\HelloWorld.o:: In function `ZN10HelloWorldC2Ev':C:/Documents and Settings/User/Desktop/HelloWorld/HelloWorld.cpp:18: undefined reference to `_imp___Z11PlaceWindowP16wxTopLevelWindow17cbPlaceDialogModeb'
.objs\HelloWorld.o:: In function `ZNK9__gnu_cxx17__normal_iteratorIPPN14BlockAllocatorI19CodeBlocksDockEventLj75ELb0EE11LinkedBlockIS2_EESt6vectorIS6_SaIS6_EEEdeEv':C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/stl_vector.h:(.rdata$_ZTV10HelloWorld[vtable for HelloWorld]+0x74): undefined reference to `cbPlugin::NotImplemented(wxString const&) const'
:C:\MinGW\bin\..\lib\gcc\mingw32\3.4.2\..\..\..\..\include\c++\3.4.2\bits\stl_vector.h:(.rdata$_ZTV12cbToolPlugin[vtable for cbToolPlugin]+0x74):: undefined reference to `cbPlugin::NotImplemented(wxString const&) const'
)]+0x7):: undefined reference to `_imp___ZN7Manager3GetEv'
)]+0x11):: undefined reference to `_imp___ZNK7Manager16GetPluginManagerEv'
)]+0x3c):: undefined reference to `_imp___ZN13PluginManager14RegisterPluginERK8wxStringPFP8cbPluginvEPFvS4_EPFvPiS9_S9_E'
:C:\MinGW\bin\..\lib\gcc\mingw32\3.4.2\..\..\..\..\include\c++\3.4.2\bits\stl_vector.h:(.text$_ZN12cbToolPluginD0Ev[cbToolPlugin::~cbToolPlugin()]+0x16):: undefined reference to `cbPlugin::~cbPlugin()'
:C:\MinGW\bin\..\lib\gcc\mingw32\3.4.2\..\..\..\..\include\c++\3.4.2\bits\stl_vector.h:(.text$_ZN12cbToolPluginD1Ev[cbToolPlugin::~cbToolPlugin()]+0x16):: undefined reference to `cbPlugin::~cbPlugin()'
:: === Build finished: 8 errors, 0 warnings ===


Shot at 2007-08-04
Someone please help me!!

Offline TDragon

  • Lives here!
  • ****
  • Posts: 936
    • Twilight Dragon Media
Re: Default Plugin Doesnt Compile
« Reply #1 on: August 05, 2007, 12:48:36 am »
i get 'codeblocks' library can't be found so i go to build options and remove it from linker list
Why on earth would you do that? Since you're developing a plugin for Code::Blocks, it stands to reason that you'd need to link with a Code::Blocks library.

You need to download the C::B sources and compile them, then set your #cb global variable to the "src" directory in the C::B sources.
http://tdm-gcc.tdragon.net/ - TDM-GCC compiler suite for Windows (GCC 5.1.0 2015-06-28, 32/64-bit, no extra DLLs)

Offline bear24rw

  • Multiple posting newcomer
  • *
  • Posts: 15
Re: Default Plugin Doesnt Compile
« Reply #2 on: August 05, 2007, 12:55:31 am »
Compile the Code::blocks source?? oh, alright ill try that i thought you just had to have them

Thank you

Offline bear24rw

  • Multiple posting newcomer
  • *
  • Posts: 15
Re: Default Plugin Doesnt Compile
« Reply #3 on: August 05, 2007, 01:02:17 am »
Alright now when i go to compile code::blocks its compiles for a while but then i halts with this
Code: [Select]
:: === Code::Blocks, scintilla ===
C:\Documents and Settings\User\Desktop\CB_20070731_rev4338_win32\source\src\sdk\wxscintilla\src\wxscintilla.cpp:531: error: no `void wxScintilla::MarkerAddSet(int, int)' member function declared in class `wxScintilla'
C:\Documents and Settings\User\Desktop\CB_20070731_rev4338_win32\source\src\sdk\wxscintilla\src\wxscintilla.cpp:1095: error: prototype for `int wxScintilla::FindText(int, int, const wxString&, int, int*)' does not match any in class `wxScintilla'
C:\wxWidgets-2.8.4\include\wx\wxscintilla.h:2240: error: candidate is: int wxScintilla::FindText(int, int, const wxString&, int)
C:\Documents and Settings\User\Desktop\CB_20070731_rev4338_win32\source\src\sdk\wxscintilla\src\wxscintilla.cpp:2473: error: no `void wxScintilla::SetPasteConvertEndings(bool)' member function declared in class `wxScintilla'
C:\Documents and Settings\User\Desktop\CB_20070731_rev4338_win32\source\src\sdk\wxscintilla\src\wxscintilla.cpp:2478: error: no `bool wxScintilla::GetPasteConvertEndings()' member function declared in class `wxScintilla'
C:\Documents and Settings\User\Desktop\CB_20070731_rev4338_win32\source\src\sdk\wxscintilla\src\wxscintilla.cpp:2483: error: no `void wxScintilla::SelectionDuplicate()' member function declared in class `wxScintilla'
C:\Documents and Settings\User\Desktop\CB_20070731_rev4338_win32\source\src\sdk\wxscintilla\src\wxscintilla.cpp:2539: error: no `int wxScintilla::GetStyleBitsNeeded()' member function declared in class `wxScintilla'
:: === Build finished: 7 errors, 0 warnings ===

Offline mariocup

  • Developer
  • Lives here!
  • *****
  • Posts: 587
Re: Default Plugin Doesnt Compile
« Reply #4 on: August 05, 2007, 01:07:46 am »
Hi bear24rw,

please try to use mingw 3.4.5 to build codeblocks from sources, so this could solve your problem. Please rebuilt the system and delete first the precompiled header (*.gch)
« Last Edit: August 05, 2007, 01:09:53 am by mariocup »

Offline bear24rw

  • Multiple posting newcomer
  • *
  • Posts: 15
Re: Default Plugin Doesnt Compile
« Reply #5 on: August 05, 2007, 01:16:04 am »
Do you know where i can find 3.4.5?

nvm found g++ 3.4.5 let me try to compile with it

I followed
http://wiki.codeblocks.org/index.php?title=Compiling_wxWidgets_2.6.2_to_develop_Code::Blocks_%28MSW%29
But with wxwidgets 2.8.x if that helps
« Last Edit: August 05, 2007, 01:25:16 am by bear24rw »

Offline mariocup

  • Developer
  • Lives here!
  • *****
  • Posts: 587
Re: Default Plugin Doesnt Compile
« Reply #6 on: August 05, 2007, 01:27:04 am »

Offline bear24rw

  • Multiple posting newcomer
  • *
  • Posts: 15
Re: Default Plugin Doesnt Compile
« Reply #7 on: August 05, 2007, 02:07:15 am »
So i deleted my mingw and followed exactly what the manual said and then i went to go build it and i get the same 7 errors as before.. what could be going on?

Offline mariocup

  • Developer
  • Lives here!
  • *****
  • Posts: 587
Re: Default Plugin Doesnt Compile
« Reply #8 on: August 05, 2007, 02:11:16 am »
To understand you problem properly: Are you able to build Codeblocks from sources now? Do you get the errors while compiling you own plugin?

Offline bear24rw

  • Multiple posting newcomer
  • *
  • Posts: 15
Re: Default Plugin Doesnt Compile
« Reply #9 on: August 05, 2007, 02:20:19 am »
Ah my problem was my own stupidity.. orginally when i was trying to compile my plugin it complained it couldnt find that .h file so i copied it to the wxwidgets folder to get rid of the error now i can compile codeblock.. thank you very much for your help

Now i just have to see if i can compile a plugin!

Offline bear24rw

  • Multiple posting newcomer
  • *
  • Posts: 15
Re: Default Plugin Doesnt Compile
« Reply #10 on: August 05, 2007, 02:32:21 am »
Alright now I can compile the hello world plugin!! :)

But... NOW when i go to install it, it says that it was made with a different version sdk or something and wont let me install it..

Offline TDragon

  • Lives here!
  • ****
  • Posts: 936
    • Twilight Dragon Media
Re: Default Plugin Doesnt Compile
« Reply #11 on: August 05, 2007, 02:42:38 am »
You need to either use the plugin with your own just-compiled C::B, or upgrade the C::B that you're trying to use it with.
http://tdm-gcc.tdragon.net/ - TDM-GCC compiler suite for Windows (GCC 5.1.0 2015-06-28, 32/64-bit, no extra DLLs)

Offline bear24rw

  • Multiple posting newcomer
  • *
  • Posts: 15
Re: Default Plugin Doesnt Compile
« Reply #12 on: August 05, 2007, 02:45:23 am »
So the plugin isnt backwards compatible?

Offline mariocup

  • Developer
  • Lives here!
  • *****
  • Posts: 587
Re: Default Plugin Doesnt Compile
« Reply #13 on: August 05, 2007, 02:46:14 am »
There are to location for codeblocks plugins. One location is the install directory share\CodeBlocks\plugins and the other in your (user) application data appdata\codeblocks\share\codeblocks\plugins.

If you install the plugin via the menu Manage Plugins, it will be save in the appdata path. So if you have two different versions in the install dir and the app data dir this will cause problems.

So try to delete the old plugin. If this will not fix the problem check the file  manifest.xml and modify the line that it looks like that.

Code: [Select]
<SdkVersion major="1" minor="11"  release="11" />
   

PS: This problem will also appear if you try to use the cb nightly and building your own plugin. Just built cb from sources and link your plugin against the required libs.
« Last Edit: August 05, 2007, 02:49:05 am by mariocup »

Offline TDragon

  • Lives here!
  • ****
  • Posts: 936
    • Twilight Dragon Media
Re: Default Plugin Doesnt Compile
« Reply #14 on: August 05, 2007, 02:49:52 am »
So the plugin isnt backwards compatible?
It's not that you're asking the plugin to be backward-compatible; it's that you're asking an older version of Code::Blocks (your nightly build, or whatever you've actually been running) to be "forward-compatible" with a plugin built for a newer version of Code::Blocks (the version you compiled from sources).
http://tdm-gcc.tdragon.net/ - TDM-GCC compiler suite for Windows (GCC 5.1.0 2015-06-28, 32/64-bit, no extra DLLs)