We are porting a GUI application from 32 to 64 bit which consists of ftn95 and C/Cpp code. When trying to compile some C/Cpp code we run into the error 'Can't complete RBP relative address'. Please look at the file string_array.cpp following.
#include <stdio.h>
char* text_gui[16][2];
void myproc(char* mystring) {
printf('myproc: mystring=%s\n',mystring);
return;
};
main () {
text_gui[0][0] = 'Hello!';
myproc(text_gui[0][0]);
return 0;
}
This code compiles for the 32 bit version of scc:
scc string_array.cpp /List
results in an object file of positive length for SCC/WIN32 Ver 4.07.
However, this does not work when trying to generate a 64 bit object file. As a result of calling
scc string_array.cpp /List /64
following lines are displayed
[Silverfrost SCC/WIN32 Ver 4.07 Copyright (c) Silverfrost Ltd 2018]
0015 }
*** Can't complete RBP relative address
*** Can't complete RBP relative address
2 ERRORS [<STRING_ARRAY> SCC/WIN32 Ver 4.07]
*** Compilation failed
Moreover the length of object file STRING_ARRAY.OBJ is zero.
If we move declaration
char* text_gui[16][2];
into the main block then the 64 bit compile works and produces an object file of positive length. We could, as well, generate a 64 bit exe file from the latter code which executes as expected.
Regards, Dietmar