Opened 9 years ago

Closed 9 years ago

#12178 closed bug (invalid)

Header error in support/Archivable.h

Reported by: haiqu Owned by: nobody
Priority: normal Milestone: Unscheduled
Component: - General Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Platform: All

Description

support/Archivable.h calls <image.h>

This isn't found, since the directory it lives in isn't in the header path.

Should be <kernel/image.h>

This header is required fpor the definition of image_id in the following line:

BArchivable* instantiate_object(BMessage* from, image_id* id);

Change History (7)

comment:1 by axeld, 9 years ago

Can you please give more info? The public "kernel" headers are definitely in the standard search path. You must be doing something weird :-)

comment:2 by haiqu, 9 years ago

Ah, I see you've discovered my secret. :-)

I was building q4wine which uses cmake. Evidently it doesn't use BEINCLUDES or any other environment variables. I hate cmake.

Last edited 9 years ago by haiqu (previous) (diff)

comment:3 by haiqu, 9 years ago

Here's the actual error:

In file included from /boot/system/develop/headers/os/interface/Gradient.h:9:0,
                 from /boot/home/gui/qt-4.8.7/include/QtGui/qwindowdefs_haiku.h:58,
                 from /boot/home/gui/qt-4.8.7/include/QtGui/qwindowdefs.h:146,
                 from /boot/home/gui/qt-4.8.7/include/QtGui/qwidget.h:46,
                 from /boot/home/gui/qt-4.8.7/include/QtGui/qdialog.h:45,
                 from /boot/home/gui/qt-4.8.7/include/QtGui/qmessagebox.h:45,
                 from /boot/home/gui/qt-4.8.7/include/QtGui/QMessageBox:1,
                 from /Work/gui/q4wine/src/q4wine-lib/q4wine-lib.h:35,
                 from /Work/gui/q4wine/src/q4wine-lib/q4wine-lib.cpp:19:
/boot/system/develop/headers/os/support/Archivable.h:160:49: error: 'image_id' has not been declared
 BArchivable* instantiate_object(BMessage* from, image_id* id);
                                                 ^

Tested with cmake 2.8.12 & cmake 3.2.3_x86 and I note that they DO both have a path to the kernel headers directory included in the patch file.

comment:4 by korli, 9 years ago

You think that it doesn't find <image.h>. In that case, the build would fail with such an error (or it does, but you fail to include a complete log). So this means it found another image.h to include.

Please include the full gcc build command. You can also try to dump the preprocessing replacing "-c" with "-E". This should help you to find out what happens.

comment:5 by haiqu, 9 years ago

No, I *know* it doesn't find <image.h> because that's where image_id is defined.

I also know this because adding

#include <kernel/image.h>

to include/QtGui/qwindowdefs_haiku.h (or changing it in support/Archivable.h and rebuilding the system) fixes the issue. However I shouldn't have to do that if cmake is capable of finding it. Which it isn't, in this situation.

Currently the headers are very gnu-centric and rely on environment variables. Not all build systems work that way.

in reply to:  5 comment:6 by korli, 9 years ago

Replying to haiqu:

No, I *know* it doesn't find <image.h> because that's where image_id is defined.

You don't seem to understand my point. It does find a image.h, but not the one you think, because otherwise it would fail with "image.h not found".

comment:7 by axeld, 9 years ago

Resolution: invalid
Status: newclosed

In any case, this is a build issue outside of Haiku. You need to change the your build so that it will find the right header.

Note: See TracTickets for help on using tickets.