Home AMX User Forum NetLinx Studio

Why Can't Compiler Find Include File?

Greetings,

I don't work with includes much. I have:
INCLUDE 'My Include File 2.00'
in the mainline of the program. "My Include File 2.00.axi" exists in the same directory as the mainline. I get a pre-processor error stating that the include file could not be found.

Any suggestions?

Thanks.

Comments

  • viningvining Posts: 4,368
    Check your file name of the include at the top of the include and in the workspace. At 1st I thought it wouldn't like the .0 but so when I created the new include it omitted the .0 so I had Include 2 not Include 2.0. I changed the properties and the program name at the top of the include to actuall include the .0 and it worked.
  • TurnipTruckTurnipTruck Posts: 1,485
    Thanks Vining. I tried that already. The name at the top of the include file match the actual file name as well as what is referenced in the mainline file. I took off the 2.0 also.
  • Joe HebertJoe Hebert Posts: 2,159
    INCLUDE 'My Include File 2.00'
    
    in the mainline of the program. "My Include File 2.00.axi" exists in the same directory as the mainline. I get a pre-processor error stating that the include file could not be found.

    Any suggestions?
    I’m getting the same result as you.
    I think the dot in 2.00 is throwing the compiler off and I’m guessing it’s looking for a .00 file instead of .axi

    If I change the INCLUDE line

    From:
    My Include File 2.00

    TO:
    My Include File 2.00.axi

    Then it finds the include.
  • ericmedleyericmedley Posts: 4,177
    Maybe this is related or not.

    I was working on a project today when for no apparent reason, my module quite working.

    I beat and banged on the thing for the rest of the afternoon with no luck. It was as if the compiler had lost its ability to see (or care) about the module. I could even delete the file from the directory tree without it erroring out. However, the variables in the module were there to be seen in the debugger. I could even change their values. The data_event in the module wouldn't fire (online event)

    If I changed the file name or module instance it would get mad but would compile if I put it all back even with the file removed from the project. I tried deleting all the .tko s and whatnot to try and force it to recreate them which it did.

    I gave up on it figuring on hitting it again tomorrow with a fresh set of eyes.
  • Joe HebertJoe Hebert Posts: 2,159
    ericmedley wrote:
    I could even delete the file from the directory tree without it erroring out.
    ...
    would compile if I put it all back even with the file removed from the project.
    Just for the record the compiler compiles just fine even without any includes or modules in the workspace project folders. The smart money is on those who do put all the supporting files in the workspace but it’s not mandatory. The compiler simply follows the directions it finds in code (DEFINE_MODULE, #include, etc.) and looks in the appropriate paths for the files. The workspace is for our sanity to organize the files; the compiler could care less what we put in there.

    One note though, if you do a Build instead of a straight Compile then the compiler will compile any .axs file it finds in the workspace module folder (even if it’s not called for in code) and then will compile the system.

    If you only include the .tko files for any module in the workspace then a Build and Compile will yield the same results.

    My personal preference is to only include the .tko files in the workspace module folder. If I’m writing a module I’ll compile it standalone and then leave it alone. This keeps the integrity of the date stamp of the modules intact in case I hit the build button instead of the compile button. There’s no reason to compile every module every time when compiling the system.
  • ericmedleyericmedley Posts: 4,177
    Okay,
    for the record, here's what fixed it??????

    There were two define_module-s. The non-working one was below the first.

    i put the non-working one above the working one, making it first in the list, compiled, uploaded and it all works now. So, I put the formerly non-working one right back where it was , compiled, uploaded and it all works now.

    Very strange...
    Joe Hebert wrote: »
    Just for the record the compiler compiles just fine even without any includes or modules in the workspace project folders. The smart money is on those who do put all the supporting files in the workspace but it?s not mandatory. The compiler simply follows the directions it finds in code (DEFINE_MODULE, #include, etc.) and looks in the appropriate paths for the files. The workspace is for our sanity to organize the files; the compiler could care less what we put in there.

    One note though, if you do a Build instead of a straight Compile then the compiler will compile any .axs file it finds in the workspace module folder (even if it?s not called for in code) and then will compile the system.

    If you only include the .tko files for any module in the workspace then a Build and Compile will yield the same results.

    My personal preference is to only include the .tko files in the workspace module folder. If I?m writing a module I?ll compile it standalone and then leave it alone. This keeps the integrity of the date stamp of the modules intact in case I hit the build button instead of the compile button. There?s no reason to compile every module every time when compiling the system.
Sign In or Register to comment.