[NXC] Project Structure

Discussion specific to NXT-G, NXC, NBC, RobotC, Lejos, and more.
Post Reply
muntoo
Posts: 834
Joined: 01 Oct 2010, 02:54
Location: Your Worst Nightmare
Contact:

[NXC] Project Structure

Post by muntoo »

I'm having trouble figuring out exactly how to use "header files"/etc with NXC.

Most tutorials mention assume that the ".cpp" (or ".nxc") files are automatically #include by the compiler in your project settings. (Most likely not a technically accurate statement. Whatever. :)) Thing is, ".nxc" doesn't have project files. (Or make files, whatever they're called.)

Where do I #include all the ".cpp"/".nxc" files? Do I #include some of the header files and all source files? Currently, I put them at the end of the header files ("get_seed.h.nxc" #includes "get_seed.nxc" at the bottom).

-----

This is for my NXC RNG project. Look at the source/"header" files to see what I'm having trouble with...

P.S. Yet another ArrayInit() bug in NXC at line 39 of MersenneTwisterDemo.nxc.
Image

Commit to LEGO Mindstorms Robotics Stack Exchange:
bit.ly/MindstormsSE


Commit to LEGO Stack Exchange: bit.ly/Area51LEGOcommit
spillerrec
Posts: 358
Joined: 01 Oct 2010, 06:37
Location: Denmark
Contact:

Re: [NXC] Project Structure

Post by spillerrec »

The NXC compiler only supports compiling a single file and every file therefore needs to be included into the one you want to compile from. Header file therefore don't have much purpose in NXC context as you would have to include the whole source file anyway.
I don't think NXC will ever support compiling files separately and then link them together.
My blog: http://spillerrec.dk/category/lego/
RICcreator, an alternative to nxtRICeditV2: http://riccreator.sourceforge.net/
timpattinson
Posts: 224
Joined: 30 Oct 2010, 04:10
Location: 127.0.0.1
Contact:

Re: [NXC] Project Structure

Post by timpattinson »

muntoo wrote: Most tutorials mention assume that the ".cpp" (or ".nxc") files are automatically #include by the compiler in your project settings. (Most likely not a technically accurate statement. Whatever. :)) Thing is, ".nxc" doesn't have project files. (Or make files, whatever they're called.)
Well, most compilers compile them independently and the link them afterwards, into one big file
But i know what you mean
PS. If this is wrong (for c /c++) tell me
Commit to Lego Mindstorms StackExchange Q&A http://area51.stackexchange.com/proposals/4105
Minboards IRC Channel #mindboards on Freenode
My blog: http://timpattinson.wordpress.com/
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests