Reply
Thread Tools
tobiasj's Avatar
Posts: 241 | Thanked: 74 times | Joined on Jul 2007
#1
OK, so I admit, I got NO idea what I am doing, but I am trying to follow the porting tutorial and when I finished running through it and tried to compile I got this:

In file included from /usr/include/gtk-2.0/gdk/gdkx.h:33,
from /usr/include/hildon-1/hildon/hildon-window.h:33,
from /usr/include/hildon-1/hildon/hildon-program.h:29,
from bookmarks.c:20:
/usr/include/X11/Xlib.h:3578: error: syntax error before "_X_SENTINEL"
/usr/include/X11/Xlib.h:3583: error: syntax error before "_X_SENTINEL"
/usr/include/X11/Xlib.h:3596: error: syntax error before "_X_SENTINEL"
/usr/include/X11/Xlib.h:3609: error: syntax error before "_X_SENTINEL"
/usr/include/X11/Xlib.h:3614: error: syntax error before "_X_SENTINEL"
/usr/include/X11/Xlib.h:3846: error: syntax error before "_X_SENTINEL"
/usr/include/X11/Xlib.h:3850: error: syntax error before "_X_SENTINEL"
/usr/include/X11/Xlib.h:3862: error: syntax error before "_X_SENTINEL"
/usr/include/X11/Xlib.h:3890: error: syntax error before "_X_SENTINEL"
/usr/include/X11/Xlib.h:3894: error: syntax error before "_X_SENTINEL"
/usr/include/X11/Xlib.h:3934: error: syntax error before "_X_SENTINEL"
make[3]: *** [bookmarks.o] Error 1
make: *** [all] Error 2


So I stripped out all my changes, and compiled it again to no errors.
It turns out, if I add this one line:

#include <hildon/hildon-program.h>

and try to compile I get that string of errors up there with no other changes being made.
Is there something hinkey in my SDK or in scratchbox or possibly even on the host distro (Debian Etch)?
I am at a loss, but I certainly can not continue where like this. Does anyone know what might be causing this or how to remedy it?


Thanks,

-John
 
Bundyo's Avatar
Posts: 4,708 | Thanked: 4,649 times | Joined on Oct 2007 @ Bulgaria
#2
You should have include path to hildon-1 and link the lib too.

-I/usr/include/hildon-1
-lhildon-1

or something in these lines
 

The Following 2 Users Say Thank You to Bundyo For This Useful Post:
tobiasj's Avatar
Posts: 241 | Thanked: 74 times | Joined on Jul 2007
#3
Originally Posted by Bundyo View Post
You should have include path to hildon-1 and link the lib too.

-I/usr/include/hildon-1
-lhildon-1

or something in these lines
You mean in the code, where I put the include statements for hildon-program I should also put those lines?

-John
 
tobiasj's Avatar
Posts: 241 | Thanked: 74 times | Joined on Jul 2007
#4
so even after adding the hildon-1 include I still get the same errors on compile. is the version of x on my comp too old or too new? i just dont see why it happens...


-John
 
Posts: 3,841 | Thanked: 1,079 times | Joined on Nov 2006
#5
Originally Posted by tobiasj View Post
You mean in the code, where I put the include statements for hildon-program I should also put those lines?
No, you add those to the compile line in the Makefile (I presume you have one):

e.g.

gcc -o your-application -I/usr/include/hildon-1 your-files.c -lhildon-1

(i.e. you tell the compiler/preprocessor to add /usr/include/hildon-1 to the search path for header files, and to link with libhildon-1.so during the linking stage).

Depending on how your Makefile is set up the above example may have to be split out to different parts of the Makefile, but I hope you get the idea.
__________________
N800/OS2007|N900/Maemo5
-- Metalayer-crawler delenda est.
-- Current state: Fed up with everything MeeGo.
 

The Following 2 Users Say Thank You to TA-t3 For This Useful Post:
tobiasj's Avatar
Posts: 241 | Thanked: 74 times | Joined on Jul 2007
#6
Originally Posted by TA-t3 View Post
No, you add those to the compile line in the Makefile (I presume you have one):

e.g.

gcc -o your-application -I/usr/include/hildon-1 your-files.c -lhildon-1

(i.e. you tell the compiler/preprocessor to add /usr/include/hildon-1 to the search path for header files, and to link with libhildon-1.so during the linking stage).

Depending on how your Makefile is set up the above example may have to be split out to different parts of the Makefile, but I hope you get the idea.
I do think I understand what you mean, course as I admitted to at the very beginning of this thread I really have little idea what I am doing. I have looked through the Makefile and (I think since it is an autogenerated Makefile) that it is overly complicated. I see this:

DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
DEP_FILES = ./$(DEPDIR)/bookmarks.Po \
./$(DEPDIR)/chmod_dialog.Po \
./$(DEPDIR)/delete_dialog.Po ./$(DEPDIR)/dnd.Po \
./$(DEPDIR)/gtkui_transfer.Po \
./$(DEPDIR)/menu-items.Po ./$(DEPDIR)/misc-gtk.Po \
./$(DEPDIR)/options_dialog.Po \
./$(DEPDIR)/transfer.Po ./$(DEPDIR)/view_dialog.Po
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@

And I assume I need to add to the DEFAULT_INCLUDES line. So I am going to figure out how that has to be added and try that. Thanks for your help.
Of course, I am sure I am in over my head trying to 'hildonize' this application since I can not even figure out how to add the #include <hildon/hildon-program.h> line without the entire thing crashing to its knees. But what else have I got to do on a rainy weekend...

-John
 
Bundyo's Avatar
Posts: 4,708 | Thanked: 4,649 times | Joined on Oct 2007 @ Bulgaria
#7
You should add the include dirs to SOMETHING_CFLAGS and libs to SOMETHING_LIBS in the Makefile in the dir, where the source in question is located. Thats just a temp solution though, since the next configure will replace it.
 

The Following 2 Users Say Thank You to Bundyo For This Useful Post:
tobiasj's Avatar
Posts: 241 | Thanked: 74 times | Joined on Jul 2007
#8
So ok I did this to the Makefile

DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) -I/usr/include/hildon-1
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
DEP_FILES = ./$(DEPDIR)/bookmarks.Po \
./$(DEPDIR)/chmod_dialog.Po \
./$(DEPDIR)/delete_dialog.Po ./$(DEPDIR)/dnd.Po \
./$(DEPDIR)/gtkui_transfer.Po \
./$(DEPDIR)/menu-items.Po ./$(DEPDIR)/misc-gtk.Po \
./$(DEPDIR)/options_dialog.Po \
./$(DEPDIR)/transfer.Po ./$(DEPDIR)/view_dialog.Po
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -lhildon-1 -o $@
DIST_SOURCES = $(gftp_gtk_SOURCES)
HEADERS = $(noinst_HEADERS)

Then did a make clean / make and it compiled properly.

then I added:
#include <gtk/gtk.h>
#include <gdk/gdkkeysyms.h>
#include <pthread.h>
#include <hildon/hildon-program.h>

to the myprogram.h with the rest of the includes.

did a make clean / make and got this:

In file included from /usr/include/gtk-2.0/gdk/gdkx.h:33,
from /usr/include/hildon-1/hildon/hildon-window.h:33,
from /usr/include/hildon-1/hildon/hildon-program.h:29,
from bookmarks.c:20:
/usr/include/X11/Xlib.h:3578: error: syntax error before "_X_SENTINEL"
/usr/include/X11/Xlib.h:3583: error: syntax error before "_X_SENTINEL"
/usr/include/X11/Xlib.h:3596: error: syntax error before "_X_SENTINEL"
/usr/include/X11/Xlib.h:3609: error: syntax error before "_X_SENTINEL"
/usr/include/X11/Xlib.h:3614: error: syntax error before "_X_SENTINEL"
/usr/include/X11/Xlib.h:3846: error: syntax error before "_X_SENTINEL"
/usr/include/X11/Xlib.h:3850: error: syntax error before "_X_SENTINEL"
/usr/include/X11/Xlib.h:3862: error: syntax error before "_X_SENTINEL"
/usr/include/X11/Xlib.h:3890: error: syntax error before "_X_SENTINEL"
/usr/include/X11/Xlib.h:3894: error: syntax error before "_X_SENTINEL"
/usr/include/X11/Xlib.h:3934: error: syntax error before "_X_SENTINEL"
make: *** [bookmarks.o] Error 1

So either I completely missed the point, or that isn't the problem. I admit at this point that it could be either or both..

-John
 
Bundyo's Avatar
Posts: 4,708 | Thanked: 4,649 times | Joined on Oct 2007 @ Bulgaria
#9
Okay, can you upload the source somewhere so that i can take a look.
 

The Following User Says Thank You to Bundyo For This Useful Post:
tobiasj's Avatar
Posts: 241 | Thanked: 74 times | Joined on Jul 2007
#10
Originally Posted by Bundyo View Post
You should add the include dirs to SOMETHING_CFLAGS and libs to SOMETHING_LIBS in the Makefile in the dir, where the source in question is located. Thats just a temp solution though, since the next configure will replace it.
How do I make changes to the configure script or the Makefile.am so that these lines get added on configure?

I put this into the Makefile:

GLIB_CFLAGS = -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/hildon-1
GLIB_CONFIG =
GLIB_LIBS = -lglib-2.0 -lhildon-1
GMSGFMT = /scratchbox/tools/bin/msgfmt
GTHREAD_LIBS = -lgthread-2.0
GTK_CFLAGS = -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/include/hildon-1
GTK_CONFIG =
GTK_LIBS = -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lm -lpangocairo-1.0 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0 -ldl -lglib-2.0 -lhildon-1


and did a make clean / make and got:

In file included from /usr/include/gtk-2.0/gdk/gdkx.h:33,
from /usr/include/hildon-1/hildon/hildon-window.h:33,
from /usr/include/hildon-1/hildon/hildon-program.h:29,
from bookmarks.c:20:
/usr/include/X11/Xlib.h:3578: error: syntax error before "_X_SENTINEL"
/usr/include/X11/Xlib.h:3583: error: syntax error before "_X_SENTINEL"
/usr/include/X11/Xlib.h:3596: error: syntax error before "_X_SENTINEL"
/usr/include/X11/Xlib.h:3609: error: syntax error before "_X_SENTINEL"
/usr/include/X11/Xlib.h:3614: error: syntax error before "_X_SENTINEL"
/usr/include/X11/Xlib.h:3846: error: syntax error before "_X_SENTINEL"
/usr/include/X11/Xlib.h:3850: error: syntax error before "_X_SENTINEL"
/usr/include/X11/Xlib.h:3862: error: syntax error before "_X_SENTINEL"
/usr/include/X11/Xlib.h:3890: error: syntax error before "_X_SENTINEL"
/usr/include/X11/Xlib.h:3894: error: syntax error before "_X_SENTINEL"
/usr/include/X11/Xlib.h:3934: error: syntax error before "_X_SENTINEL"
make: *** [bookmarks.o] Error 1

And though I have no intention of giving up, I am becoming slightly discouraged..

-John
 
Reply


 
Forum Jump


All times are GMT. The time now is 14:14.