After having time to look closer, it turns out that the Makefile.linux has been
faulty! Here a
version that works (a little bit simplified and removed a superfluous
definition, the link switches
now trail the file to be created):
OOREXX_LFLAGS = -L. -ldl -lrexx -lrexxapi
OOREXX_CFLAGS = -fPIC
# What we want to build.
all: runRexxProgram stackOverflow
runRexxProgram.o: runRexxProgram.cpp
gcc -c $(OOREXX_CFLAGS) -o runRexxProgram.o runRexxProgram.cpp
runRexxProgram: runRexxProgram.o
gcc runRexxProgram.o -o runRexxProgram $(OOREXX_LFLAGS)
stackOverflow.o: stackOverflow.cpp
gcc -c $(OOREXX_CFLAGS) -o stackOverflow.o stackOverflow.cpp
stackOverflow: stackOverflow.o
gcc stackOverflow.o -o stackOverflow $(OOREXX_LFLAGS)
clean:
rm -f *.so *.o stackOverflow runRexxProgram
Will commit the changes to this Makefile tomorrow.
---rony
On 14.10.2021 15:31, Rony G. Flatscher wrote:
>
> While testing the Makefile.linux for native.api on Ubuntu I encounter the
> following problem
> (oorexx got installed to /usr/local):
>
>
> rony@rony-linux:~/work/oorexx-build/orx1/usr/local/share/ooRexx/samples/native.api$
> make -f Makefile.linux clean
> rm -f *.so *.o stackOverflow runRexxProgram
>
>
> rony@rony-linux:~/work/oorexx-build/orx1/usr/local/share/ooRexx/samples/native.api$
> make -f Makefile.linux runRexxProgram
> gcc -c -fPIC -o runRexxProgram.o runRexxProgram.cpp
> gcc -L. -ldl -lrexx -lrexxapi runRexxProgram.o -o runRexxProgram
> /usr/bin/ld: runRexxProgram.o: in function `main':
> runRexxProgram.cpp:(.text+0x9a): undefined reference to
> `RexxCreateInterpreter'
> collect2: error: ld returned 1 exit status
> make: *** [Makefile.linux:54: runRexxProgram] Error 1
>
>
> rony@rony-linux:~/work/oorexx-build/orx1/usr/local/share/ooRexx/samples/native.api$
> nm runRexxProgram.o
> U exit
> U _GLOBAL_OFFSET_TABLE_
> 0000000000000000 T main
> U printf
> U puts
> U RexxCreateInterpreter
> U __stack_chk_fail
> U strcmp
> 0000000000000000 W _Z16conditionSubCodeP13RexxCondition
> 00000000000003c9 T _Z17checkForConditionP18RexxThreadContext_b
> 0000000000000243 T
> _Z20standardConditionMsgP18RexxThreadContext_P20_RexxDirectoryObjectP13RexxCondition
> 00000000000001c7 T _Z23printInterpreterVersionP13RexxInstance_
> 0000000000000000 W _ZN13RexxInstance_13LanguageLevelEv
> 0000000000000000 W _ZN13RexxInstance_18InterpreterVersionEv
> 0000000000000000 W _ZN13RexxInstance_9TerminateEv
> 0000000000000000 W _ZN18RexxThreadContext_10ArrayItemsEP16_RexxArrayObject
> 0000000000000000 W _ZN18RexxThreadContext_10ArrayOfOneEP14_RexxObjectPtr
> 0000000000000000 W
> _ZN18RexxThreadContext_11CallProgramEPKcP16_RexxArrayObject
> 0000000000000000 W
> _ZN18RexxThreadContext_12SendMessage0EP14_RexxObjectPtrPKc
> 0000000000000000 W _ZN18RexxThreadContext_14CheckConditionEv
> 0000000000000000 W _ZN18RexxThreadContext_14ClearConditionEv
> 0000000000000000 W _ZN18RexxThreadContext_16GetConditionInfoEv
> 0000000000000000 W
> _ZN18RexxThreadContext_19DecodeConditionInfoEP20_RexxDirectoryObjectP13RexxCondition
> 0000000000000000 W
> _ZN18RexxThreadContext_19ObjectToStringValueEP14_RexxObjectPtr
> 0000000000000000 W _ZN18RexxThreadContext_6StringEPKc
> 0000000000000000 W _ZN18RexxThreadContext_7ArrayAtEP16_RexxArrayObjectm
> 0000000000000000 W _ZN18RexxThreadContext_7CStringEP14_RexxObjectPtr
>
> The version that CMake creates works.
>
> ---rony
>
_______________________________________________
Oorexx-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/oorexx-devel