Author Topic: Code::Blocks successfully compiled on Suse 9.3  (Read 15105 times)

killroy

  • Guest
Code::Blocks successfully compiled on Suse 9.3
« on: August 09, 2005, 11:44:30 am »
Hi.

First of all, I just want you to know that you guys, rock!!!
Code::Blocks is a dream come true for a free crossplatform C++ IDE.

I don't know if it's important to you, but I managed to compile it on Suse 9.3 with wxGTK 2.5.3 which is default for this version of Suse. I just had to follow your tutorial for Linux compilation (all distros). I had to change LIB_WXXRC and LIB_WXST in Makefile.unix to relate to my version of libraries. There was one catch, though. It seems that on Suse 9.3. there are both unicode and ASCII version of wxGTK, with unicode as default, so I had to change wxGTK configuration to ASCII. After that, everything went smooth.

I mostly work with Visual Studio 2003, so I was searching for a tool on linux that would have equally good and intuitive build system. I tried KDevelop, Anjuta and Eclipse. Maybe I don't know how to use them but I just couldn't make a project with source code in a separate directory from the project files and with a source tree directory structure. And with Code::Blocks it's so simple. I had my project up and running in no time.

I know you already know it, but it doesn't hurt to say it again:
This is a superb IDE for C++ development!!!
 :D

Killroy
« Last Edit: August 09, 2005, 11:51:26 am by killroy »

Offline AkiraDev

  • Multiple posting newcomer
  • *
  • Posts: 71
Re: Code::Blocks successfully compiled on Suse 9.3
« Reply #1 on: August 09, 2005, 12:32:43 pm »
Care to ellaborate on the necessary steps to get the non-unicode version running on SUSE 9.3?
I'd like to try that myself.

What's more, would you be willing to contribute with an RPM?

This is debated in this thread:
http://forums.codeblocks.org/index.php/topic,663.0.html

Thank you for the good news.

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Re: Code::Blocks successfully compiled on Suse 9.3
« Reply #2 on: August 09, 2005, 05:45:32 pm »
Killroy: Which version of Code::Blocks did you use? 1.0-RC1-1?
CVS HEAD?
CVS VERSION_1_0 branch?

Please provide more details, as I'm having trouble compiling with makefiles on my machine :P (I use codeblocks to compile itself, but somehow the makefile got broken)

killroy

  • Guest
Re: Code::Blocks successfully compiled on Suse 9.3
« Reply #3 on: August 09, 2005, 07:07:31 pm »
Hey all,

Here is a more detailed description.

I used version 1.0-RC1-1 which I downloaded from websites download section.
WxGTK 2.5.3 is a standard Suse 9.3 package wxGTK-devel-2.5.3.1-5.i586.rpm

1. I had to change two lines in "Makefile.unix"
From:
LIB_WXXRC=wx_gtk2_xrc-2.4
LIB_WXSTC=wx_gtk2_stc-2.4
To:
LIB_WXXRC=wx_gtk2_xrc-2.5
LIB_WXSTC=wx_gtk2_stc-2.5

2. Initially, default configuration for wxGTK was set to unicode libraries and because of that, compilation failed.
With "wx-config --list" you can see your default configuration and other available wxGTK configurations.
Supposedly, with "wx-config --unicode=no" you should be able to choose ansi configuration as default. For me that didn't work or I don't know how to properly use it.
Here comes the messy part but as long as it works I don't mind.
In /usr/lib/wx/config there are two files:
"gtk2-ansi-release-2.5"
"gtk2-unicode-release-2.5"
I logged as root and moved "gtk2-unicode-release-2.5" away from the directory and renamed "gtk2-ansi-release-2.5" to "gtk2-unicode-release-2.5"

Yes, I know it's stupid.  :D

3. After that it's all standard procedure described on the website pages:

# make -f Makefile.unix
# dos2unix -n update update.unix
# chmod +x update.unix
# ./update.unix

And if all goes well, the sweetest part:

# output/run.sh

AkiraDev:
I would gladly make rpm out of it, but I have never done this, so I will need to spend some time to see how it's done.

I hope this little overview helps you compile a great IDE.
 :D

Killroy

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Re: Code::Blocks successfully compiled on Suse 9.3
« Reply #4 on: August 09, 2005, 07:12:01 pm »
Mind researching into the ansi release? Or can someone indicate how to configure that?

I doubt users would like to login as root and move files...

killroy

  • Guest
Re: Code::Blocks successfully compiled on Suse 9.3
« Reply #5 on: August 09, 2005, 07:25:33 pm »
I'll try to figure out how to properly change the configuration.

Killroy

killroy

  • Guest
Re: Code::Blocks successfully compiled on Suse 9.3
« Reply #6 on: August 09, 2005, 08:08:52 pm »
I checked and it's really simple.

In /usr/lib/wx/config there are two files:
gtk2-ansi-release-2.5
gtk2-unicode-release-2.5

In /usr/bin there is a link to one of these two files called "wx-config".
So, to use one of these two configurations, one would only need to make a link in /usr/bin.

I hope it helps.


Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Re: Code::Blocks successfully compiled on Suse 9.3
« Reply #7 on: August 09, 2005, 08:19:28 pm »
Thanks! Now, mind doing a step-by-step guide? (I don't understand much of Linux, therefore I can't make such guide for the other users).

killroy

  • Guest
Re: Code::Blocks successfully compiled on Suse 9.3
« Reply #8 on: August 09, 2005, 08:49:27 pm »
No problem, although I'm not much of a linux user either.

I will make a step by step guide on how to build on Suse 9.3, but I don't know if this will be of much use to linux users with other distributions.

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Re: Code::Blocks successfully compiled on Suse 9.3
« Reply #9 on: August 09, 2005, 08:50:41 pm »
Please do.

Offline Game_Ender

  • Lives here!
  • ****
  • Posts: 551
Re: Code::Blocks successfully compiled on Suse 9.3
« Reply #10 on: August 10, 2005, 06:59:14 pm »
Did you test for stability yet?  People (include me) have had trouble with opening projects, and running the code completion plugin.  If I can at least get a semi stable code::blocks together I can start work on some pluggins I wanted to do.

killroy

  • Guest
Re: Code::Blocks successfully compiled on Suse 9.3
« Reply #11 on: August 11, 2005, 09:59:58 am »
I didn't have time to test it thoroughly. I played with it for a couple of hours and my first impression was that it is stable enough. I used it to import a project from Visual Studio and made another project from scratch.
Occasionally, I noticed that one of the icons on the toolbar (it was Cut or Paste, can't remember) was flickering, but it's not a big deal.
One time, when I used CloseProject from the menu, the program exited.

I didn't have time yet to write step by step guide for compiling on Suse, but it should be up soon. Basically, it will be just a summary of all the aforementioned things in this thread.

killroy

  • Guest
Re: Code::Blocks successfully compiled on Suse 9.3
« Reply #12 on: August 12, 2005, 07:04:35 pm »
Here is my attempt to write a small tutorial on:

Compiling Code::Blocks on Suse 9.3. with WxGTK 2.5.3

Since this is a tutorial for Suse 9.3 distribution, it is assumed that there is no need to compile WxGTK libraries by hand. It is easier to install default WxGTK packages which come with the distribution. For Code::Blocks compilation, wxGTK-devel-2.5.3.1-5.i586.rpm is needed, along with other dependencies. Make sure you have everything installed.

1.
Get the Code::Blocks source code from the website or CVS. For this tutorial, "Code::Blocks version 1.0-RC1-1" was used.


2.
Extract the package by positioning into a directory where it was downloaded and type:
#tar zxf codeblocks-1.0-rc1-1.tar.gz

Enter the source directory:
#cd codeblocks-1.0-RC1-1/src


3.
Check for WxGTK libraries.
If WxGTK is installed, there should be a simple script "wx-config", so type:
#wx-config --version

Output should be:
#2.5.3

Then:
#wx-config --list

Output should be something like:
#Default config is gtk2-unicode-release-2.5
#Default config will be used for output
#Alternate matches:
#gtk2-ansi-release-2.5

If output is like this, it means that the current default WxGTK configuration is unicode.
To compile Code::Blocks, ansi version is needed.


4.
Change WxGTK configuration from unicode to ansi.
If WxGTK libraries are installed from rpm package, there should be two scripts in "/usr/lib/wx/config/" directory, so type:
#ls /usr/lib/wx/config/

Output should be:
#gtk2-ansi-release-2.5  gtk2-unicode-release-2.5

The script "wx-config" that was used in step 3 is actually a link to one of these two scripts and in our case it linked to "gtk2-unicode-release-2.5". In order to use ansi libraries, this link should be changed to point to "gtk2-ansi-release-2.5" script. Because this link is in "/usr/bin", root privileges are needed to modify it.

#su
type root password, delete old link and then make a new one
#rm /usr/bin/wx-config
#ln /usr/lib/wx/config/gtk2-ansi-release-2.5 /usr/bin/wx-config

check configuration again:
#wx-config --list

now it should say:
#Default config is gtk2-ansi-release-2.5
#Default config will be used for output
#Alternate matches:
#gtk2-unicode-release-2.5

exit root mode
#exit


5.
Changing Makefile.unix
We are still in the Code::Blocks source directory where Makefile.unix should be modified.
Use your favorite text editor to modify two lines which can be found somewhere at the beginning of the file.

Find these two lines:
"LIB_WXXRC=wx_gtk2_xrc-2.4"
"LIB_WXSTC=wx_gtk2_stc-2.4"

And change them to:
"LIB_WXXRC=wx_gtk2_xrc-2.5"
"LIB_WXSTC=wx_gtk2_stc-2.5"


6.
Compiling Code::Blocks

From here it's a standard procedure:
#make -f Makefile.unix
#dos2unix -n update update.unix
#chmod +x update.unix
#./update.unix
#output/run.sh

That's it. The procedure is actually pretty straightforward and perhaps it could be applied to build Code::Blocks with different WxGTK libraries.

I hope it helps.