Author Topic: Codesnippets cannot be linked with C::B under linux  (Read 24509 times)

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Codesnippets cannot be linked with C::B under linux
« on: July 12, 2008, 08:43:09 pm »
"wxscintilla" is missing from "Build options -> Link libraries"

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Codesnippets cannot be linked with C::B under linux
« Reply #1 on: July 12, 2008, 08:59:30 pm »
"wxscintilla" is missing from "Build options -> Link libraries"
Mmmmmh... cannot confirm - it's there, under project options. And it compiles just fine on my Linux (Ubuntu)...?! Mind checking the project options again?
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 MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Codesnippets cannot be linked with C::B under linux
« Reply #2 on: July 12, 2008, 09:01:54 pm »
...nevermind. Forgot to SVN update before... It must have happened during the last 5 commits obviously.

Fixed in SVN. Thanks.
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 Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2750
Re: Codesnippets cannot be linked with C::B under linux
« Reply #3 on: July 13, 2008, 01:59:17 pm »
"wxscintilla" is missing from "Build options -> Link libraries"

I don't understand this. I'm building fine in Ubuntu with only tinyxml and codeblocks included in the Link Libraries box.

wxScintilla is included in the codeblocks sdk.

Why does your linking process need wxScintilla?


svn build rev 5120 (2008-07-11T23:54:33.667105Z) gcc 4.2.3 Linux/unicode
« Last Edit: July 13, 2008, 02:07:34 pm by Pecan »

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Codesnippets cannot be linked with C::B under linux
« Reply #4 on: July 13, 2008, 03:50:36 pm »
BTW: The "codesnippets.exe" stand-alone executable does not work if you have default.conf placed only in the C::B directory (to make C::B portable). In that case you receive a bunch of errors and the application does not start.
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 Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2750
Re: Codesnippets cannot be linked with C::B under linux
« Reply #5 on: July 13, 2008, 10:43:51 pm »
...The "codesnippets.exe" stand-alone executable does not work...

Thanks, fixed in svn 5126

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Codesnippets cannot be linked with C::B under linux
« Reply #6 on: July 13, 2008, 11:14:40 pm »
There is another more dangerous bug (at least on my machine with debian sid/experimental 64bit wxWidgets 2.8.8 ):

if codesnippets is installed (no matter if it's enabled or disabled) the CheckForModifiedFiles-event does not work.

I have no time to look into the code, but it starts with svn r5118 and including of ThreadSearch and great parts of editor and editormanager into codesnippets.

And if I uninstall codesnippets, uninstalling is done (menu-update etc) but C::B crashes with a segfault.

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2750
Re: Codesnippets cannot be linked with C::B under linux
« Reply #7 on: July 14, 2008, 12:26:50 am »
There is another more dangerous bug (at least on my machine with debian sid/experimental 64bit wxWidgets 2.8.8 ):

if codesnippets is installed (no matter if it's enabled or disabled) the CheckForModifiedFiles-event does not work.

I have no time to look into the code, but it starts with svn r5118 and including of ThreadSearch and great parts of editor and editormanager into codesnippets.

And if I uninstall codesnippets, uninstalling is done (menu-update etc) but C::B crashes with a segfault.

I don't know what to do about CheckForModifiedFiles since it works for me on both Windows XP and Ubuntu 8.04

The only thing I can do is revert to the previous version which neither uses CB editor or ThreadSearch.

I can fix the "release" crash If I can get it to happen.

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Codesnippets cannot be linked with C::B under linux
« Reply #8 on: July 14, 2008, 09:05:56 am »
I don't know what to do about CheckForModifiedFiles since it works for me on both Windows XP and Ubuntu 8.04

The only thing I can do is revert to the previous version which neither uses CB editor or ThreadSearch.
I don't know how it can work for you on linux, but on windows you are right. I just found the problem and it's might be not so difficult to solve.
Have you checked it only for codesnippets, or also for normal editor ?

When I compiled codesnippets-plugin on my w2k kvm-box it warns me about redeclaration of "ID_NBEditorManager", "ID_EditorManager" , "idEditorManagerCheckFiles" and "ID_EditorManagerCloseButton" without "dllimport" and that the compiler ignores the previous declaration.

That means the four id's from C::B's "editormanager.h" and the redeclared id's from "seditormanager.h" are in the same scope.
On linux the "DLLIMPORT"-macro is empty and so the redeclaration uses the same physical memory (that's what extern is for if used without initialization).

In "seditormanager.cpp" you have the following lines:
Code
int ID_NBEditorManager = wxNewId();
int ID_EditorManager = wxNewId();
int idEditorManagerCheckFiles = wxNewId();

This code changes the values of the id's and therefore breaks the event-binding that were made by the main-app before.

If you rename the id's to e.g. "ID_NBSEditorManager", etc. (folllowing your naming-scheme for the source- and headerfiles) the "CheckForModifiedFiles"-event in C::B works as before.

I don't know if codesnippets-plugin will still work as expected or if you only need the editormanager-functions for the standalone-version.
But you know your code and how it works.
I hope there would be a possibility to overwork it, without removing the new functionallity.

I can fix the "release" crash If I can get it to happen.
I don't know how it can work for you

It might be because of a type mismatch, because I use 64bit linux and if there are e.g. "long"s and "int"s mixed, it might crash as it happens with wxSmith (changed in svn some revisions ago).

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2750
Re: Codesnippets cannot be linked with C::B under linux
« Reply #9 on: July 14, 2008, 02:08:18 pm »
When I compiled codesnippets-plugin on my w2k kvm-box it warns me about redeclaration of "ID_NBEditorManager", "ID_EditorManager" , "idEditorManagerCheckFiles" and "ID_EditorManagerCloseButton" without "dllimport" and that the compiler ignores the previous declaration.

Thanks Jens. I'll make the changes.

How do you manage to get these warning messages? I certainly would have paid attenttion to such warnings.  I'd like to turn on any flags that would show them to me also. I'm using gcc 3.4.5

If you're using a .cbp other than then one provided with svn, could you insert it in a message here.

Thanks

svn build  rev 5124 (2008-07-13T10:48:20.603685Z)   gcc 3.4.5 Windows/unicode

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Codesnippets cannot be linked with C::B under linux
« Reply #10 on: July 14, 2008, 03:34:17 pm »
I used a clean svn-checkout.

But I use MinGW 4.2.1.

I did not find a commandline-switch to turn this warning "on" or "off".
So I don't know if some defaults have changed from MinGW 3.4.5 to 4.2.1 .

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5490
Re: Codesnippets cannot be linked with C::B under linux
« Reply #11 on: July 14, 2008, 03:36:33 pm »
4.X series has much better warning reports than the 3.4.x.
Just be willing to fix them ;-)

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2750
Re: Codesnippets cannot be linked with C::B under linux
« Reply #12 on: July 14, 2008, 06:39:44 pm »
4.X series has much better warning reports than the 3.4.x.
Just be willing to fix them ;-)

Code
mingw32-g++.exe -Lbase\tinyxml -LC:\Usr\Proj\wxWidgets287\lib\gcc_dll -Lbase\tinyxml -Lc:\usr\mingw431\bin\lib -LC:\Usr\mingw431\bin\lib\gcc\mingw32\4.3.1  -o build_tools\autorevision\autorevision.exe .objs\build_tools\autorevision\autorevision.o   -s  -ltxml c:\usr\mingw431\bin\lib c:\usr\mingw431\bin\lib\gcc\mingw32\4.3.1 
ld: crt2.o: No such file: No such file or directory
Process terminated with status 1 (0 minutes, 0 seconds)
0 errors, 0 warnings

I've tried for 3 hrs to get past this problem: crt2.o can't be found.
The soluctions I've found on Google don't work, and the one on this board is unclear, and the dev says not to use it.

So I guess I'm backed into a corner. Without gcc 3.4.5 I have no usable CodeBlocks.

This version of gcc 4.3.1 came from the TDM site. Is there another I should try?

« Last Edit: July 14, 2008, 06:42:57 pm by Pecan »

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Codesnippets cannot be linked with C::B under linux
« Reply #13 on: July 14, 2008, 06:57:47 pm »
I use MinGW "4.2.1-dw2" on w2k and on XP I use "4.2.1-sjlj -2", what is still a Technological preview, but seems to be quiet stable.

Both give me the described warnings and compile C::B without problems.

The mingw.org servers seem to be down since some hours, but the download page on sf.net still works: http://sourceforge.net/project/showfiles.php?group_id=2435

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2750
Re: Codesnippets cannot be linked with C::B under linux
« Reply #14 on: July 14, 2008, 10:41:55 pm »
Thanks Jens. I'll make the changes.

Fixed in SVN 5127

CodeSnippets 1 3.69 2008/07/14
- Jens' fix for broken CheckForModifiedFiles


I'm still unsuccessful running mingw 4.x on XP, so I'll have to depend on other users to report the warnings.
« Last Edit: July 14, 2008, 10:43:43 pm by Pecan »