Page 1 of 1

[NXC] Project Structure

Posted: 20 Jun 2011, 00:23
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.

Re: [NXC] Project Structure

Posted: 20 Jun 2011, 07:45
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.

Re: [NXC] Project Structure

Posted: 20 Jun 2011, 07:53
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