Project

Profile

Help

Bug #5868

closed

C samples don't build with Ubuntu

Added by Martin Honnen about 1 year ago. Updated about 1 year ago.

Status:
Closed
Priority:
Normal
Category:
Samples
Start date:
2023-02-03
Due date:
% Done:

100%

Estimated time:
Found in version:
12.0
Fixed in version:
12.1
Platforms:

Description

To complete testing my installation of SaxonC 12.0 HE under Ubuntu 22.04 I tried to compile the samples/cTests, using ./build64-linux.sh but I only get errors:

../../Saxon.C.API/SaxonCProcessor.c: In function ‘getProductVariantAndVersion’:
../../Saxon.C.API/SaxonCProcessor.c:36:48: warning: passing argument 2 of ‘getProductVersion’ makes pointer from integer without a cast [-Wint-conversion]
   36 |     return getProductVersion(environi->thread, proc);
      |                                                ^~~~
      |                                                |
      |                                                int64_t {aka long int}
In file included from ../../Saxon.C.API/SaxonCGlue.h:14,
                 from ../../Saxon.C.API/SaxonCProcessor.h:13,
                 from ../../Saxon.C.API/SaxonCProcessor.c:1:
../../Saxon.C.API/graalvm/libsaxon-hec-12.0.h:61:49: note: expected ‘void *’ but argument is of type ‘int64_t’ {aka ‘long int’}
   61 | char* getProductVersion(graal_isolatethread_t*, void *);
      |                                                 ^~~~~~
../../Saxon.C.API/SaxonCProcessor.c: In function ‘xsltApplyStylesheet1’:
../../Saxon.C.API/SaxonCProcessor.c:124:12: warning: implicit declaration of function ‘xsltApplyStylesheet’; did you mean ‘xsltApplyStylesheet1’? [-Wimplicit-function-declaration]
  124 |     return xsltApplyStylesheet(environi->thread, proc, cwd, source, stylesheet);
      |            ^~~~~~~~~~~~~~~~~~~
      |            xsltApplyStylesheet1
../../Saxon.C.API/SaxonCProcessor.c:124:12: warning: returning ‘int’ from a function with return type ‘const char *’ makes pointer from integer without a cast [-Wint-conversion]
  124 |     return xsltApplyStylesheet(environi->thread, proc, cwd, source, stylesheet);
      |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
testXSLT.c: In function ‘main’:
testXSLT.c:58:21: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
   58 |     char * verCh  = getProductVariantAndVersion(environi, procRef);
      |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/bin/ld: /tmp/ccxfuZR0.o: in function `xsltApplyStylesheet1':
SaxonCProcessor.c:(.text+0x1c7): undefined reference to `xsltApplyStylesheet'
collect2: error: ld returned 1 exit status
../../Saxon.C.API/SaxonCProcessor.c: In function ‘getProductVariantAndVersion’:
../../Saxon.C.API/SaxonCProcessor.c:36:48: warning: passing argument 2 of ‘getProductVersion’ makes pointer from integer without a cast [-Wint-conversion]
   36 |     return getProductVersion(environi->thread, proc);
      |                                                ^~~~
      |                                                |
      |                                                int64_t {aka long int}
In file included from ../../Saxon.C.API/SaxonCGlue.h:14,
                 from ../../Saxon.C.API/SaxonCProcessor.h:13,
                 from ../../Saxon.C.API/SaxonCProcessor.c:1:
../../Saxon.C.API/graalvm/libsaxon-hec-12.0.h:61:49: note: expected ‘void *’ but argument is of type ‘int64_t’ {aka ‘long int’}
   61 | char* getProductVersion(graal_isolatethread_t*, void *);
      |                                                 ^~~~~~
../../Saxon.C.API/SaxonCProcessor.c: In function ‘xsltApplyStylesheet1’:
../../Saxon.C.API/SaxonCProcessor.c:124:12: warning: implicit declaration of function ‘xsltApplyStylesheet’; did you mean ‘xsltApplyStylesheet1’? [-Wimplicit-function-declaration]
  124 |     return xsltApplyStylesheet(environi->thread, proc, cwd, source, stylesheet);
      |            ^~~~~~~~~~~~~~~~~~~
      |            xsltApplyStylesheet1
../../Saxon.C.API/SaxonCProcessor.c:124:12: warning: returning ‘int’ from a function with return type ‘const char *’ makes pointer from integer without a cast [-Wint-conversion]
  124 |     return xsltApplyStylesheet(environi->thread, proc, cwd, source, stylesheet);
      |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
testXQuery.c: In function ‘main’:
testXQuery.c:6:5: error: unknown type name ‘HANDLE’
    6 |     HANDLE myDllHandle;
      |     ^~~~~~
testXQuery.c:9:5: error: unknown type name ‘jclass’
    9 |     jclass  myClassInDll;
      |     ^~~~~~
testXQuery.c:30:13: error: ‘sxnc_environment’ has no member named ‘myDllHandle’
   30 |     environi->myDllHandle = loadDefaultDll ();
      |             ^~
testXQuery.c:30:29: warning: implicit declaration of function ‘loadDefaultDll’ [-Wimplicit-function-declaration]
   30 |     environi->myDllHandle = loadDefaultDll ();
      |                             ^~~~~~~~~~~~~~
testXQuery.c:37:5: warning: implicit declaration of function ‘initJavaRT’ [-Wimplicit-function-declaration]
   37 |     initJavaRT (environi->myDllHandle, &(environi->jvm), &(environi->env));
      |     ^~~~~~~~~~
testXQuery.c:37:25: error: ‘sxnc_environment’ has no member named ‘myDllHandle’
   37 |     initJavaRT (environi->myDllHandle, &(environi->jvm), &(environi->env));
      |                         ^~
testXQuery.c:37:50: error: ‘sxnc_environment’ has no member named ‘jvm’
   37 |     initJavaRT (environi->myDllHandle, &(environi->jvm), &(environi->env));
      |                                                  ^~
testXQuery.c:37:68: error: ‘sxnc_environment’ has no member named ‘env’
   37 |     initJavaRT (environi->myDllHandle, &(environi->jvm), &(environi->env));
      |                                                                    ^~
testXQuery.c:38:25: error: too few arguments to function ‘version’
   38 |     const char *verCh = version(environi);
      |                         ^~~~~~~
In file included from testXQuery.c:1:
../../Saxon.C.API/SaxonCProcessor.h:36:14: note: declared here
   36 | const char * version(sxnc_environment *environi, int64_t proc);
      |              ^~~~~~~
testXQuery.c:53:5: warning: implicit declaration of function ‘finalizeJavaRT’ [-Wimplicit-function-declaratio
]
   53 |     finalizeJavaRT (environi->jvm);
      |     ^~~~~~~~~~~~~~
testXQuery.c:53:29: error: ‘sxnc_environment’ has no member named ‘jvm’
   53 |     finalizeJavaRT (environi->jvm);
      |                             ^~
../../Saxon.C.API/SaxonCProcessor.c: In function ‘getProductVariantAndVersion’:
../../Saxon.C.API/SaxonCProcessor.c:36:48: warning: passing argument 2 of ‘getProductVersion’ makes pointer from integer without a cast [-Wint-conversion]
   36 |     return getProductVersion(environi->thread, proc);
      |                                                ^~~~
      |                                                |
      |                                                int64_t {aka long int}
In file included from ../../Saxon.C.API/SaxonCGlue.h:14,
                 from ../../Saxon.C.API/SaxonCProcessor.h:13,
                 from ../../Saxon.C.API/SaxonCProcessor.c:1:
../../Saxon.C.API/graalvm/libsaxon-hec-12.0.h:61:49: note: expected ‘void *’ but argument is of type ‘int64_t’ {aka ‘long int’}
   61 | char* getProductVersion(graal_isolatethread_t*, void *);
      |                                                 ^~~~~~
../../Saxon.C.API/SaxonCProcessor.c: In function ‘xsltApplyStylesheet1’:
../../Saxon.C.API/SaxonCProcessor.c:124:12: warning: implicit declaration of function ‘xsltApplyStylesheet’; did you mean ‘xsltApplyStylesheet1’? [-Wimplicit-function-declaration]
  124 |     return xsltApplyStylesheet(environi->thread, proc, cwd, source, stylesheet);
      |            ^~~~~~~~~~~~~~~~~~~
      |            xsltApplyStylesheet1
../../Saxon.C.API/SaxonCProcessor.c:124:12: warning: returning ‘int’ from a function with return type ‘const char *’ makes pointer from integer without a cast [-Wint-conversion]
  124 |     return xsltApplyStylesheet(environi->thread, proc, cwd, source, stylesheet);
      |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
testXPath.c: In function ‘main’:
testXPath.c:6:5: error: unknown type name ‘HANDLE’
    6 |     HANDLE myDllHandle;
      |     ^~~~~~
testXPath.c:9:5: error: unknown type name ‘jclass’
    9 |     jclass  myClassInDll;
      |     ^~~~~~
testXPath.c:28:13: error: ‘sxnc_environment’ has no member named ‘myDllHandle’
   28 |     environi->myDllHandle = loadDefaultDll ();
      |             ^~
testXPath.c:28:29: warning: implicit declaration of function ‘loadDefaultDll’ [-Wimplicit-function-declaratio
]
   28 |     environi->myDllHandle = loadDefaultDll ();
      |                             ^~~~~~~~~~~~~~
testXPath.c:35:5: warning: implicit declaration of function ‘initJavaRT’ [-Wimplicit-function-declaration]
   35 |     initJavaRT (environi->myDllHandle, &(environi->jvm), &(environi->env));
      |     ^~~~~~~~~~
testXPath.c:35:25: error: ‘sxnc_environment’ has no member named ‘myDllHandle’
   35 |     initJavaRT (environi->myDllHandle, &(environi->jvm), &(environi->env));
      |                         ^~
testXPath.c:35:50: error: ‘sxnc_environment’ has no member named ‘jvm’
   35 |     initJavaRT (environi->myDllHandle, &(environi->jvm), &(environi->env));
      |                                                  ^~
testXPath.c:35:68: error: ‘sxnc_environment’ has no member named ‘env’
   35 |     initJavaRT (environi->myDllHandle, &(environi->jvm), &(environi->env));
      |                                                                    ^~
testXPath.c:36:25: error: too few arguments to function ‘version’
   36 |     const char *verCh = version(environi);
      |                         ^~~~~~~
In file included from ../../Saxon.C.API/SaxonCXPath.h:11,
                 from testXPath.c:1:
../../Saxon.C.API/SaxonCProcessor.h:36:14: note: declared here
   36 | const char * version(sxnc_environment *environi, int64_t proc);
      |              ^~~~~~~
testXPath.c:58:5: warning: implicit declaration of function ‘finalizeJavaRT’ [-Wimplicit-function-declaration]
   58 |     finalizeJavaRT (environi->jvm);
      |     ^~~~~~~~~~~~~~
testXPath.c:58:29: error: ‘sxnc_environment’ has no member named ‘jvm’
   58 |     finalizeJavaRT (environi->jvm);
      |                             ^~

The commands and the cpp samples build and work fine.


Related issues

Has duplicate SaxonC - Bug #5876: PHP-extension: Undefined symbol: xsltApplyStylesheetDuplicateO'Neil Delpratt2023-02-09

Actions
Actions #1

Updated by O'Neil Delpratt about 1 year ago

  • Status changed from New to In Progress

Investigating this issue.

Actions #2

Updated by O'Neil Delpratt about 1 year ago

I have been looking at the C API and observe that it is broken for XPath and XQuery in SaxonC 12.

There is still old code for JNI from SaxonC 11 which I have now removed. The C API still needs some work to make it user friendly.

Actions #3

Updated by O'Neil Delpratt about 1 year ago

  • Related to Bug #5876: PHP-extension: Undefined symbol: xsltApplyStylesheet added
Actions #4

Updated by O'Neil Delpratt about 1 year ago

  • Status changed from In Progress to Resolved
  • % Done changed from 0 to 100

I have fixed up the C API. The samples for XSLT 3.0, XQuery and XPath now work.

Actions #5

Updated by O'Neil Delpratt about 1 year ago

  • Has duplicate Bug #5876: PHP-extension: Undefined symbol: xsltApplyStylesheet added
Actions #6

Updated by O'Neil Delpratt about 1 year ago

  • Related to deleted (Bug #5876: PHP-extension: Undefined symbol: xsltApplyStylesheet)
Actions #7

Updated by O'Neil Delpratt about 1 year ago

  • Status changed from Resolved to Closed
  • Fixed in version set to 12.1

Bug fixed applied in the SaxonC 12.1 maintenance release.

Please register to edit this issue

Also available in: Atom PDF