Home AMX User Forum NetLinx Studio

Call netlinx compiler from command line?

Hi there,

Does anybody know if it is possible to call the netlinx compiler and source upload tool from a dos shell rather than using the netlinx IDE?

thanks
david

Comments

  • DHawthorneDHawthorne Posts: 4,584
    Edit: in case anyone read my original post, it was completely wrong :)

    The NetLinx compiler is found in Program Files/Common Files/AMXShare/COM. It's named nIrc.exe. You can run that from a command line and supply the source parameters. Running it without parameters will supply the syntax.

    If you poke around in that folder, you may find the upload module, but it doesn't seem to be any of the executables, you will have to mess around with the DLL's or OCX's.
  • dnahmandnahman Posts: 28
    Hi Dave,

    I just found that. It looks like a good start. I'm trying to figure out the proper command line or environment variables to make it work. Running the compiler with only my source file on the command line gives the response:

    L:\src\amx\LDACtheatres>"c:\program files\common files\amxshare\com\nlrc" "Theatres.axs"
    ---- Starting NetLinx Compile - Version[2.2.0.112] [06-20-2006 08:47:47] ----
    WARNING: Theatres.axs(0)The pre-processor is unable to find the directory in the Library path. Ignoring directory and continuing...
    ERROR: Theatres.axs(0)NetLinx Pre-Processor Error: Syntax error

    I'll keep on poking. . .
    thanks
    david
  • DHawthorneDHawthorne Posts: 4,584
    At a minimum, you will need the standard include folders; NetLinx programs, for example, have an implicit #INCLUDE 'netlinx.axi', whether you actually put it in your code or not. Go into Studio, and in the Settings | Preferences area, look under the NetLinx compiler tab. You will see an pulldown that lets you select the library, module, and include paths. Add those to your command line with the syntax you get typing in the command line utility without parameters.
  • dnahmandnahman Posts: 28
    Hi Dave,

    The only syntax hints the command line program gives me is for the source code axs file, and the output filename for the compilation log. Doing a string search of nlrc.exe I don't see any command line options mentioned other than source and output log. . . I also don't see anything that looks like an environment variable name. I wonder how amx passes this info from the IDE. . .

    thanks
    david
  • DHawthorneDHawthorne Posts: 4,584
    When I run it, I get this:
    C:\Program Files\Common Files\AMXShare\COM>nlrc
    
    ---- NetLinx Compiler Command Line Program Options ----
    
    RunNetLinxCompiler.exe "AXS_FileName.axs" "-IInclude Path"  "-LLibrary Path" "-MModule Path"  "-xOutput Log File"
    
    AXS_FileName.axs - File name to compile. Must be in double quotes
    Include Path (optional) - Additional path(s) to includes for this project, separate by ;
    Library Path (optional) - Additional path(s) to libraries for this project, separate by ;
    Module Path (optional) - Additional path(s) to modules for this project, separate by ;
    Output Log File  - Optional. If NOT present, then all output goes to the
                       command window. If present, the file name must be in
                       double quotes and contain one of the
                       following indicators:
    
                        "-AC:\Output.txt" - Append status to the output file.
                        "-NC:\Output.txt" - Create a new output file.
    

    You need the -I and -L parameters.
  • a_riot42a_riot42 Posts: 1,624
    Sounds like a batch file might be in order. If you use a 3rd party editor do you get that dialog that pops saying that the file has been modified outside of NS2?
    Paul
  • jcereckejcerecke Posts: 40
    Does anyone know of any cloud based services that you could "upload" the command line netlinx compiler to, so that you could code netlinx in the cloud? Or perhaps a cloud based service that you could install on your own server to allow a bit more flexibility when it comes to compiling.

    Is anyone actually using anything other than NS?
  • jweatherjweather Posts: 320
    jcerecke wrote: »
    Is anyone actually using anything other than NS?

    No. What's the point? I can see using a different editor, but why muck around with the toolchain?
Sign In or Register to comment.