#12 Bluetooth programs won't compile (Linux)

compiler
closed
John Hansen
NXC (53)
5
2007-04-26
2007-04-25
brett stevens
No

When I try to compile the following master program from Danny Benedettelli's tutorial I get the compiler errors that I include at the end:

//MASTER
#include "NXCDefs.h"
#define BT_CONN 1
#define INBOX 1
#define OUTBOX 5

sub BTCheck(int conn){
if (!BluetoothStatus(conn)==NO_ERR){
TextOut(5,LCD_LINE2,"Error");
Wait(1000);
Stop(true);
}
}

task main(){
string in, out, iStr;
int i = 0;
BTCheck(BT_CONN); //check slave connection
while(true){
iStr = NumToStr(i);
out = StrCat("M",iStr);
TextOut(10,LCD_LINE1,"Master Test");
TextOut(0,LCD_LINE2,"IN:");
TextOut(0,LCD_LINE4,"OUT:");
ReceiveRemoteString(INBOX, true, in);
SendRemoteString(BT_CONN,OUTBOX,out);
TextOut(10,LCD_LINE3,in);
TextOut(10,LCD_LINE5,out);
Wait(100);
i++;
}
}

errors generated by command "nbc master_test.nxc -O=mt.rxe":

# Error: Undefined Identifier ReceiveRemoteString
File "/home/brett/Projects/Lego/Programs/mt.nxc" ; line 24
# ReceiveRemoteString(
#----------------------------------------------------------
# Error: Unknown data type
File "/home/brett/Projects/Lego/Programs/mt.nxc" ; line 24
# ReceiveRemoteString(
#----------------------------------------------------------
# Error: '=' expected
File "/home/brett/Projects/Lego/Programs/mt.nxc" ; line 24
# ReceiveRemoteString(1
#----------------------------------------------------------
# Error: Unknown data type
File "/home/brett/Projects/Lego/Programs/mt.nxc" ; line 24
# ReceiveRemoteString(1,
#----------------------------------------------------------
# Error: parser error
File "/home/brett/Projects/Lego/Programs/mt.nxc" ; line 24
# ReceiveRemoteString(1,
#----------------------------------------------------------
# Error: Undefined Identifier SendRemoteString
File "/home/brett/Projects/Lego/Programs/mt.nxc" ; line 25
# SendRemoteString(
#----------------------------------------------------------
# Error: Unknown data type
File "/home/brett/Projects/Lego/Programs/mt.nxc" ; line 25
# SendRemoteString(
#----------------------------------------------------------
# Error: '=' expected
File "/home/brett/Projects/Lego/Programs/mt.nxc" ; line 25
# SendRemoteString(1
#----------------------------------------------------------
# Error: Unknown data type
File "/home/brett/Projects/Lego/Programs/mt.nxc" ; line 25
# SendRemoteString(1,5
#----------------------------------------------------------
# Error: parser error
File "/home/brett/Projects/Lego/Programs/mt.nxc" ; line 25
# SendRemoteString(1,5
#----------------------------------------------------------

I am running nbc version 1.0.1.b27, on Mandriva x86 linux.

thanks
brett

Discussion

  • John Hansen
    John Hansen
    2007-04-25

    Logged In: YES
    user_id=661666
    Originator: NO

    You must have an old copy of the NXCDefs.h header file on your system which is being used instead of the one which is included in the b27 .tgz compressed tar file. The correct version of the NXCDefs.h file should look like this at the top of the file:

    // Workfile:: NXCDefs.h
    // Date:: 2007-02-11
    // Revision:: 22

    Near the end of the file it should have a line that looks like this:

    #define ReceiveRemoteString(queue, clear, str) asm { __receiveMessage(queue, clear, str, __RETVAL__) }

    John Hansen

     
  • brett stevens
    brett stevens
    2007-04-26

    Logged In: YES
    user_id=1717005
    Originator: YES

    Thanks John,

    I knew it must be something simple

    brett

     
  • brett stevens
    brett stevens
    2007-04-26

    • status: open --> closed