trying to compile c example before building my own display on RPI 4

14 views
Skip to first unread message

dvfa...@gmail.com

unread,
Dec 26, 2019, 9:48:26 PM12/26/19
to GLG Toolkit Community Edition


I found your software after RPI dropped OpenVG when the updated the OS for RPI 4  

I have been trying to get some examples to compile individually - without any luck.  I used the makefile2 (renamed and placed in the dirtory with the c-cpp examples, modified the target name and tried to compile - had numerous errors.  I tried the gcc line in the previous thread on this same topic without any luck.

Most of my programming is on Atmel AT32UC processors , in c, without an operating system to contend with.  so I am running close to blind on the RPI

In the source code of the examples I tried, I had to give the full path to GlgWrpper,h, or the complier could not find it.
here is the output from trying to compile GlgControlWidgetX.c 

suggestions would certainly be appreciated,
David

gcc -Wall -o "GlgControlWidgetX" "GlgControlWidgetX.c" (in directory: /home/pi/projects/TheGirlsDisplay)
GlgControlWidgetX.c: In function ‘main’:
GlgControlWidgetX.c:44:14: warning: unused variable ‘viewport’ [-Wunused-variable]
    GlgObject viewport;
              ^~~~~~~~
GlgControlWidgetX.c: In function ‘Input’:
GlgControlWidgetX.c:133:6: warning: unused variable ‘viewport’ [-Wunused-variable]
      viewport;
      ^~~~~~~~
/usr/bin/ld: /tmp/ccetRh3q.o: in function `main':
GlgControlWidgetX.c:(.text+0x14): undefined reference to `XtToolkitInitialize'
/usr/bin/ld: GlgControlWidgetX.c:(.text+0x18): undefined reference to `XtCreateApplicationContext'
/usr/bin/ld: GlgControlWidgetX.c:(.text+0x5c): undefined reference to `XtOpenDisplay'
/usr/bin/ld: GlgControlWidgetX.c:(.text+0x270): undefined reference to `XtAppCreateShell'
/usr/bin/ld: GlgControlWidgetX.c:(.text+0x2dc): undefined reference to `XtCreateWidget'
/usr/bin/ld: GlgControlWidgetX.c:(.text+0x2f4): undefined reference to `XtAddCallback'
/usr/bin/ld: GlgControlWidgetX.c:(.text+0x308): undefined reference to `XtAddCallback'
/usr/bin/ld: GlgControlWidgetX.c:(.text+0x310): undefined reference to `XtManageChild'
/usr/bin/ld: GlgControlWidgetX.c:(.text+0x318): undefined reference to `XtRealizeWidget'
/usr/bin/ld: GlgControlWidgetX.c:(.text+0x328): undefined reference to `XtAppMainLoop'
/usr/bin/ld: GlgControlWidgetX.c:(.text+0x348): undefined reference to `XtShellStrings'
/usr/bin/ld: GlgControlWidgetX.c:(.text+0x34c): undefined reference to `XtShellStrings'
/usr/bin/ld: GlgControlWidgetX.c:(.text+0x350): undefined reference to `XtStrings'
/usr/bin/ld: GlgControlWidgetX.c:(.text+0x354): undefined reference to `XtStrings'
/usr/bin/ld: GlgControlWidgetX.c:(.text+0x358): undefined reference to `XtShellStrings'
/usr/bin/ld: GlgControlWidgetX.c:(.text+0x35c): undefined reference to `XtShellStrings'
/usr/bin/ld: GlgControlWidgetX.c:(.text+0x360): undefined reference to `XtShellStrings'
/usr/bin/ld: GlgControlWidgetX.c:(.text+0x364): undefined reference to `XtShellStrings'
/usr/bin/ld: GlgControlWidgetX.c:(.text+0x368): undefined reference to `applicationShellWidgetClass'
/usr/bin/ld: GlgControlWidgetX.c:(.text+0x374): undefined reference to `glgWrapperWidgetClass'
/usr/bin/ld: /tmp/ccetRh3q.o: in function `VInit':
GlgControlWidgetX.c:(.text+0x3a8): undefined reference to `XglgGetWidgetViewport'
/usr/bin/ld: GlgControlWidgetX.c:(.text+0x3c4): undefined reference to `GlgSetDResource'
/usr/bin/ld: GlgControlWidgetX.c:(.text+0x3dc): undefined reference to `GlgSetDResource'
/usr/bin/ld: GlgControlWidgetX.c:(.text+0x3f4): undefined reference to `GlgSetDResource'
/usr/bin/ld: /tmp/ccetRh3q.o: in function `Input':
GlgControlWidgetX.c:(.text+0x44c): undefined reference to `GlgGetSResource'
/usr/bin/ld: GlgControlWidgetX.c:(.text+0x460): undefined reference to `GlgGetSResource'
/usr/bin/ld: GlgControlWidgetX.c:(.text+0x474): undefined reference to `GlgGetSResource'
/usr/bin/ld: GlgControlWidgetX.c:(.text+0x4e4): undefined reference to `GlgGetDResource'
collect2: error: ld returned 1 exit status
Compilation failed.

glg_support

unread,
Dec 27, 2019, 12:22:35 PM12/27/19
to glg...@googlegroups.com

makefile2 should be modified as needed to use the correct path to the include files and libraries for
X, Motif and GLG. By default, it uses /usr/include and /usr/lib for X and Motif, and
/usr/local/glg is used as the GLG installation directory.

Recommendation:

Modify makefile2 as needed so that:
     MOTIF_INC, X_INC and X_LIB point to the correct location of the include files and libraries.
            By default, it uses /usr/include and /usr/lib.
    
     GLG_DIR points to the correct GLG installation directory.
           By default, it uses /usr/local/glg
   
     TARGET = GlgControlWidgetX

Build the GlgControlWidgetX.c example using the command:

     make -f makefile2

In addition, you may want to use GlgControlWidgetG.c example instead of GlgControlWidgetX.c.
GlgControlWidgetG.c example uses a cross-platform GLG Generic API that eliminates the need for using
native X calls.
  
Reply all
Reply to author
Forward
0 new messages