I have compiled a number of Cpp files into object files and put them in the folder to link with my FB program.
Then Compiled with FBDos and linking object files with the following statement.
Code: Select all
FbcDos -R -w pedantic -s console EduCake.bas -a wdigital.o -a io.o -a wanalog.o -a common.o -a mcm.o -x Educake.exe
Havent tried if only one -a is needed.
Then in my FB code declared the following to test one of the many functions in the object files.
Code: Select all
Declare Sub PinMode Cdecl Alias "PinMode"(ByVal Pin As UInteger, ByVal Mode As UInteger)
Dim As UInteger Pin,Mode
And tried to call it as follows.
Code: Select all
Pin = 13:Mode = 1
PinMode (Pin,Mode)
I get a compile error
Code: Select all
EduCake.o:fake:(.text+0x689): undefined reference to `PinMode'
Build error(s)
The routine is defined in wdigital.cpp as
void pinMode(uint8_t pin, uint8_t mode)
I have no idea what I am doing wrong. Any suggestions welcome.