Archive for the ‘Ubuntu’ Category

ObjectiveC on Ubuntu Linux

Thursday, August 7th, 2008

as I’m about to become an iPhone programmer (another one?), I’ve decided to set up an objective-c environment on my Ubuntu too.

First, I’ve downloaded all the packages for ObjectiveC and GNUstep I’ve found on Synaptic.

Second, I’ve tried to compile a classical Hello World file with gcc. Here’s the code (’Ciao mondo’ stands for ‘Hello world’ in Italian):

#import <Foundation/Foundation.h>

int main(int argc, char* argv[]) {
        NSLog(@"Ciao mondo");
        return 0;

and i saved the source in a file called main.m

After that I’ve tried: gcc main.c -o hello and I soon got the following error message:

main.m:2:34: error: Foundation/Foundation.h: No such file or directory
main.m: In function ‘main’:
main.m:5: error: cannot find interface declaration for ‘NXConstantString’


PyQt4 Tutorial

Thursday, June 26th, 2008

PyQt4 is the wrapper for Trolltech’s Qt4 libraries. On the riverbank site you can find the sources and the windows binary; ubuntu seems to ship the binary on the official release, simply look for pyqt in synaptic.

Here is a good PyQt4 tutorial: zetcode

And here another good in Italian: un tutorial facile facile

Anybody knows about the binary on mac? I’ve found something on finkproject: anybody tested it?


PHP and DL()

Wednesday, May 21st, 2008

The problem
I’ve tryied to execute a php script containing a dl() call to a .so from the command line and I’ve got the message:

Warning: dl(): Dynamically loaded extensions aren't enabled in /home/roberto/tmp/helloworld.php on line 6

The cause

The web host has not enabled dynamically loaded extensions.

The solution
I asked to the php interpreter where to find the configuration:

php --ini

Configuration File (php.ini) Path: /etc/php5/cli
Loaded Configuration File:         /etc/php5/cli/php.ini
Scan for additional .ini files in: /etc/php5/cli/conf.d

So with a simple sudo vi /etc/php5/cli/php.ini I changed the parameter enable_dl=Off to enable_dl=On.


wxWidgets and Ubuntu

Monday, April 21st, 2008

To keep your wxwidgets up-to-date on your ubuntu, simply add

deb gutsy-wx main

to your /etc/apt/sources.list file. Then run

sudo apt-get update

to get the wx package list. Then type:

sudo apt-get install libwxgtk2.8-0 libwxgtk2.8-dev wx2.8-headers wx-common

or open synaptic to update your wx libraries.

Note that also the python bindings will be available for upgrade :)


Using Gecko.WebControl on Mono

Wednesday, March 19th, 2008

I’ve tried to use gecko.WebControl on Mono under Ubuntu Linux and I kept on getting:

Unhandled Exception: System.TypeInitializationException: An exception was thrown by the type initializer for Gecko.WebControl ---> System.DllNotFoundException: /usr/lib/firefox/
  at (wrapper managed-to-native) Gecko.WebControl:gtk_moz_embed_get_type ()
  at Gecko.WebControl.get_GType () [0x00000]
  at GtkSharp.GeckoSharp.ObjectManager.Initialize () [0x00000]
  at Gecko.WebControl..cctor () [0x00000] --- End of inner exception stack trace ---
  at <0x00000> 
  at SecondMessenger.gtk.MainWnd.initAdvertising () [0×00000]
  at SecondMessenger.gtk.MainWnd..ctor (SecondMessenger.SMClient client) [0×00000]
  at SecondMessenger.gtk.GTKClient.initUI () [0×00000]
  at SecondMessenger.SMClientManager.NewClient (System.String clientType) [0×00000]
  at SecondMessenger.SMClientManager..ctor (System.String clientType, System.Collections.Generic.List`1 accounts, System.Stringc) [0×00000]
  at SecondMessenger.Program.Esegui (System.String[] args) [0×00000]
  at SecondMessenger.Program.Main (System.String[] args) [0×00000]

That’s why even if the /usr/lib/firefox/ library is there is not visible to the LD_PATH.

Roberto Rocco Angeloni is proudly powered by WordPress
Entries (RSS) and Comments (RSS).

Fatal error: Cannot access protected property ObjectMgr::$_verbose in /web/htdocs/ on line 22