gobo icon indicating copy to clipboard operation
gobo copied to clipboard

is it possible to support: **** language not recognized: C Macro use <ev_gtk.h>

Open mw66 opened this issue 1 year ago • 56 comments

         I don't know if it can compile everything in EiffelVision2, but I have an application which uses some parts of it and I managed to compile and run it under Windows. I can see that you are under Linux (I guess). I never tried to compile an application using EiffelVision2 on this platform.

Originally posted by @ebezault in https://github.com/gobo-eiffel/gobo/issues/70#issuecomment-1975284478

I tried

/Eiffel_23.09/examples/docking/simple$ gec docking_simple.ecf 
Degree 6: 0/0/0 0:0:0.112
Degree 5: 0/0/0 0:0:0.473
Degree 4: 0/0/0 0:0:0.449
Degree 3: 0/0/0 0:0:0.226

....

Degree -2: 0/0/0 0:0:2.149
**** language not recognized: C [macro <ev_gtk.h>] | "eif_argv.h"
[GIAAA] internal error.
----
**** language not recognized: C Macro use <ev_gtk.h>
Degree -3: 0/0/0 0:0:1.164
Total Time: 0/0/0 0:0:4.576

I'm wondering if it possible to support: **** language not recognized: C Macro use <ev_gtk.h>

So I can compile this project?

Thanks.

mw66 avatar Mar 03 '24 23:03 mw66

I just fixed these external routine issues.

But when I see these messages:

Dynamic type set not built for external feature [detachable] EV_TITLED_WINDOW_IMP.eif_object_from_c
Dynamic type set not built for external feature [detachable] EV_RICH_TEXT_IMP.eif_object_from_c
Dynamic type set not built for external feature [detachable] EV_GTK_CALLBACK_MARSHAL.c_get_eif_reference_from_object_id
Dynamic type set not built for external feature detachable EV_ANY_IMP.eif_object_from_c
Dynamic type set not built for external feature [detachable] EV_CELL_IMP.eif_object_from_c
Dynamic type set not built for external feature [detachable] EV_VIEWPORT_IMP.eif_object_from_c
Dynamic type set not built for external feature [detachable] EV_FIXED_IMP.eif_object_from_c
Dynamic type set not built for external feature detachable EV_VERTICAL_BOX_IMP.eif_object_from_c
Dynamic type set not built for external feature detachable EV_POPUP_WINDOW_IMP.eif_object_from_c
Dynamic type set not built for external feature [detachable] EV_BUTTON_IMP.eif_object_from_c
Dynamic type set not built for external feature [detachable] MEMORY.find_instance_of
Dynamic type set not built for external feature [detachable] EV_HORIZONTAL_BOX_IMP.eif_object_from_c
Dynamic type set not built for external feature [detachable] EV_DIALOG_IMP.eif_object_from_c
Dynamic type set not built for external feature [detachable] EV_FRAME_IMP.eif_object_from_c
Dynamic type set not built for external feature [detachable] SD_DRAWING_AREA_IMP.eif_object_from_c
Dynamic type set not built for external feature [detachable] EV_SCROLLABLE_AREA_IMP.eif_object_from_c
Dynamic type set not built for external feature detachable EV_PIXMAP_IMP.eif_object_from_c
Dynamic type set not built for external feature detachable EV_WINDOW_IMP.eif_object_from_c
Dynamic type set not built for external feature [detachable] EV_TEXT_IMP.eif_object_from_c
Dynamic type set not built for external feature [detachable] EV_LABEL_IMP.eif_object_from_c
Dynamic type set not built for external feature [detachable] EV_HORIZONTAL_SPLIT_AREA_IMP.eif_object_from_c
Dynamic type set not built for external feature [detachable] EV_VERTICAL_SPLIT_AREA_IMP.eif_object_from_c
Dynamic type set not built for external feature [detachable] EV_LIST_IMP.eif_object_from_c
Dynamic type set not built for external feature [detachable] EV_DRAWING_AREA_IMP.eif_object_from_c
Dynamic type set not built for external feature [detachable] SD_WINDOW_IMP.eif_object_from_c
Dynamic type set not built for external feature detachable EV_TOOL_BAR_IMP.eif_object_from_c
Dynamic type set not built for external feature [detachable] EV_DOCKABLE_SOURCE_HINT_IMP.eif_object_from_c
Dynamic type set not built for external feature [detachable] EV_TEXT_FIELD_IMP.eif_object_from_c
Dynamic type set not built for external feature [detachable] EV_MENU_IMP.eif_object_from_c

there is a good chance that the program will not work as expected (and probably crash). I can see how to figure out what would be the dynamic type set of eif_object_from_c, but it will take some time and effort to implement it in gec.

ebezault avatar Mar 04 '24 01:03 ebezault

OK, thanks.

mw66 avatar Mar 04 '24 01:03 mw66

On a second thought: I don't need the GUI application to run (correctly), I only need to be able to build the project binary: I will just create a object, and do some reference equality check and print, that's all.

Esp., I'm trying this example now: /Eiffel_23.09/examples/docking/simple

Is it possible to make the gec build work for this project?

Currently the error is:

/Eiffel_23.09/examples/docking/simple$ gec ./docking_simple.ecf
Degree 6: 0/0/0 0:0:0.130
Degree 5: 0/0/0 0:0:0.481
Degree 4: 0/0/0 0:0:0.440
Degree 3: 0/0/0 0:0:0.226
Dynamic type set not built for external feature [detachable] EV_TITLED_WINDOW_IMP.eif_object_from_c
Dynamic type set not built for external feature [detachable] EV_RICH_TEXT_IMP.eif_object_from_c
Dynamic type set not built for external feature [detachable] EV_GTK_CALLBACK_MARSHAL.c_get_eif_reference_from_object_id
Dynamic type set not built for external feature [detachable] EV_CELL_IMP.eif_object_from_c
Dynamic type set not built for external feature detachable EV_ANY_IMP.eif_object_from_c
Dynamic type set not built for external feature [detachable] EV_VIEWPORT_IMP.eif_object_from_c
Dynamic type set not built for external feature [detachable] EV_FIXED_IMP.eif_object_from_c
Dynamic type set not built for external feature detachable EV_VERTICAL_BOX_IMP.eif_object_from_c
Dynamic type set not built for external feature detachable EV_POPUP_WINDOW_IMP.eif_object_from_c
Dynamic type set not built for external feature [detachable] EV_BUTTON_IMP.eif_object_from_c
Dynamic type set not built for external feature [detachable] MEMORY.find_instance_of
Dynamic type set not built for external feature [detachable] EV_HORIZONTAL_BOX_IMP.eif_object_from_c
Dynamic type set not built for external feature [detachable] EV_DIALOG_IMP.eif_object_from_c
Dynamic type set not built for external feature [detachable] EV_FRAME_IMP.eif_object_from_c
Dynamic type set not built for external feature [detachable] SD_DRAWING_AREA_IMP.eif_object_from_c
Dynamic type set not built for external feature [detachable] EV_SCROLLABLE_AREA_IMP.eif_object_from_c
Dynamic type set not built for external feature detachable EV_PIXMAP_IMP.eif_object_from_c
Dynamic type set not built for external feature detachable EV_WINDOW_IMP.eif_object_from_c
Dynamic type set not built for external feature [detachable] EV_TEXT_IMP.eif_object_from_c
Dynamic type set not built for external feature [detachable] EV_LABEL_IMP.eif_object_from_c
Dynamic type set not built for external feature [detachable] EV_HORIZONTAL_SPLIT_AREA_IMP.eif_object_from_c
Dynamic type set not built for external feature [detachable] EV_VERTICAL_SPLIT_AREA_IMP.eif_object_from_c
Dynamic type set not built for external feature [detachable] EV_LIST_IMP.eif_object_from_c
Dynamic type set not built for external feature [detachable] EV_DRAWING_AREA_IMP.eif_object_from_c
Dynamic type set not built for external feature [detachable] SD_WINDOW_IMP.eif_object_from_c
Dynamic type set not built for external feature detachable EV_TOOL_BAR_IMP.eif_object_from_c
Dynamic type set not built for external feature [detachable] EV_DOCKABLE_SOURCE_HINT_IMP.eif_object_from_c
Dynamic type set not built for external feature [detachable] EV_TEXT_FIELD_IMP.eif_object_from_c
Dynamic type set not built for external feature [detachable] EV_MENU_IMP.eif_object_from_c
[CATCALL] class detachable SD_TOOL_BAR_ZONE (592,14): type '[detachable] SD_TOOL_BAR_NARROW_BUTTON' of actual argument #1 does not conform to type '[attached] SD_TOOL_BAR_MENU_ITEM' of formal argument in feature `has' in class '[detachable] SD_MENU_BAR'
[CATCALL] class detachable SD_TOOL_BAR_ZONE (592,14): type '[detachable] SD_TOOL_BAR_BUTTON' of actual argument #1 does not conform to type '[attached] SD_TOOL_BAR_MENU_ITEM' of formal argument in feature `has' in class '[detachable] SD_MENU_BAR'
[CATCALL] class detachable SD_TOOL_BAR_ZONE (592,14): type '[detachable] SD_TOOL_BAR_SEPARATOR' of actual argument #1 does not conform to type '[attached] SD_TOOL_BAR_MENU_ITEM' of formal argument in feature `has' in class '[detachable] SD_MENU_BAR'
[CATCALL] class detachable SD_TOOL_BAR_ZONE (592,14): type '[detachable] SD_TOOL_BAR_WIDTH_BUTTON' of actual argument #1 does not conform to type '[attached] SD_TOOL_BAR_MENU_ITEM' of formal argument in feature `has' in class '[detachable] SD_MENU_BAR'
[CATCALL] class detachable SD_TOOL_BAR_ZONE (592,14): type '[detachable] SD_TOOL_BAR_FONT_BUTTON' of actual argument #1 does not conform to type '[attached] SD_TOOL_BAR_MENU_ITEM' of formal argument in feature `has' in class '[detachable] SD_MENU_BAR'
[CATCALL] class detachable SD_TOOL_BAR_ZONE (464,4): type '[detachable] SD_TOOL_BAR_NARROW_BUTTON' of actual argument #1 does not conform to type '[attached] SD_TOOL_BAR_MENU_ITEM' of formal argument in feature `prune' in class '[detachable] SD_MENU_BAR'
[CATCALL] class detachable SD_TOOL_BAR_ZONE (464,4): type '[detachable] SD_TOOL_BAR_BUTTON' of actual argument #1 does not conform to type '[attached] SD_TOOL_BAR_MENU_ITEM' of formal argument in feature `prune' in class '[detachable] SD_MENU_BAR'
[CATCALL] class detachable SD_TOOL_BAR_ZONE (464,4): type '[detachable] SD_TOOL_BAR_SEPARATOR' of actual argument #1 does not conform to type '[attached] SD_TOOL_BAR_MENU_ITEM' of formal argument in feature `prune' in class '[detachable] SD_MENU_BAR'
[CATCALL] class detachable SD_TOOL_BAR_ZONE (464,4): type '[detachable] SD_TOOL_BAR_WIDTH_BUTTON' of actual argument #1 does not conform to type '[attached] SD_TOOL_BAR_MENU_ITEM' of formal argument in feature `prune' in class '[detachable] SD_MENU_BAR'
[CATCALL] class detachable SD_TOOL_BAR_ZONE (464,4): type '[detachable] SD_TOOL_BAR_FONT_BUTTON' of actual argument #1 does not conform to type '[attached] SD_TOOL_BAR_MENU_ITEM' of formal argument in feature `prune' in class '[detachable] SD_MENU_BAR'
[CATCALL] class [detachable] SD_TOOL_BAR_ZONE_ASSISTANT (174,7): type '[detachable] SD_TOOL_BAR_NARROW_BUTTON' of actual argument #1 does not conform to type '[attached] SD_TOOL_BAR_MENU_ITEM' of formal argument in feature `extend' in class '[detachable] SD_MENU_BAR'
[CATCALL] class [detachable] SD_TOOL_BAR_ZONE_ASSISTANT (172,7): type '[detachable] SD_TOOL_BAR_NARROW_BUTTON' of actual argument #1 does not conform to type '[attached] SD_TOOL_BAR_MENU_ITEM' of formal argument in feature `prune' in class '[detachable] SD_MENU_BAR'
[CATCALL] class detachable SD_TOOL_BAR_ZONE (803,5): type '[detachable] SD_TOOL_BAR_NARROW_BUTTON' of actual argument #1 does not conform to type '[attached] SD_TOOL_BAR_MENU_ITEM' of formal argument in feature `extend' in class '[detachable] SD_MENU_BAR'
[CATCALL] class detachable SD_TOOL_BAR_ZONE (803,5): type '[detachable] SD_TOOL_BAR_BUTTON' of actual argument #1 does not conform to type '[attached] SD_TOOL_BAR_MENU_ITEM' of formal argument in feature `extend' in class '[detachable] SD_MENU_BAR'
[CATCALL] class detachable SD_TOOL_BAR_ZONE (803,5): type '[detachable] SD_TOOL_BAR_SEPARATOR' of actual argument #1 does not conform to type '[attached] SD_TOOL_BAR_MENU_ITEM' of formal argument in feature `extend' in class '[detachable] SD_MENU_BAR'
[CATCALL] class detachable SD_TOOL_BAR_ZONE (803,5): type '[detachable] SD_TOOL_BAR_WIDTH_BUTTON' of actual argument #1 does not conform to type '[attached] SD_TOOL_BAR_MENU_ITEM' of formal argument in feature `extend' in class '[detachable] SD_MENU_BAR'
[CATCALL] class detachable SD_TOOL_BAR_ZONE (803,5): type '[detachable] SD_TOOL_BAR_FONT_BUTTON' of actual argument #1 does not conform to type '[attached] SD_TOOL_BAR_MENU_ITEM' of formal argument in feature `extend' in class '[detachable] SD_MENU_BAR'
Degree -2: 0/0/0 0:0:2.119
**** language not recognized: C [macro <ev_gtk.h>] | "eif_argv.h"
[GIAAA] internal error.
----
**** language not recognized: C Macro use <ev_gtk.h>
Degree -3: 0/0/0 0:0:1.156
Total Time: 0/0/0 0:0:4.553

mw66 avatar Mar 04 '24 05:03 mw66

Yesterday I fixed these errors:

**** language not recognized: C [macro <ev_gtk.h>] | "eif_argv.h"
[GIAAA] internal error.
----
**** language not recognized: C Macro use <ev_gtk.h>

The CATCALL messages are just warnings. The Dynamic type set are more problematic, but they should not prevent from generating the executable. So if you get the latest version of the repository, you should be able to generate an executable.

ebezault avatar Mar 04 '24 08:03 ebezault

So if you get the latest version of the repository, you should be able to generate an executable.

Thanks. I will give it a try tomorrow.

mw66 avatar Mar 04 '24 08:03 mw66

With the latest github repo, got this error

Degree -3: 0/0/0 0:0:0.569
docking_simple5.c: In function ‘T596s6’:
docking_simple5.c:57248:58: error: expected ‘;’ before ‘}’ token
57248 | gtk_paned_set_wide_handle ((GtkPaned*) a1, (gboolean) a2)
      |                                                          ^
      |                                                          ;
57249 | #endif
57250 |         }
      |         ~                                                 

we can see the gtk_paned_set_wide_handle(...) statement missing ;:

/* GTK3.gtk_paned_set_wide_handle */
void T596s6(TC* ac, T479 a1, T453 a2)
{
        {
#if GTK_CHECK_VERSION(3,16,0)
gtk_paned_set_wide_handle ((GtkPaned*) a1, (gboolean) a2)
#endif
        }
}

mw66 avatar Mar 04 '24 18:03 mw66

The semicolon is also missing in the Eiffel code:

	frozen gtk_paned_set_wide_handle (a_paned: POINTER; a_wide: BOOLEAN)
		external
			"C inline use <ev_gtk.h>"
		alias
			"[
				#if GTK_CHECK_VERSION(3,16,0)
				gtk_paned_set_wide_handle ((GtkPaned*) $a_paned, (gboolean) $a_wide)
				#endif
			]"
		ensure
			is_class: class
		end

I'll see what I can do to let the Eiffel compiler add this missing semicolon in the generated C code.

ebezault avatar Mar 04 '24 18:03 ebezault

Also got error:

docking_simple4.c: In function ‘T211f2sc1’:
docking_simple4.c:49016:17: error: ‘t1’ undeclared (first use in this function); did you mean ‘tr’?
49016 |                 t1 = (T444)(GE_int8(2));
      |                 ^~

I checked that generated C func, var t1 indeed is undeclared.

mw66 avatar Mar 04 '24 18:03 mw66

It looks like an inlining problem. I need to investigate. In the meantime, add this command-line option to gec:

--setting=inlining=False

ebezault avatar Mar 04 '24 20:03 ebezault

added --setting=inlining=False, now the remaining errors:

In file included from docking_simple3.c:1:
docking_simple3.c: In function ‘T691f211’:
docking_simple3.c:13715:39: error: ‘eif_argc’ undeclared (first use in this function); did you mean ‘eif_proc’?
13715 |         R = EIF_TEST(gtk_init_check (&eif_argc, &eif_argv));
      |                                       ^~~~~~~~
docking_simple.h:259:23: note: in definition of macro ‘EIF_TEST’
  259 | #define EIF_TEST(x) ((x) ? EIF_TRUE : EIF_FALSE)
      |                       ^
docking_simple3.c:13715:39: note: each undeclared identifier is reported only once for each function it appears in
13715 |         R = EIF_TEST(gtk_init_check (&eif_argc, &eif_argv));
      |                                       ^~~~~~~~
docking_simple.h:259:23: note: in definition of macro ‘EIF_TEST’
  259 | #define EIF_TEST(x) ((x) ? EIF_TRUE : EIF_FALSE)
      |                       ^
docking_simple3.c:13715:50: error: ‘eif_argv’ undeclared (first use in this function)
13715 |         R = EIF_TEST(gtk_init_check (&eif_argc, &eif_argv));
      |                                                  ^~~~~~~~
docking_simple.h:259:23: note: in definition of macro ‘EIF_TEST’
  259 | #define EIF_TEST(x) ((x) ? EIF_TRUE : EIF_FALSE)
      |                       ^
Degree -4: 0/0/0 0:0:8.089
Total Time: 0/0/0 0:0:10.131

mw66 avatar Mar 04 '24 20:03 mw66

The semicolon is also missing in the Eiffel code:

... I'll see what I can do to let the Eiffel compiler add this missing semicolon in the generated C code.

I manually add ; at line 274 of

/Eiffel_23.09/library/vision2/implementation/gtk3/support/externals/gtk3.e

as temp fix.

mw66 avatar Mar 04 '24 20:03 mw66

added --setting=inlining=False, now the remaining errors:

In file included from docking_simple3.c:1:
docking_simple3.c: In function ‘T691f211’:
docking_simple3.c:13715:39: error: ‘eif_argc’ undeclared (first use in this function); did you mean ‘eif_proc’?
13715 |         R = EIF_TEST(gtk_init_check (&eif_argc, &eif_argv));
      |                                       ^~~~~~~~
docking_simple.h:259:23: note: in definition of macro ‘EIF_TEST’
  259 | #define EIF_TEST(x) ((x) ? EIF_TRUE : EIF_FALSE)
      |                       ^
docking_simple3.c:13715:39: note: each undeclared identifier is reported only once for each function it appears in
13715 |         R = EIF_TEST(gtk_init_check (&eif_argc, &eif_argv));
      |                                       ^~~~~~~~
docking_simple.h:259:23: note: in definition of macro ‘EIF_TEST’
  259 | #define EIF_TEST(x) ((x) ? EIF_TRUE : EIF_FALSE)
      |                       ^
docking_simple3.c:13715:50: error: ‘eif_argv’ undeclared (first use in this function)
13715 |         R = EIF_TEST(gtk_init_check (&eif_argc, &eif_argv));
      |                                                  ^~~~~~~~
docking_simple.h:259:23: note: in definition of macro ‘EIF_TEST’
  259 | #define EIF_TEST(x) ((x) ? EIF_TRUE : EIF_FALSE)
      |                       ^
Degree -4: 0/0/0 0:0:8.089
Total Time: 0/0/0 0:0:10.131

It looks like you chose some Eiffel application which uses C code which itself relies on ISE Eiffel's runtime. Not the best choice to start with :-) I'll address this issues one after the other...

ebezault avatar Mar 04 '24 20:03 ebezault

added --setting=inlining=False, now the remaining errors:

In file included from docking_simple3.c:1:
docking_simple3.c: In function ‘T691f211’:
docking_simple3.c:13715:39: error: ‘eif_argc’ undeclared (first use in this function); did you mean ‘eif_proc’?
13715 |         R = EIF_TEST(gtk_init_check (&eif_argc, &eif_argv));
      |                                       ^~~~~~~~
docking_simple.h:259:23: note: in definition of macro ‘EIF_TEST’
  259 | #define EIF_TEST(x) ((x) ? EIF_TRUE : EIF_FALSE)
      |                       ^
docking_simple3.c:13715:39: note: each undeclared identifier is reported only once for each function it appears in
13715 |         R = EIF_TEST(gtk_init_check (&eif_argc, &eif_argv));
      |                                       ^~~~~~~~
docking_simple.h:259:23: note: in definition of macro ‘EIF_TEST’
  259 | #define EIF_TEST(x) ((x) ? EIF_TRUE : EIF_FALSE)
      |                       ^
docking_simple3.c:13715:50: error: ‘eif_argv’ undeclared (first use in this function)
13715 |         R = EIF_TEST(gtk_init_check (&eif_argc, &eif_argv));
      |                                                  ^~~~~~~~
docking_simple.h:259:23: note: in definition of macro ‘EIF_TEST’
  259 | #define EIF_TEST(x) ((x) ? EIF_TRUE : EIF_FALSE)
      |                       ^
Degree -4: 0/0/0 0:0:8.089
Total Time: 0/0/0 0:0:10.131

It looks like you chose some Eiffel application which uses C code which itself relies on ISE Eiffel's runtime. Not the best choice to start with :-) I'll address this issues one after the other...

Since I won't pass in any program args, I will just hard code 0 and null.

Please let me know which file to change?

mw66 avatar Mar 04 '24 20:03 mw66

Since I won't pass in any program args, I will just hard code 0 and null.

Please let me know which file to change?

Here, in EV_APPLICATION_IMP.gtk_init_check.

ebezault avatar Mar 04 '24 21:03 ebezault

OK, I change it to return 1 (as boolean):

                        "/* gtk_init_check (&eif_argc, &eif_argv) */ 1"

Now, the final problem:

/usr/bin/ld: /lib/x86_64-linux-gnu/libgtk-3.so: undefined reference to symbol 'gdk_window_hide'
/usr/bin/ld: /lib/x86_64-linux-gnu/libgdk-3.so: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
Degree -4: 0/0/0 0:0:9.261

Do you know which lib have gdk_window_hide defined?

mw66 avatar Mar 04 '24 21:03 mw66

Do you know which lib have gdk_window_hide defined?

No.

ebezault avatar Mar 04 '24 22:03 ebezault

fixed by add to /gobo/tool/gec/backend/c/config/gcc.cfg link:

`pkg-config --libs gdk-3.0` `pkg-config --libs gtk+-3.0` `pkg-config --libs glib-2.0` `pkg-config --libs gmodule-2.0` `pkg-config --libs x11`

mw66 avatar Mar 04 '24 22:03 mw66

(.text+0x45): undefined reference to `eif_adopt'
/usr/bin/ld: (.text+0x57): undefined reference to `eif_wean'
(.text+0x8b): undefined reference to `eif_id_object'
(.text+0x6c9): undefined reference to `eif_protect'

I saw /gobo/tool/gec/runtime/c/ge_gc.h macro for eif_protect eif_wean eif_adopt

How to let the build see these macros first? (Ideally, GOBO should also define these as functions instead of macros, so user won't have link error when compile ISE project.)

And what's the GOBO equivalent of eif_id_object?

mw66 avatar Mar 04 '24 22:03 mw66

fixed by add to /gobo/tool/gec/backend/c/config/gcc.cfg link:

`pkg-config --libs gdk-3.0` `pkg-config --libs gtk+-3.0` `pkg-config --libs glib-2.0` `pkg-config --libs gmodule-2.0` `pkg-config --libs x11`

I wonder what they do for that in the ISE Eiffel compiler. It should be somewhere in the ECF files! Ideally gec should add all these on the fly when needed, and not all the time even for non-gtk applications.

ebezault avatar Mar 04 '24 22:03 ebezault

fixed by add to /gobo/tool/gec/backend/c/config/gcc.cfg link:

`pkg-config --libs gdk-3.0` `pkg-config --libs gtk+-3.0` `pkg-config --libs glib-2.0` `pkg-config --libs gmodule-2.0` `pkg-config --libs x11`

I wonder what they do for that in the ISE Eiffel compiler. It should be somewhere in the ECF files! Ideally gec should add all these on the fly when needed, and not all the time even for non-gtk applications.

(I know I'm just hacking here).

./docking_simple.ecf does not have these libraries.

mw66 avatar Mar 04 '24 22:03 mw66

(.text+0x45): undefined reference to `eif_adopt'
/usr/bin/ld: (.text+0x57): undefined reference to `eif_wean'
(.text+0x8b): undefined reference to `eif_id_object'
(.text+0x6c9): undefined reference to `eif_protect'

I saw /gobo/tool/gec/runtime/c/ge_gc.h macro for eif_protect eif_wean eif_adopt

How to let the build see these macros first?

And what's the GOBO equivalent of eif_id_object?

For eif_adopt, eif_protect and eif_wean, you should get and build the latest version of gec. It works for the cURL example. For eif_id_object I need to look at the ISE Eiffel code to see what it does in order to provide an equivalent implementation in gec.

ebezault avatar Mar 04 '24 22:03 ebezault

For eif_adopt, eif_protect and eif_wean, you should get and build the latest version of gec. It works for the cURL example.

I'm using the latest version of gec:

$ gec --version
gec version xx.xx.xx+xxxxxxxxx

Ideally, GOBO should also define these as functions instead of macros, so user won't have link error when compiling ISE project.

mw66 avatar Mar 04 '24 22:03 mw66

I'm using the latest version of gec:

SHA 824c7e779f1e712bd085842438d3820ae188929f

Ideally, GOBO should also define these as functions instead of macros, so user won't have link error when compiling ISE project.

Why? You would still have to make sure that the C code of these functions are compiled into the resulting executable. They are also macros in the ISE Eiffel implementation.

ebezault avatar Mar 04 '24 22:03 ebezault

I'm using the latest version of gec:

SHA 824c7e7

Yes, I'm using this, just synced 10-minutes ago. Maybe you want to update gec version xx.xx.xx+xxxxxxxxx with some stamp even during dev.

Ideally, GOBO should also define these as functions instead of macros, so user won't have link error when compiling ISE project.

Why? You would still have to make sure that the C code of these functions are compiled into the resulting executable. They are also macros in the ISE Eiffel implementation.

Oh, then why we have link error here? For macros, it will be expanded on the spot, at most compile error, but not link error.

Basically what I mean is the GOBO external C impl structure better to match ISE external C impl structure, so no link surprise.

mw66 avatar Mar 04 '24 23:03 mw66

Basically what I mean is the GOBO external C impl structure better to match ISE external C impl structure, so no link surprise.

Yes, so they are macros in ISE. You get links error because I did not include these macros in the right header files. But this can be fixed easily. The eif_*.h in Gobo are just here to make ISE's code compile with gec. But I will certainly not replicate ISE's runtime in Gobo.

ebezault avatar Mar 04 '24 23:03 ebezault

But I will certainly not replicate ISE's runtime in Gobo.

Yes, that I know. They are just stubs in GOBO.

mw66 avatar Mar 04 '24 23:03 mw66

In other worlds, the eif_*.h files are a bridge between the Gobo Eiffel runtime and what is expected to compile ISE's libraries.

ebezault avatar Mar 04 '24 23:03 ebezault

I provide them as needed. Sometimes they don't end up in the right eif_*.h file my assumption was wrong (they were added here because it allowed one ISE library to compile, but they need to be moved somewhere else to compile another ISE library). That's what happened with eif_wean and others.

ebezault avatar Mar 04 '24 23:03 ebezault

I figured out what is the equivalent of eif_id_object in Gobo. So I will be able to provide a fix.

ebezault avatar Mar 04 '24 23:03 ebezault

FYI, found 27 diamonds in ISE Vision Smart Docking library

library/docking/package.iron

/Eiffel_23.09$ grep "diamond:" diamond.txt  | sort  | uniq 
diamond:  EV_ANY.implementation  =>  SD_DOCKING_ZONE_UPPER
diamond:  EV_ANY.implementation  =>  SD_PLACE_HOLDER_ZONE
diamond:  EV_ANY.implementation  =>  SD_TAB_ZONE_UPPER
diamond:  EV_COLORIZABLE.implementation  =>  SD_DOCKING_ZONE_UPPER
diamond:  EV_COLORIZABLE.implementation  =>  SD_PLACE_HOLDER_ZONE
diamond:  EV_COLORIZABLE.implementation  =>  SD_TAB_ZONE_UPPER
diamond:  EV_DOCKABLE_SOURCE.implementation  =>  SD_DOCKING_ZONE_UPPER
diamond:  EV_DOCKABLE_SOURCE.implementation  =>  SD_PLACE_HOLDER_ZONE
diamond:  EV_DOCKABLE_SOURCE.implementation  =>  SD_TAB_ZONE_UPPER
diamond:  EV_HELP_CONTEXTABLE.implementation  =>  SD_DOCKING_ZONE_UPPER
diamond:  EV_HELP_CONTEXTABLE.implementation  =>  SD_PLACE_HOLDER_ZONE
diamond:  EV_HELP_CONTEXTABLE.implementation  =>  SD_TAB_ZONE_UPPER
diamond:  EV_PICK_AND_DROPABLE.implementation  =>  SD_DOCKING_ZONE_UPPER
diamond:  EV_PICK_AND_DROPABLE.implementation  =>  SD_PLACE_HOLDER_ZONE
diamond:  EV_PICK_AND_DROPABLE.implementation  =>  SD_TAB_ZONE_UPPER
diamond:  EV_PIXMAPABLE.implementation  =>  SD_DOCKING_ZONE_UPPER
diamond:  EV_PIXMAPABLE.implementation  =>  SD_PLACE_HOLDER_ZONE
diamond:  EV_PIXMAPABLE.implementation  =>  SD_TAB_ZONE_UPPER
diamond:  EV_POSITIONED.implementation  =>  SD_DOCKING_ZONE_UPPER
diamond:  EV_POSITIONED.implementation  =>  SD_PLACE_HOLDER_ZONE
diamond:  EV_POSITIONED.implementation  =>  SD_TAB_ZONE_UPPER
diamond:  EV_SENSITIVE.implementation  =>  SD_DOCKING_ZONE_UPPER
diamond:  EV_SENSITIVE.implementation  =>  SD_PLACE_HOLDER_ZONE
diamond:  EV_SENSITIVE.implementation  =>  SD_TAB_ZONE_UPPER
diamond:  EV_WIDGET.implementation  =>  SD_DOCKING_ZONE_UPPER
diamond:  EV_WIDGET.implementation  =>  SD_PLACE_HOLDER_ZONE
diamond:  EV_WIDGET.implementation  =>  SD_TAB_ZONE_UPPER

$ grep "diamond:" diamond.txt  | sort  | uniq | wc
     27     108    1758

If we can make gec compile /Eiffel_23.09/examples/docking/simple, then we can test its behavior under gec.

mw66 avatar Mar 05 '24 23:03 mw66