Author Topic: Default Plugin Doesnt Compile  (Read 17413 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
.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: 943
    • TDM-GCC
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.
https://jmeubank.github.io/tdm-gcc/ - TDM-GCC compiler suite for Windows (GCC 9.2.0 2020-03-08, 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
:: === 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 ===

mariocup

  • Guest
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 »

mariocup

  • Guest
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?

mariocup

  • Guest
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: 943
    • TDM-GCC
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.
https://jmeubank.github.io/tdm-gcc/ - TDM-GCC compiler suite for Windows (GCC 9.2.0 2020-03-08, 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?

mariocup

  • Guest
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
<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: 943
    • TDM-GCC
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).
https://jmeubank.github.io/tdm-gcc/ - TDM-GCC compiler suite for Windows (GCC 9.2.0 2020-03-08, 32/64-bit, no extra DLLs)

Offline bear24rw

  • Multiple posting newcomer
  • *
  • Posts: 15
Re: Default Plugin Doesnt Compile
« Reply #15 on: August 05, 2007, 03:01:26 am »
Alright i'm still unclear on how to get my plugin to work with the nightly ive been using (8-3-07)

Offline TDragon

  • Lives here!
  • ****
  • Posts: 943
    • TDM-GCC
Re: Default Plugin Doesnt Compile
« Reply #16 on: August 05, 2007, 03:16:11 am »
Well, the August 3rd nightly was based on SVN revision 4346, so the best way to ensure compatibility is to download that specific source revision:
Code
svn co svn://svn.berlios.de/codeblocks/trunk -r 4346
(Or, if using TortoiseSVN, just use 4346 instead of the HEAD revision.)

You can basically use your nightly build to build an almost-identical version from these new sources, then rebuild your plugin to link to this just-built version.
https://jmeubank.github.io/tdm-gcc/ - TDM-GCC compiler suite for Windows (GCC 9.2.0 2020-03-08, 32/64-bit, no extra DLLs)

Offline bear24rw

  • Multiple posting newcomer
  • *
  • Posts: 15
Re: Default Plugin Doesnt Compile
« Reply #17 on: August 05, 2007, 03:24:29 am »
Alright it makes sense now.. im downloading 4346 so i can rebuild it like you said

Thanks for all you help

Offline bear24rw

  • Multiple posting newcomer
  • *
  • Posts: 15
Re: Default Plugin Doesnt Compile
« Reply #18 on: August 05, 2007, 03:48:09 am »
aghhh this is getting really fustrating.. here is what i did

REdownloaded 4346 nightly. downloaded 4346 sources
compiled 4346 sources with 4346 nightly
opened my helloworld project and compiled it
tried to add it to plugins.. same message about it being built with a different sdk

Offline bear24rw

  • Multiple posting newcomer
  • *
  • Posts: 15
Re: Default Plugin Doesnt Compile
« Reply #19 on: August 05, 2007, 03:53:12 am »
The plugin works if i use it with the cb i compiled.. but does this mean that i can only use it with my compiled version or do i just have to wait for a new nightly to come out

Offline dmoore

  • Developer
  • Lives here!
  • *****
  • Posts: 1576
Re: Default Plugin Doesnt Compile
« Reply #20 on: August 05, 2007, 04:31:11 am »
try linking against dlls that come with your nightly build instead of your self-compiled versions.

Offline bear24rw

  • Multiple posting newcomer
  • *
  • Posts: 15
Re: Default Plugin Doesnt Compile
« Reply #21 on: August 05, 2007, 05:59:19 am »
What do you mean 'linking against'.. do you mean change the linker in the build options.. if you do then what would i change it to? only dll's come with the nightly's

EDIT

I got it working now :) i did as you said and linked to the dll's included in the nightly thank you very much for you help
« Last Edit: August 05, 2007, 06:43:04 am by bear24rw »

Offline dmoore

  • Developer
  • Lives here!
  • *****
  • Posts: 1576
Re: Default Plugin Doesnt Compile
« Reply #22 on: August 05, 2007, 06:27:46 am »
under build options, linker
instead of linking against libcodeblocks.a and libwxmsw28u.a
link against codeblocks.dll and wxmsw28u_gcc_cb.dll

this will allow you to run your plugin with most recent nightly builds (provided the codeblocks.dll doesn't change too much)