Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: Pecan on January 16, 2006, 06:21:00 am

Title: ubuntu keybinder wont compile
Post by: Pecan on January 16, 2006, 06:21:00 am
compiling keybiner under ubuntu with CB 1762 gets this error
I dont see anything in build options about threads.


Code
-------------- Build: default in C::B KeyBinder ---------------
Compiling: cbkeybinder.cpp
cc1plus: error: invalid option ‘threads’
Process terminated with status 1 (0 minutes, 3 seconds)
0 errors, 0 warnings
 

thanks
pecan
Title: Re: ubuntu keybinder wont compile
Post by: Game_Ender on January 16, 2006, 06:40:24 am
Trying compiling with the compiler in the "show full command line" mode, that might not be the exact wording.  That way you can see exactly what options are being passed to compiler.  Then we can help you diagnose a little better.  Have you checked in the compiler options, the main ones from the "plugins" menu and all the switches?
Title: Re: ubuntu keybinder wont compile
Post by: Pecan on January 16, 2006, 08:07:32 am
Trying compiling with the compiler in the "show full command line" mode, that might not be the exact wording.  That way you can see exactly what options are being passed to compiler.  Then we can help you diagnose a little better.  Have you checked in the compiler options, the main ones from the "plugins" menu and all the switches?

Code
------------- Build: default in C::B KeyBinder ---------------
g++ -Wall -g -Winvalid-pch -pipe -mthreads -fmessage-length=0
-fexceptions -include "sdk.h" -DBUILDING_PLUGIN -DCB_PRECOMP
-DWX_PRECOMP -DHAVE_W32API_H -D__WXMSW__ -DWXUSINGDLL -DcbDEBUG
-DTIXML_USE_STL -DwxUSE_UNICODE  -I/home/pecan/devel/trunk/src/sdk
-I/home/pecan/devel/trunk/src/sdk/wxscintilla/include
-I/usr/include/wx-2.6/include -I/usr/include/wx-2.6/lib/gcc_dll/mswu
-I/usr/include/wx-2.6/contrib/include -I/usr/include  -c cbkeybinder.cpp
-o .objs/cbkeybinder.o
cc1plus: error: invalid option ‘threads’
Process terminated with status 1 (0 minutes, 3 seconds)
0 errors, 0 warnings
 

woops, it looks to me like I can't use a .cbp on ubuntu. Look at all
that MSW stuff.

thanks
pecan
Title: Re: ubuntu keybinder wont compile
Post by: takeshimiya on January 16, 2006, 08:32:22 am
woops, it looks to me like I can't use a .cbp on ubuntu. Look at all
that MSW stuff.
Sadly, you will have to create a cbp with wx-config and all that stuff.
It's a real pity that the projects files can't be multi-platform (when using any library other than STL).

However I've been thinking, and it seems there isn't any easy solution for that. The main problem is the configure (and the detection of library/include paths) stuff.
Something like pkg-config could help though.
Here's a big list of build/configure cross-platform tools that can help for some ideas: http://www.a-a-p.org/tools_install.html

But for now the only solution is to create different cbp for different platforms and compilers. Not so difficult for small projects though.
Title: Re: ubuntu keybinder wont compile
Post by: Pecan on January 16, 2006, 03:17:08 pm
...it seems there isn't any easy solution for that.

But for now the only solution is to create different cbp for different platforms and compilers. Not so difficult for small projects though.

Thanks. I've spent a week and a half going down this linux road,
and it now appears that if I continue down this road, I'll never get
any productive work done.

I'm way pass my level of incompetence. I feel defeated and sad.

I'll see if I can fix things in windows, then just "run" them on
ubuntu. Maybe that'll work.

Thanks, everyone for all your patience and help.
pecan
Title: Re: ubuntu keybinder wont compile
Post by: tiwag on January 16, 2006, 03:47:53 pm
hi pecan,
don't worry about ...  :)

i'm learning linux too and had already my first feeling of success ...
with time your linux-specific knowledge will grow and then you'll feel better !

don't give up !

i'll try to create a cbKeybinder-unix.cbp C::B project file.

greets
--tiwag
Title: Re: ubuntu keybinder wont compile
Post by: Pecan on January 16, 2006, 05:13:43 pm
i'll try to create a cbKeybinder-unix.cbp C::B project file.

Thanks tiwag

What do I have to delete on linux to get keybinder
to re-compile with make and codeblocks to relink
with a new keybinder.

I'm modifying the code on windows, copying it
to the keybinder contrib dir, deleting the keybinder.o
files, but it still wont re-compile re-link.

I get lots of "leaving dir x, nothing to do" and codeblocks
is the same after make install.

Edit: also, is there a way to save the output of the make/make install
so I can see it without it scrolling off the terminal screen?

thanks
pecan
Title: Re: ubuntu keybinder wont compile
Post by: mandrav on January 16, 2006, 05:45:26 pm
Pecan, let me give you a hand here :)

If you 've build C::B in linux (even without the contrib plugins), use it to build C::B again using CodeBlocks-unix.cbp. Once you 've done this, remove the autoconf-based C::B and work with output/run.sh. The rest is like working on the windows version :)
Title: Re: ubuntu keybinder wont compile
Post by: Ceniza on January 16, 2006, 06:12:27 pm
For the error report you're getting, the "invalid option 'threads'" is because of -mthreads in the compiler options. Linux hasn't that flag, the equivalent is -pthreads (POSIX instead of MinGW).
Title: Re: ubuntu keybinder wont compile
Post by: Pecan on January 16, 2006, 09:35:49 pm
Pecan, let me give you a hand here :)

If you 've build C::B in linux (even without the contrib plugins), use it to build C::B again using CodeBlocks-unix.cbp. Once you 've done this, remove the autoconf-based C::B and work with output/run.sh. The rest is like working on the windows version :)

thanks Yiannis
But it seems to want some manager stuff that isn't there.
Compile log attached.

pecan


[attachment deleted by admin]
Title: Re: ubuntu keybinder wont compile
Post by: mandrav on January 16, 2006, 10:54:03 pm
Quote
thanks Yiannis
But it seems to want some manager stuff that isn't there.
Compile log attached.

Oh, that :)
We removed the sdk/Managers folder a couple of days ago but it seems I haven't updated the project file :oops:
Just remove them from the project file (sdk/Managers/*)...
Title: Re: ubuntu keybinder wont compile
Post by: Pecan on January 17, 2006, 02:38:41 am
Quote
thanks Yiannis
But it seems to want some manager stuff that isn't there.
Compile log attached.

Oh, that :)
We removed the sdk/Managers folder a couple of days ago but it seems I haven't updated the project file :oops:
Just remove them from the project file (sdk/Managers/*)...


I removed all sdk/Managers/* from the unix.cbp but still get
the err.
Code
-------------- Build: AutoRevision in Code::Blocks - Unix ---------------
Target is up to date.

-------------- Build: ConsoleRunner in Code::Blocks - Unix ---------------
Target is up to date.

-------------- Build: tinyXML in Code::Blocks - Unix ---------------
Target is up to date.

-------------- Build: AngelScript in Code::Blocks - Unix ---------------
Target is up to date.

-------------- Build: scintilla in Code::Blocks - Unix ---------------
Target is up to date.

-------------- Build: wxFlatNotebook in Code::Blocks - Unix ---------------
Target is up to date.

-------------- Build: wxPropertyGrid in Code::Blocks - Unix ---------------
Target is up to date.

-------------- Build: sdk in Code::Blocks - Unix ---------------
Running target pre-build steps
tools/autorevision/auto_revision +wx +int +t . sdk/autorevision.h
Linking dynamic library: devel/libcodeblocks.so
g++: .objs/sdk/Managers/StdAfx.o: No such file or directory
Process terminated with status 1 (0 minutes, 27 seconds)
0 errors, 0 warnings
 
Please find attached the .cbp file

thanks,
pecan

[attachment deleted by admin]
Title: Re: ubuntu keybinder wont compile
Post by: tiwag on January 17, 2006, 12:16:15 pm
@pecan - update from svn, you'll get a
CodeBlocks-unix project file, with which you can build src/devel/codeblocks

this projectfile has still a bug with building the codecompletion plugin
this plugin isn't built correctly and  will not load on startup
(committed to svn though, @Yiannis, please can you have a look what's wrong with it ?)

but the rest is ok and you can continue to work on keybinder plugin under linux.

also a keybinder-unix projectfile is commited, it works fine for me.

HTH

--tiwag
Title: Re: ubuntu keybinder wont compile
Post by: Pecan on January 17, 2006, 07:59:06 pm
Ok, finally managed to compile codeblocks with codeblocks.
Then did the ./update
Then run the ./run.sh

Now, how do I run the run.sh with GDB.

Code
#!/ bin/sh <--space after ./ and before "bin" to appease apache error 

APP_DIR=/home/pecan/devel/trunk/src/output
export LD_LIBRARY_PATH=$APP_DIR:$LD_LIBRARY_PATH
$APP_DIR/codeblocks $@

I tried "gdb $APP_DIR/codeblocks $@ "
then "$APP_DIR/gdb codeblocks $@ "

The first runs, but says there are (no debugging symbols found)" about 100 times.
The second wont run at all.

Any suggestions? I need to run under gdb to catch plugin initiation errs.

thanks
pecan

Title: Re: ubuntu keybinder wont compile
Post by: mandrav on January 17, 2006, 08:24:53 pm
Ok, finally managed to compile codeblocks with codeblocks.
Then did the ./update
Then run the ./run.sh

Now, how do I run the run.sh with GDB.

Code
#!/ bin/sh <--space after ./ and before "bin" to appease apache error 

APP_DIR=/home/pecan/devel/trunk/src/output
export LD_LIBRARY_PATH=$APP_DIR:$LD_LIBRARY_PATH
$APP_DIR/codeblocks $@

I tried "gdb $APP_DIR/codeblocks $@ "
then "$APP_DIR/gdb codeblocks $@ "

The first runs, but says there are (no debugging symbols found)" about 100 times.
The second wont run at all.

Any suggestions? I need to run under gdb to catch plugin initiation errs.

thanks
pecan



Copy the devel/run.sh to devel/dbg.sh and edit it as you did above:

Code
$APP_DIR/codeblocks $@ 
// change it to
gdb $APP_DIR/codeblocks $@

Then just run devel/dbg.sh :)
Title: Re: ubuntu keybinder wont compile
Post by: Pecan on January 18, 2006, 05:01:22 am
Re: ubuntu keybinder wont compile

It works! a BIG thanks to you all.

pecan
Title: Re: ubuntu keybinder wont compile
Post by: Ceniza on January 18, 2006, 05:10:56 am
But now it's broken on Windows (crashes @ rev 1791) :)