Jump to content

Recommended Posts

Posted (edited)

Hi,

I often switch between 2 PC to code.

I recently installed VC redist 2015 on one PC, and autoit now won't work at all.

It might not be related, but it happened at the same time.

Everytime i try to compile my code, i get this :

 

"C:\Program Files (x86)\AutoIt3\Include\File.au3" (57) : ==> Variable used without being declared.:
Local $hFileOpen = FileOpen($sFilePath, BitOR($FO_OVERWRITE, $FO_CREATEPATH))
Local $hFileOpen = FileOpen($sFilePath, BitOR(^ ERROR

 

So i completely uninstalled Autoit, reinstalled it clean, same error.

It works fine with the other PC that doesn't have VC redist 2015.

I did try to uninstall redist, still doesn't work.

Any idea how to solve this ?

Edited by Cotino
Posted

Have you added to the top of your script: 

#include <FileConstants.au3>

Or in File.au3 does it have the following at the top of the script:

#include "FileConstants.au3"

The FileConstants.au3 should declare the variable $FO_OVERWRITE

 
Posted (edited)

Yes, "C:\Program Files (x86)\AutoIt3\Include\File.au3"  does have #include "FileConstants.au3"

Edit : Also, FileConstants.au3 declares Global Const $FO_OVERWRITE = 2

Edited by Cotino
Posted (edited)

Extremely weird, but ... Now it compiles.

Haven't touched the PC, not even once, since i copied the error.

I didn't have anything unusual running in the background, chrome and skype basically.

I tried to compile several times over the course of an hour, so that wasn't a one time thing.

 

I guess this is solved ? I'm still curious on how and why it happened.

Edited by Cotino

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...