Cotino

Clean install not working [Solved magically]

11 posts in this topic

#1 ·  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

Share this post


Link to post
Share on other sites



#2 ·  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

 

Share this post


Link to post
Share on other sites

#3 ·  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

Share this post


Link to post
Share on other sites

#4 ·  Posted

Have you checked $FO_OVERWRITE is declared in FileConstants.au3

Share this post


Link to post
Share on other sites

#5 ·  Posted

Yes, it's declared.

I believe the problem isn't AutoIt, but whatever it is dependent on.

Share this post


Link to post
Share on other sites

#6 ·  Posted

Do you have multiple copies of  file.au3 or  FileConstants.au3 ?
Did you install AutoIt3 with the standard installer?

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

Only one copy of the files.

I installed autoit as well as scite4autoit through the official website,
here : https://www.autoitscript.com/cgi-bin/getfile.pl?autoit3/autoit-v3-setup.exe
and here : https://www.autoitscript.com/cgi-bin/getfile.pl?../autoit3/scite/download/SciTE4AutoIt3.exe
respectively.

In case that's relevant, i'm on Windows 10 latest update.

Edited by Cotino

Share this post


Link to post
Share on other sites

#9 ·  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

Share this post


Link to post
Share on other sites

#11 ·  Posted

What do you mean by that ?

Nothing special that i know of.

Share this post


Link to post
Share on other sites

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