maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Development (https://talk.maemo.org/forumdisplay.php?f=13)
-   -   Help building Hello world please???? (https://talk.maemo.org/showthread.php?t=29772)

brangi 2009-06-22 13:54

Help building Hello world please????
 
Hi guys I am starting with maemo development and I am having troubles compiling and running hello world......I basically followed nokias maemo diablo application development training material but I seem not to get it working or I just need some help understanding the framework.... so what I did was that I created gtk_ helloworld-2.c and I saved it on my user folder/home I guess running ubuntu 8.10 so then I tried building the program with the following :

[sbox-DIABLO_ARMEL: ~] > gcc -Wall `pkg-config --cflags gtk+-2.0` \ gtk_helloworld-2.c -o gtk_helloworld-2 `pkg-config --libs gtk+-2.0`
sbox-arm-linux-gcc: gtk_helloworld-2.c: No such file or directory
[sbox-DIABLO_ARMEL: ~] >

so it just won't find my file...so I am not quite sure where to place the file, because that sbox-DIABLO_ARMEL: ~ I have seen some other tutorials which show other location like sbox-DIABLO_ARMEL: ~/ development or different but maybe I am doing something wrong building. Could I get some help here please :s?? I will be so grateful. Thanks in advance

:(:(:(:(

BrentDC 2009-06-22 16:33

Re: Help building Hello world please????
 
sbox-DIABLO_ARMEL: ~ is actually /scratchbox/users/<your username>/home/<your username>/ (I think). It is something like that though...

VDVsx 2009-06-22 16:41

Re: Help Building Hello World Please?????
 
You should place the file inside scratchbox, usually '/scratchbox/users/your_user_name/home/your_user_name'

HTH

sjgadsby 2009-06-22 17:20

Re: Help Building Hello World Please?????
 
This is a duplicate of an earlier thread.

Please do not post duplicate threads.

brangi 2009-06-22 19:11

Re: Help Building Hello World Please?????
 
Thanks, VDVsx and I apologize for the second thread sjgadsby, I thought I was gonna get a faster response :P. Sorry about that it wont happen again.

So, well I am not able to build it still :( I made sure that I was in the right location and I tried to build it again with the following :


[sbox-DIABLO_ARMEL: ~] > ls
MyDocs maemo-sdk-nokia-binaries_4.1.2.sh
gtk_helloworld-2.c maemo-sdk-rootstrap_4.1.2_armel.tgz
maemo-sdk-nokia-binaries_4.1.2 maemo-sdk-rootstrap_4.1.2_i386.tgz
[sbox-DIABLO_ARMEL: ~] > gcc -Wall `pkg-config --cflags gtk+-2.0` \ gtk_helloworld-2.c -o gtk_helloworld-2 `pkg-config --libs gtk+-2.0`
sbox-arm-linux-gcc: gtk_helloworld-2.c: No such file or directory
[sbox-DIABLO_ARMEL: ~] >

can sombody take a look at this? Thanks

brangi

VDVsx 2009-06-22 19:21

Re: Help Building Hello World Please?????
 
Try: gcc -o gtk_helloworld-2 gtk_helloworld-2..c ‘pkg-config gtk+-2.0 --cflags --libs‘ -Wall

jthiemann 2009-06-22 19:54

Re: Help Building Hello World Please?????
 
Quote:

Originally Posted by brangi (Post 298718)
[sbox-DIABLO_ARMEL: ~] > gcc -Wall `pkg-config --cflags gtk+-2.0` \ gtk_helloworld-2.c -o gtk_helloworld-2 `pkg-config --libs gtk+-2.0`
sbox-arm-linux-gcc: gtk_helloworld-2.c: No such file or directory

brangi

You are tying to compile a file called " gtk_helloworld-2.c": note the space at the beginning. The backslash makes the shell not treat the one preceding space as "whitespace". Take it out and it should work.

brangi 2009-06-22 20:20

Re: Help Building Hello World Please?????
 
Thanks both of you VDVsx and jthiemann....I was able to build it apparently with your solutions....but when running both examples...I got the following result:



[sbox-DIABLO_ARMEL: ~] > gcc -o gtk_helloworld-2 gtk_helloworld-2.c `pkg-config gtk+-2.0 --cflags --libs`-Wall
[sbox-DIABLO_ARMEL: ~] > ./gtk_helloworld-2
gtk_helloworld-2[15920]: GLIB WARNING ** Gtk - cannot open display:
[sbox-DIABLO_ARMEL: ~] > gcc -o gtk_helloworld-1 gtk_helloworld-1.c `pkg-config gtk+-2.0 --cflags --libs`-Wall
[sbox-DIABLO_ARMEL: ~] > ./gtk_helloworld-1
gtk_helloworld-1[15955]: GLIB WARNING ** Gtk - cannot open display:
[sbox-DIABLO_ARMEL: ~] >


any suggestions here? thanks


brangi

:confused::confused:

VDVsx 2009-06-22 20:51

Re: Help Building Hello World Please?????
 
You have to start a Xephyr window outside SB and then start the hildon dektop inside SB (warning the hildon desktop don't work inside SB in some diablo versions for the ARM target, use X86 target instead).

Outside SB in a console type:
Xephyr :2 -host-cursor -screen 800x480x16 -dpi 96 -ac -kb &

Inside SB type:

export DISPLAY=:2
af-sb-init.sh start
run-standalone.sh ./gtk_helloworld-2

For more information read the official maemo doc: http://maemo.org/maemo_release_documentation/maemo4.1.x/Maemo_Diablo_Reference_Manual_for_maemo_4.1.pdf

brangi 2009-06-22 21:32

Re: Help Building Hello World Please?????
 
Thank you VDVsx!! got my first hello world...I think with this can keep up with development more.


All times are GMT. The time now is 16:52.

vBulletin® Version 3.8.8