Author Topic: Code::Blocks, Scintilla and Fedora  (Read 41508 times)

Offline SharkCZ

  • Almost regular
  • **
  • Posts: 131
Re: Code::Blocks, Scintilla and Fedora
« Reply #15 on: October 26, 2010, 12:02:45 pm »
I didn't get time to go through the issue. So I can't comment why they don't want to allow us to bundle patched source. But I'd like to mention few points-

1) Fedora is one of the popular Linux Distros. We should try our best to keep C::B listed in Fedora.
2) I read the bug report. Mozilla chardet is also mentioned there. AFAIK, it's not patched heavily.
3) Another possible solution (also mentioned in bug report) we switch to wxScintilla bundled with wx.

We can do item 3 only when we switch to wx-2.9 (pls correct me if I'm wrong) which seems a long way to go.
Item 3 will break many of our features, because we use patched scintilla and wxscintilla.
I've checked the diff between upstream scintilla and the one used in C::B and there are changes that could go upstream in my opinion (still depends on upstream to accept them) and changes that are C::B specific (like some wxSmith support). It means that C::B uses effectively a fork of scintilla and we must live with that.

The situation with wxScintilla can change when an active developer will appear, but it won't help much here.

Quote
Mozilla chardet is not available as library as far as I know and can not be a problem therefore.
yes, that's no problem
Code::Blocks package maintainer for Fedora and EPEL

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Code::Blocks, Scintilla and Fedora
« Reply #16 on: October 26, 2010, 09:26:24 pm »
The situation with wxScintilla can change when an active developer will appear, but it won't help much here.
I don't think this will happen. There is the STC component in wxWidgets base, basically a replacement for wxScintilla, hence no good for us. The only think I can imagine is taking this as code base and making out patches against that component. But that won't happen in the near future.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline Loaden

  • Lives here!
  • ****
  • Posts: 1014
Re: Code::Blocks, Scintilla and Fedora
« Reply #17 on: November 08, 2010, 10:27:06 am »
Another possible solution is we build wxscintilla as a static lib and link other *.so against it.
Agreed. I think that's the best way.
But it seems have some issue when build wxScintilla as a static lib.
Error log here:
Code
||=== Code::Blocks, sdk ===|
.objs\sdk\cbeditor.o:D:\DengYC\CodeBlocks-C\src\sdk\cbeditor.cpp|760|undefined reference to `_imp___ZN11wxScintilla7SetZoomEi'|
.objs\sdk\cbeditor.o:D:\DengYC\CodeBlocks-C\src\sdk\cbeditor.cpp|765|undefined reference to `_imp___ZN11wxScintilla13SetMarginMaskEii'|
.objs\sdk\cbeditor.o:D:\DengYC\CodeBlocks-C\src\sdk\cbeditor.cpp|766|undefined reference to `_imp___ZN11wxScintilla13SetMarginMaskEii'|
.objs\sdk\cbeditor.o:D:\DengYC\CodeBlocks-C\src\sdk\cbeditor.cpp|767|undefined reference to `_imp___ZN11wxScintilla13SetMarginMaskEii'|
.objs\sdk\cbeditor.o:D:\DengYC\CodeBlocks-C\src\sdk\cbeditor.cpp|768|undefined reference to `_imp___ZN11wxScintilla13SetMarginMaskEii'|
.objs\sdk\cbeditor.o:D:\DengYC\CodeBlocks-C\src\sdk\cbeditor.cpp|828|undefined reference to `_imp___ZNK11wxScintilla9GetModifyEv'|
.objs\sdk\cbeditor.o:D:\DengYC\CodeBlocks-C\src\sdk\cbeditor.cpp|838|undefined reference to `_imp___ZN11wxScintilla12SetSavePointEv'|
.objs\sdk\cbeditor.o:D:\DengYC\CodeBlocks-C\src\sdk\cbeditor.cpp|844|undefined reference to `_imp___ZNK11wxScintilla11GetReadOnlyEv'|
.objs\sdk\cbeditor.o:D:\DengYC\CodeBlocks-C\src\sdk\cbeditor.cpp|875|undefined reference to `_imp___ZN11wxScintilla7GotoPosEi'|
.objs\sdk\cbeditor.o:D:\DengYC\CodeBlocks-C\src\sdk\cbeditor.cpp|876|undefined reference to `_imp___ZN11wxScintilla12ScrollToLineEi'|
.objs\sdk\cbeditor.o:D:\DengYC\CodeBlocks-C\src\sdk\cbeditor.cpp|877|undefined reference to `_imp___ZN11wxScintilla14ScrollToColumnEi'|
.objs\sdk\cbeditor.o:D:\DengYC\CodeBlocks-C\src\sdk\cbeditor.cpp|910|undefined reference to `_imp___ZNK11wxScintilla13GetCurrentPosEv'|
.objs\sdk\cbeditor.o:D:\DengYC\CodeBlocks-C\src\sdk\cbeditor.cpp|911|undefined reference to `_imp___ZNK11wxScintilla19GetFirstVisibleLineEv'|
.objs\sdk\cbeditor.o:D:\DengYC\CodeBlocks-C\src\sdk\cbeditor.cpp|918|undefined reference to `_imp___ZN11wxScintilla12MarkerDefineEiiRK8wxColourS2_'|
.objs\sdk\cbeditor.o:D:\DengYC\CodeBlocks-C\src\sdk\cbeditor.cpp|919|undefined reference to `_imp___ZN11wxScintilla19MarkerSetForegroundEiRK8wxColour'|
.objs\sdk\cbeditor.o:D:\DengYC\CodeBlocks-C\src\sdk\cbeditor.cpp|920|undefined reference to `_imp___ZN11wxScintilla19MarkerSetBackgroundEiRK8wxColour'|
.objs\sdk\cbeditor.o:D:\DengYC\CodeBlocks-C\src\sdk\cbeditor.cpp|924|undefined reference to `_imp___ZN11wxScintilla12MarkerDefineEiiRK8wxColourS2_'|
.objs\sdk\cbeditor.o:D:\DengYC\CodeBlocks-C\src\sdk\cbeditor.cpp|925|undefined reference to `_imp___ZN11wxScintilla19MarkerSetForegroundEiRK8wxColour'|
.objs\sdk\cbeditor.o:D:\DengYC\CodeBlocks-C\src\sdk\cbeditor.cpp|926|undefined reference to `_imp___ZN11wxScintilla19MarkerSetBackgroundEiRK8wxColour'|
.objs\sdk\cbeditor.o:D:\DengYC\CodeBlocks-C\src\sdk\cbeditor.cpp|932|undefined reference to `_imp___ZN11wxScintilla12SetFoldFlagsEi'|
.objs\sdk\cbeditor.o:D:\DengYC\CodeBlocks-C\src\sdk\cbeditor.cpp|934|undefined reference to `_imp___ZN11wxScintilla12SetFoldFlagsEi'|
.objs\sdk\cbeditor.o:D:\DengYC\CodeBlocks-C\src\sdk\cbeditor.cpp|947|undefined reference to `_imp___ZN11wxScintilla8UsePopUpEb'|
.objs\sdk\cbeditor.o:D:\DengYC\CodeBlocks-C\src\sdk\cbeditor.cpp|955|undefined reference to `_imp__wxEVT_SCI_MARGINCLICK'|
.objs\sdk\cbeditor.o:D:\DengYC\CodeBlocks-C\src\sdk\cbeditor.cpp|958|undefined reference to `_imp__wxEVT_SCI_UPDATEUI'|
.objs\sdk\cbeditor.o:D:\DengYC\CodeBlocks-C\src\sdk\cbeditor.cpp|961|undefined reference to `_imp__wxEVT_SCI_CHANGE'|
.objs\sdk\cbeditor.o:D:\DengYC\CodeBlocks-C\src\sdk\cbeditor.cpp|964|undefined reference to `_imp__wxEVT_SCI_CHARADDED'|
.objs\sdk\cbeditor.o:D:\DengYC\CodeBlocks-C\src\sdk\cbeditor.cpp|967|undefined reference to `_imp__wxEVT_SCI_DWELLSTART'|
.objs\sdk\cbeditor.o:D:\DengYC\CodeBlocks-C\src\sdk\cbeditor.cpp|970|undefined reference to `_imp__wxEVT_SCI_DWELLEND'|
.objs\sdk\cbeditor.o:D:\DengYC\CodeBlocks-C\src\sdk\cbeditor.cpp|973|undefined reference to `_imp__wxEVT_SCI_USERLISTSELECTION'|
.objs\sdk\cbeditor.o:D:\DengYC\CodeBlocks-C\src\sdk\cbeditor.cpp|976|undefined reference to `_imp__wxEVT_SCI_MODIFIED'|
.objs\sdk\cbeditor.o:D:\DengYC\CodeBlocks-C\src\sdk\cbeditor.cpp|1019|undefined reference to `_imp__wxEVT_SCI_STYLENEEDED'|
.objs\sdk\cbeditor.o:D:\DengYC\CodeBlocks-C\src\sdk\cbeditor.cpp|1019|undefined reference to `_imp__wxEVT_SCI_SAVEPOINTREACHED'|
.objs\sdk\cbeditor.o:D:\DengYC\CodeBlocks-C\src\sdk\cbeditor.cpp|1019|undefined reference to `_imp__wxEVT_SCI_SAVEPOINTLEFT'|
.objs\sdk\cbeditor.o:D:\DengYC\CodeBlocks-C\src\sdk\cbeditor.cpp|1019|undefined reference to `_imp__wxEVT_SCI_ROMODIFYATTEMPT'|
.objs\sdk\cbeditor.o:D:\DengYC\CodeBlocks-C\src\sdk\cbeditor.cpp|1019|undefined reference to `_imp__wxEVT_SCI_KEY'|
.objs\sdk\cbeditor.o:D:\DengYC\CodeBlocks-C\src\sdk\cbeditor.cpp|1019|undefined reference to `_imp__wxEVT_SCI_DOUBLECLICK'|
.objs\sdk\cbeditor.o:D:\DengYC\CodeBlocks-C\src\sdk\cbeditor.cpp|1019|undefined reference to `_imp__wxEVT_SCI_MACRORECORD'|
.objs\sdk\cbeditor.o:D:\DengYC\CodeBlocks-C\src\sdk\cbeditor.cpp|1019|undefined reference to `_imp__wxEVT_SCI_NEEDSHOWN'|
.objs\sdk\cbeditor.o:D:\DengYC\CodeBlocks-C\src\sdk\cbeditor.cpp|1019|undefined reference to `_imp__wxEVT_SCI_PAINTED'|
.objs\sdk\cbeditor.o:D:\DengYC\CodeBlocks-C\src\sdk\cbeditor.cpp|1019|undefined reference to `_imp__wxEVT_SCI_URIDROPPED'|
.objs\sdk\cbeditor.o:D:\DengYC\CodeBlocks-C\src\sdk\cbeditor.cpp|1019|undefined reference to `_imp__wxEVT_SCI_START_DRAG'|
.objs\sdk\cbeditor.o:D:\DengYC\CodeBlocks-C\src\sdk\cbeditor.cpp|1019|undefined reference to `_imp__wxEVT_SCI_DRAG_OVER'|
.objs\sdk\cbeditor.o:D:\DengYC\CodeBlocks-C\src\sdk\cbeditor.cpp|1019|undefined reference to `_imp__wxEVT_SCI_DO_DROP'|
.objs\sdk\cbeditor.o:D:\DengYC\CodeBlocks-C\src\sdk\cbeditor.cpp|1019|undefined reference to `_imp__wxEVT_SCI_ZOOM'|
.objs\sdk\cbeditor.o:D:\DengYC\CodeBlocks-C\src\sdk\cbeditor.cpp|1019|undefined reference to `_imp__wxEVT_SCI_HOTSPOT_CLICK'|
.objs\sdk\cbeditor.o:D:\DengYC\CodeBlocks-C\src\sdk\cbeditor.cpp|1019|undefined reference to `_imp__wxEVT_SCI_HOTSPOT_DCLICK'|
.objs\sdk\cbeditor.o:D:\DengYC\CodeBlocks-C\src\sdk\cbeditor.cpp|1019|undefined reference to `_imp__wxEVT_SCI_CALLTIP_CLICK'|
.objs\sdk\cbeditor.o:D:\DengYC\CodeBlocks-C\src\sdk\cbeditor.cpp|1019|undefined reference to `_imp__wxEVT_SCI_AUTOCOMP_SELECTION'|
.objs\sdk\cbeditor.o:D:\DengYC\CodeBlocks-C\src\sdk\cbeditor.cpp|1019|undefined reference to `_imp__wxEVT_SCI_TAB'|
.objs\sdk\cbeditor.o:D:\DengYC\CodeBlocks-C\src\sdk\cbeditor.cpp|1019|undefined reference to `_imp__wxEVT_SCI_ESC'|
||More errors follow but not being shown.|
||Edit the max errors limit in compiler options...|
||=== Build finished: 50 errors, 0 warnings (0 minutes, 19 seconds) ===|

Any comments are welcome!

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Code::Blocks, Scintilla and Fedora
« Reply #18 on: November 08, 2010, 10:45:17 am »
@Loaden:
Did you remove the devel and output folder before building or did you make rebuild (clean and build) ?
If that's not enough remove the pch's manually.

You should also remove all occurrences of scintilla in the link library list, where a target is linked against libcodeblocks, to avoid double linking and possible crashes (we had this in wxSmith with libtxml).
I attach a patch for C::B core that works on linux.

Offline Loaden

  • Lives here!
  • ****
  • Posts: 1014
Re: Code::Blocks, Scintilla and Fedora
« Reply #19 on: November 08, 2010, 10:55:23 am »
@Loaden:
Did you remove the devel and output folder before building or did you make rebuild (clean and build) ?
If that's not enough remove the pch's manually.

You should also remove all occurrences of scintilla in the link library list, where a target is linked against libcodeblocks, to avoid double linking and possible crashes (we had this in wxSmith with libtxml).
I attach a patch for C::B core that works on linux.
Why not need remove "WXMAKINGDLL_SCI" macro?

Offline Loaden

  • Lives here!
  • ****
  • Posts: 1014
Re: Code::Blocks, Scintilla and Fedora
« Reply #20 on: November 08, 2010, 11:01:11 am »
I still can't build success if keep the "WXMAKINGDLL_SCI" macro defined.
 :(

Offline Loaden

  • Lives here!
  • ****
  • Posts: 1014
Re: Code::Blocks, Scintilla and Fedora
« Reply #21 on: November 08, 2010, 11:08:08 am »
This is my second trying, the error is as follows.
Code
MORE-WARNING-...
----
D:\DengYC\CodeBlocks-C\src\sdk\wxscintilla\src\wxscintilla.cpp|4990|warning: 'bool wxScintillaEvent::GetControl() const' redeclared without dllimport attribute: previous dllimport ignored|
D:\DengYC\CodeBlocks-C\src\sdk\wxscintilla\src\wxscintilla.cpp|4991|warning: 'bool wxScintillaEvent::GetAlt() const' redeclared without dllimport attribute: previous dllimport ignored|
D:\DengYC\CodeBlocks-C\src\sdk\wxscintilla\src\wxscintilla.cpp|4994|warning: 'wxScintillaEvent::wxScintillaEvent(const wxScintillaEvent&)' redeclared without dllimport attribute after being referenced with dll linkage|
D:\DengYC\CodeBlocks-C\src\sdk\wxscintilla\src\wxscintilla.cpp|122|error: definition of static data member 'wxScintilla::sm_eventTable' of dllimport'd class|
D:\DengYC\CodeBlocks-C\src\sdk\wxscintilla\src\wxscintilla.cpp|122|error: definition of static data member 'wxScintilla::sm_eventHashTable' of dllimport'd class|
D:\DengYC\CodeBlocks-C\src\sdk\wxscintilla\src\wxscintilla.cpp|150|error: definition of static data member 'wxScintilla::ms_classInfo' of dllimport'd class|
D:\DengYC\CodeBlocks-C\src\sdk\wxscintilla\src\wxscintilla.cpp|151|error: definition of static data member 'wxScintillaEvent::ms_classInfo' of dllimport'd class|
||=== Build finished: 4 errors, 685 warnings (0 minutes, 22 seconds) ===|

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Code::Blocks, Scintilla and Fedora
« Reply #22 on: November 08, 2010, 11:30:21 am »
I still can't build success if keep the "WXMAKINGDLL_SCI" macro defined.
Probably I am missing something here, but why would you do that if you don't weant to build the DLL????

@Jens,Loaden: please keep in mind not to touch the wxscintilla component too much - I've have quite a lot changes pending from my side, including an update of scintilla. So please don't cause too much conflicts (project files are OK of course).
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline Loaden

  • Lives here!
  • ****
  • Posts: 1014
Re: Code::Blocks, Scintilla and Fedora
« Reply #23 on: November 08, 2010, 11:44:10 am »
I still can't build success if keep the "WXMAKINGDLL_SCI" macro defined.
Probably I am missing something here, but why would you do that if you don't weant to build the DLL????

@Jens,Loaden: please keep in mind not to touch the wxscintilla component too much - I've have quite a lot changes pending from my side, including an update of scintilla. So please don't cause too much conflicts (project files are OK of course).
I have the same question, see #19. :D
Because the patch from Jens that keep this macro, and build success on Linux, see #18.

Offline Loaden

  • Lives here!
  • ****
  • Posts: 1014
Re: Code::Blocks, Scintilla and Fedora
« Reply #24 on: November 08, 2010, 11:50:40 am »
@Jens,Loaden: please keep in mind not to touch the wxscintilla component too much - I've have quite a lot changes pending from my side, including an update of scintilla. So please don't cause too much conflicts (project files are OK of course).
Copy that.
Have another question, why we need hack this code from:
Code
SCNotification scn = {0};
to:
Code
/* C::B begin */
SCNotification scn; memset((void*)&scn, 0, sizeof(scn));
/* C::B end */
:?

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Code::Blocks, Scintilla and Fedora
« Reply #25 on: November 08, 2010, 12:21:17 pm »
@Jens,Loaden: please keep in mind not to touch the wxscintilla component too much - I've have quite a lot changes pending from my side, including an update of scintilla. So please don't cause too much conflicts (project files are OK of course).
Copy that.
Have another question, why we need hack this code from:
Code
SCNotification scn = {0};
to:
Code
/* C::B begin */
SCNotification scn; memset((void*)&scn, 0, sizeof(scn));
/* C::B end */
:?

To avoid build-warnings.

Can you test my new patch, works for me on XP SP3, wx2.8.10 and TDM gcc 4.5.0 (just for the core project-file at the moment).

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Code::Blocks, Scintilla and Fedora
« Reply #26 on: November 08, 2010, 02:11:17 pm »
Have another question, why we need hack this code from:
Code
SCNotification scn = {0};
to:
Code
/* C::B begin */
SCNotification scn; memset((void*)&scn, 0, sizeof(scn));
/* C::B end */
:?
Because it is technically more correct. This is a structure and if you only set the first value to zero, the other values may still be invalid on initialisation (platform / compiler dependent). Why are you asking? Is this causing trouble?
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Code::Blocks, Scintilla and Fedora
« Reply #27 on: November 08, 2010, 02:57:13 pm »
...This is a structure and if you only set the first value to zero, the other values may still be invalid on initialisation (platform / compiler dependent).
Hm, C++ standard says that the unspecified members are initialized with zero (If I remember correctly).
Which compiler fails to compile this code (={0}) correctly?

Also memset should be used on POD only structs, probably =0 will error if used with non-POD struct.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Loaden

  • Lives here!
  • ****
  • Posts: 1014
Re: Code::Blocks, Scintilla and Fedora
« Reply #28 on: November 08, 2010, 03:37:55 pm »
...This is a structure and if you only set the first value to zero, the other values may still be invalid on initialisation (platform / compiler dependent).
Hm, C++ standard says that the unspecified members are initialized with zero (If I remember correctly).
I can sure it, so, I think it maybe not needed to hack.

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Code::Blocks, Scintilla and Fedora
« Reply #29 on: November 08, 2010, 04:34:13 pm »
...This is a structure and if you only set the first value to zero, the other values may still be invalid on initialisation (platform / compiler dependent).
Hm, C++ standard says that the unspecified members are initialized with zero (If I remember correctly).
I can sure it, so, I think it maybe not needed to hack.
But it should be
Code
SCNotification scn = {{0}};