News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

Codesnippets cannot be linked with C::B under linux

Started by Jenna, July 12, 2008, 08:43:09 PM

Previous topic - Next topic

Jenna

"wxscintilla" is missing from "Build options -> Link libraries"

MortenMacFly

Quote from: jens on July 12, 2008, 08:43:09 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: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

MortenMacFly

...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: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

Pecan

Quote from: jens on July 12, 2008, 08:43:09 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

MortenMacFly

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: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

Pecan

Quote from: MortenMacFly on July 13, 2008, 03:50:36 PM
...The "codesnippets.exe" stand-alone executable does not work...

Thanks, fixed in svn 5126

Jenna

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.

Pecan

Quote from: jens 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.

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.

Jenna

Quote from: Pecan on July 14, 2008, 12:26:50 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:
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.

Quote from: Pecan on July 14, 2008, 12:26:50 AM
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).

Pecan

Quote from: jens on July 14, 2008, 09:05:56 AM
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

Jenna

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 .

killerbot

4.X series has much better warning reports than the 3.4.x.
Just be willing to fix them ;-)

Pecan

#12
Quote from: killerbot 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 ;-)


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?


Jenna

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

Pecan

#14
Quote from: Pecan on July 14, 2008, 02:08:18 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.