Subject:
|
Re: Linked Lists in BrickOS
|
Newsgroups:
|
lugnet.robotics.rcx.legos
|
Date:
|
Wed, 8 Oct 2003 21:57:15 GMT
|
Viewed:
|
3244 times
|
| |
| |
In lugnet.robotics.rcx.legos, Michael Purvis wrote:
> Thanks to all that assisted me in getting set up. It turned out to be missing
> Cygwin packages. My bad.
>
> Two problems. Firstly, BrixCC needs to be restarted to compile 'new' code. Is
> there a way to correct this problem?
BricxCC can't know for sure what compiler to use unless it can tell what type of
file you are editing. It figures this out using the file extension. In order
to compile C++ and C code, BricxCC needs the file to have a .cpp or .c
extension. When you create a new file and you haven't saved it yet there is no
file extension so BricxCC makes an assumption about the type of code contained
in the file. It assumes NQC by default and will use the NQC compiler when the
file lacks an extension. Save your new file with a .cpp extension and BricxCC
should use the correct compiler without having to restart BricxCC or close and
re-open the file.
Also, if you make changes to your code you need to save before you compile (or
turn on the auto-save before compile option on the Preferences dialog) so that
the latest code is actually compiled (since BricxCC uses the disk file - not the
in-memory version - when it launches the make).
> The actual errors are really bizarre stuff like parser problems on 'class Node'
That would be because the NQC compiler doesn't know the token "class".
Compiling a file without an extension in BricxCC always uses NQC.
The code below compiles in BricxCC (if BricxCC knows to use the C++ compiler).
Hope this helps,
John Hansen
#include <conio.h>
#include <unistd.h>
#include <dsound.h>
class Node
{
public:
Node( void *_pData )
{
pData = _pData;
pNext = (Node *)NULL;
} // end constructor
Node *Next() { return( pNext ); }
void SetNext( Node *pNode ) { pNext = pNode; }
//void *Data() { return( pData ); }
private:
void *pData;
Node *pNext;
}; // end Node
class list
{
private:
Node *p_head;
};
int main(int argc, char **argv)
{
cputs("c4");
return 0;
}
|
|
Message has 1 Reply: | | Re: Linked Lists in BrickOS
|
| (...) Yeah, this was the problem. It hadn't occurred to me that BricxCC wasn't saving the file before making. Whoops. (...) Yes, tremendously (...) It looks like this was the problem line. I didn't know the syntax for a pointer to nothing. (in (...) (21 years ago, 9-Oct-03, to lugnet.robotics.rcx.legos)
|
Message is in Reply To:
| | Linked Lists in BrickOS
|
| Thanks to all that assisted me in getting set up. It turned out to be missing Cygwin packages. My bad. Two problems. Firstly, BrixCC needs to be restarted to compile 'new' code. Is there a way to correct this problem? Also, I'm having trouble (...) (21 years ago, 7-Oct-03, to lugnet.robotics.rcx.legos)
|
8 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
This Message and its Replies on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|