Jump to content
Skysnake

.a3x error undefined function

Recommended Posts

Skysnake

Hi

I need help.

I have re-installed AutoIt, but the problem persists.

My script uses an #include <tourney_mymain.a3x> which Scite fails to read.  To be clear, as long as it is in .au3 format, it works.  The moment I build it as .a3x, it fails.

;#include <tourney_mymain.a3x>
#include <tourney_mymain.au3>

_MyMainFunc()

The file tourney_mymain.au3 exists in the same folder, and the header looks like this

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Outfile_type=a3x
#AutoIt3Wrapper_Outfile=C:\AutoIt\tourney\tourney_mymain.a3x
#AutoIt3Wrapper_Run_AU3Check=n
#AutoIt3Wrapper_Run_Tidy=y
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****

The error looks like this:

>"C:\Program Files (x86)\AutoIt3\SciTE\..\AutoIt3.exe" "C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.au3" /run /prod /ErrorStdOut /in "C:\AutoIt\tourney\tourney.au3" /UserParams    
+>16:13:57 Starting AutoIt3Wrapper v.16.306.1237.0 SciTE v.3.6.2.0   Keyboard:00000409  OS:WIN_10/  CPU:X64 OS:X64  Environment(Language:0409)  CodePage:0  utf8.auto.check:4    # detect ascii high characters and if none found set default encoding to UTF8 and do not add BOM
+>         SciTEDir => C:\Program Files (x86)\AutoIt3\SciTE   UserDir => C:\Users\user\AppData\Local\AutoIt v3\SciTE\AutoIt3Wrapper   SCITE_USERHOME => C:\Users\user\AppData\Local\AutoIt v3\SciTE 
>Running Tidy (16.306.1237.0)  from:C:\Program Files (x86)\AutoIt3\SciTE\tidy
+>16:13:57 Tidy ended.rc:0
>Running AU3Check (3.3.14.2)  from:C:\Program Files (x86)\AutoIt3  input:C:\AutoIt\tourney\tourney.au3
"C:\AutoIt\tourney\tourney.au3"(55,13) : error: _MyMainFunc(): undefined function.
_MyMainFunc()
~~~~~~~~~~~~^
C:\AutoIt\tourney\tourney.au3 - 1 error(s), 0 warning(s)
!>16:13:57 AU3Check ended. Press F4 to jump to next error.rc:2
+>16:13:57 AutoIt3Wrapper Finished.
>Exit code: 2    Time: 1.028

When I toggle back to the .au3 file and compile/run, it works.

>"C:\Program Files (x86)\AutoIt3\SciTE\..\AutoIt3.exe" "C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.au3" /run /prod /ErrorStdOut /in "C:\AutoIt\tourney\tourney.au3" /UserParams    
+>16:28:05 Starting AutoIt3Wrapper v.16.306.1237.0 SciTE v.3.6.2.0   Keyboard:00000409  OS:WIN_10/  CPU:X64 OS:X64  Environment(Language:0409)  CodePage:0  utf8.auto.check:4    # detect ascii high characters and if none found set default encoding to UTF8 and do not add BOM
+>         SciTEDir => C:\Program Files (x86)\AutoIt3\SciTE   UserDir => C:\Users\user\AppData\Local\AutoIt v3\SciTE\AutoIt3Wrapper   SCITE_USERHOME => C:\Users\user\AppData\Local\AutoIt v3\SciTE 
>Running Tidy (16.306.1237.0)  from:C:\Program Files (x86)\AutoIt3\SciTE\tidy
+>16:28:06 Tidy ended.rc:0
>Running AU3Check (3.3.14.2)  from:C:\Program Files (x86)\AutoIt3  input:C:\AutoIt\tourney\tourney.au3
+>16:28:06 AU3Check ended.rc:0
>Running:(3.3.14.2):C:\Program Files (x86)\AutoIt3\autoit3.exe "C:\AutoIt\tourney\tourney.au3"    
--> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop
I was here!
+>16:28:06 AutoIt3.exe ended.rc:0
+>16:28:06 AutoIt3Wrapper Finished.
>Exit code: 0    Time: 1.066

Building the .a3x file, returns this:

>"C:\Program Files (x86)\AutoIt3\SciTE\..\AutoIt3.exe" "C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.au3" /NoStatus /prod /in "C:\AutoIt\tourney\tourney_mymain.au3"
+>16:29:01 Starting AutoIt3Wrapper v.16.306.1237.0 SciTE v.3.6.2.0   Keyboard:00000409  OS:WIN_10/  CPU:X64 OS:X64  Environment(Language:0409)  CodePage:0  utf8.auto.check:4    # detect ascii high characters and if none found set default encoding to UTF8 and do not add BOM
+>         SciTEDir => C:\Program Files (x86)\AutoIt3\SciTE   UserDir => C:\Users\user\AppData\Local\AutoIt v3\SciTE\AutoIt3Wrapper   SCITE_USERHOME => C:\Users\user\AppData\Local\AutoIt v3\SciTE 
>Running Tidy (16.306.1237.0)  from:C:\Program Files (x86)\AutoIt3\SciTE\tidy
+>16:29:01 Tidy ended.rc:0
>Running:(3.3.14.2):C:\Program Files (x86)\AutoIt3\aut2exe\aut2exe.exe  /in "C:\AutoIt\tourney\tourney_mymain.au3" /out "C:\Users\user\AppData\Local\AutoIt v3\Aut2exe\~AUDA33.tmp.a3x" /nopack /comp 2
+>16:29:02 Aut2exe.exe ended.C:\Users\user\AppData\Local\AutoIt v3\Aut2exe\~AUDA33.tmp.a3x. rc:0
+>16:29:02 Created program:C:\AutoIt\tourney\tourney_mymain.a3x
+>16:29:02 AutoIt3Wrapper Finished.
>Exit code: 0    Time: 1.718

And the header of the  contents of the .a3x file looks like this:

£HK¾˜lJ©™LS
†ÖH}AU3!EA06M¨ÿs$§<öz�ñg¬Á“çkCÊR¦­  á»:)ãìç�˜.@½ášÞ€F±�k;!Ô±Öu:È=ÆÐ3÷�¯Ë�¢”���ˆþd•aç¶M�ø  ,p~©=�ã™Õˆ   ¬C�9˜�8öþ8_Yr©0h�d

It looks like this in pure AutoIt:

Func _MainFunc()

    ConsoleWrite("I was here!" & @CRLF)

    Local $sMainstatus = 'The database is empty'

    $Main = GUICreate("Roster", 640, 480)

    ; --- Top level menu
    Global $idHelpmenu = GUICtrlCreateMenu(" Help ")

I have a similar AutoIT installation running on Windows 7, no problem.  The machine giving problems is Win 10.

Any ideas would be appreciated.  This is a new pet project of mine and this is just the start, so I am willing to zip ALL of it and send it along if anyone wants to see inside.

Thanks.

Skysnake

Edited by Skysnake
typo

Skysnake

Why is the snake in the sky?

Share this post


Link to post
Share on other sites
BrewManNH

Your function is named _MainFunc, you're calling _MyMainFunc in the script.


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites
Skysnake

Nope that is not it.

 

The difference is simply coz of my testing.

I have just renamed it to _TheFunctionWhicha3xDoesnotFind() in the main, then pasted into my include .au3, where it works.

Build ,a3x and I get the error

>"C:\Program Files (x86)\AutoIt3\SciTE\..\AutoIt3.exe" "C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.au3" /run /prod /ErrorStdOut /in "C:\AutoIt\tourney\tourney.au3" /UserParams    
+>17:10:47 Starting AutoIt3Wrapper v.16.306.1237.0 SciTE v.3.6.2.0   Keyboard:00000409  OS:WIN_10/  CPU:X64 OS:X64  Environment(Language:0409)  CodePage:0  utf8.auto.check:4    # detect ascii high characters and if none found set default encoding to UTF8 and do not add BOM
+>         SciTEDir => C:\Program Files (x86)\AutoIt3\SciTE   UserDir => C:\Users\user\AppData\Local\AutoIt v3\SciTE\AutoIt3Wrapper   SCITE_USERHOME => C:\Users\user\AppData\Local\AutoIt v3\SciTE 
>Running Tidy (16.306.1237.0)  from:C:\Program Files (x86)\AutoIt3\SciTE\tidy
+>17:10:48 Tidy ended.rc:0
>Running AU3Check (3.3.14.2)  from:C:\Program Files (x86)\AutoIt3  input:C:\AutoIt\tourney\tourney.au3
"C:\AutoIt\tourney\tourney.au3"(67,33) : error: _TheFunctionWhicha3xDoesnotFind(): undefined function.
_TheFunctionWhicha3xDoesnotFind()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\AutoIt\tourney\tourney.au3 - 1 error(s), 0 warning(s)
!>17:10:48 AU3Check ended. Press F4 to jump to next error.rc:2
+>17:10:48 AutoIt3Wrapper Finished.
>Exit code: 2    Time: 1.043

 

Edited by Skysnake

Skysnake

Why is the snake in the sky?

Share this post


Link to post
Share on other sites
Skysnake

I changed the .a3x file's name to 

#AutoIt3Wrapper_Outfile=C:\AutoIt\tourney\tourney_mymain.lib

and now it works.

is it possible that access to the .a3x is restricted by my Anti virus?

Built as .a3x.  Trying to include it results in this error.  Changing the build name makes it work.  I changed the .lib back to .a3x and the error came back...

thnx for the interest. :)

 

Edited by Skysnake

Skysnake

Why is the snake in the sky?

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

  • Similar Content

    • evanevery
      By evanevery
      An AUTOIT app just stopped running on several machines in our office after applying the recent Win10 1803 update.
      Here are the details:
      1.  The App is now failing the UDPBIND call with a 10022 error.
      2.  The App runs fine on machines which have NOT YET applied the 1803 Win10 update just released
      3.  The App fails on all machines to which the 1803 has been applied - but only if the app is loaded from a network share!
      4.  If the app is run from a LOCAL drive, it continues to run fine even after the 1803 update
      In summary:
      Something has changed with the Win10 1803 update which now prevents AutoIT apps from opening UDP ports (UDPBIND) if the Apps are being loaded/run off a network share!
      I have confirmed this by manually updating a workstation to 1803 and confirming this is what is causing the failure.  (Worked fine immediately before - now fails immediately after)
      Also, I am not having issues running other Autoit network apps from network shares which DON'T use the UDPBIND call. (i.e. "DriveMapAdd" is still working under the same conditions)
      The share which we have been loading/running our apps from is running SMB v1.5 protocols (via Linux/Samba)
    • DLS
      By DLS
      I have a working script that changes the core affinity and process priority of multiples of a specific application I have running.  
      I have that part figured out.

      I would like to make a little modification to it.

      Windows10 introduced virtual desktops.  I am trying to have different core affinity and priority of processes on the visible and non-visible desktops.  
      What I need is a bool function that could be described as IsWindowOnCurrentDesktop($hWnd).  I have searched the winAPI.au3 but I do not believe anything like that exists built it.
      I have searched multiple places before asking for help. I found a Microsoft supplied example of the function I need using C#, but I am unfamiliar with C# to a degree that I cannot port the system call over.
      https://blogs.msdn.microsoft.com/winsdk/2015/09/10/virtual-desktop-switching-in-windows-10/
      Help is appreciated but not expected.  Thanks in advanced.   In the meantime I will be learning C# syntax and class structure.
    • iamtheky
      By iamtheky
      This thread will focus on the scripts that write/execute bash scripts, and return the data (whereas my other thread is more just a spit sink).  Currently you are relegated to piping to a file from the bash script, hopefully there are other options coming.
      This AutoIt script writes a bash script containing an fdupes command based off the Directory you want to search, and whether or not you want it to recurse.  It writes the script in Temp, runs it, writes the stdout to a file in Temp, then parses that file and returns you an array.
      * You need to sudo apt-get install fdupes for this to work, btw.  fdupes is stupid fast at what it does and being able to leverage linux features, not hunt down a windows equivalent, is great fun.
      #requireadmin #include <WinAPIFiles.au3> #include <Array.au3> _WinAPI_Wow64EnableWow64FsRedirection(FALSE) _ArrayDisplay(_fdupes("c:\Users\" & @UserName & "\Desktop" , 1)) Func _fdupes($DirToCheckForDupes , $Recurse = 0) $bashscript = "c:\Windows\Temp\PRODfdupes.txt" $bashoutput = "c:\Windows\Temp\PRODfdupes_STDOUT.txt" ;format Windows Dir name to linux Dir name - DUPESDIR $aDupesDir = stringsplit($DirToCheckForDupes , "\" , 2) $sDupesDir = "//mnt/" & stringleft($DirToCheckForDupes , 1) for $i = 1 to ubound($aDupesDir) - 1 $sDupesDir &= "/" & $aDupesDir[$i] Next ;format Windows Dir name to linux Dir name - ScriptDIR $aScriptDir = stringsplit($bashscript , "\" , 2) $sScriptDir = "//mnt/" & stringleft($bashscript , 1) for $i = 1 to ubound($aScriptDir) - 1 $sScriptDir &= "/" & $aScriptDir[$i] Next ;format Windows Dir name to linux Dir name - OUTDIR $aOutDir = stringsplit($bashoutput , "\" , 2) $sOutDir = "//mnt/" & stringleft($bashoutput , 1) for $i = 1 to ubound($aOutDir) - 1 $sOutDir &= "/" & $aOutDir[$i] Next FileDelete($bashscript) FileDelete($bashoutput) $ErrFileWrite = $Recurse = 0 ? FileWrite($bashscript , "fdupes " & $sDupesDir & " > " & $sOutDir) : FileWrite($bashscript , "fdupes -R " & $sDupesDir & " > " & $sOutDir) $iPID = runwait('cmd /c bash ' & $sScriptDir) $Finalarr = stringsplit(fileread($bashoutput) , chr("10") , 2) return $Finalarr EndFunc ;fdupes  
    • Skysnake
      By Skysnake
      Several questions around the forum get asked repeatedly:
      How to avoid false-positive Anti-Virus detection? Answered by AutoIt god himself How to make AutoIt software safe from hacking? How to prevent AutoIt software being de-compiled? How to prevent exposure of native AutoIt code? The general answers all go in the direction of (a) can't be done or (b) make it an .a3x script.
      The Wiki contains a single entry under "compiler directives" and the Help File  contains mainly compiler info, with this note
       
      Also see this thread.
       
      So I thought I would make a little demo to actually show how it works.
      Here are the 2 scripts.  The a3x_demo.zip file contains these 2, plus the compiled .a3x file and the .EXE
       
      The body
      #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Outfile_type=a3x #AutoIt3Wrapper_Outfile=a3x_demo.a3x #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #cs ---------------------------------------------------------------------------- AutoIt Version: 3.3.14.2 Author: Skysnake Script Function: Demonstates working of a3x Instructions Code as normal Set Compiler option to .a3x as per Help File Compile Note output is (a) .a3x file, (b) now compile wrapper to make .exe file The compiled .a3x is included inside the .exe. To demonstrate, copy .exe to any new location and run. :) #ce ---------------------------------------------------------------------------- ; Script Start #include <MsgBoxConstants.au3> MsgBox($MB_SYSTEMMODAL, "a3x demo", "This message box is called from an a3x pre-compiled script " & @CRLF & "will timeout after 10 seconds or select the OK button.", 10) ; code ends  
      The wrapper
      #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Outfile=a3x_wrapper.exe #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #cs ---------------------------------------------------------------------------- AutoIt Version: 3.3.14.2 Author: Skysnake Script Function: Wrapper for .a3x demo the INCLUDE line below forces the .a3x to be included in the new .EXE other option is to use FileIsntall and then run the a3x_demo.a3x as an external file NOTE: required in order are the following steps 1. body .au3 script 2. compile body .au3 as .a3x file, include in wrapper 3. wrapper .au3 script, to become the .exe -> compile as .EXE #ce ---------------------------------------------------------------------------- ; Script Start - #include "a3x_demo.a3x" ; code ends DOWNLOAD: The ax3_demo.zip file
       
      EDIT:
      2016.07.08 Fixed typos
    • broliukaz
      By broliukaz
      Hi,
      Before I created my script with Windows 7 pro 32bit computer with Office 2013 32bit, and it's working on all my computers with Win7, Win8, Win10 with office 32 and 64bit...
      Now I want to edit it on Windows 10 pro 64bit Computer with Office 2016 64bit and I get error: _ExcelReadCell() - undefined function. Can this computer or office version cause the problem? Excel.au3 is included.
      Here is the part of my script:
      Local $oExcel = _Excel_Open() Local $oWorkbook = _Excel_BookOpen($oExcel, $xlsRepairs&$sItem) $CVDevice = _ExcelReadCell($oExcel, 1, 2) ; Device name $CVeqrma = _ExcelReadCell($oExcel, 3, 3) ; EQRMA Number $CVlot = _ExcelReadCell($oExcel, 5, 3) ; Lot number $CVpn = _ExcelReadCell($oExcel, 8, 3) ; PN $CVsn = _ExcelReadCell($oExcel, 11, 3) ; SN $CVreceived = _ExcelReadCell($oExcel, 17, 3) ; received $CVDevIdent = _ExcelReadCell($oExcel, 1, 2) ; Device identification $CVProjIdent = ($oExcel, 2, 2) ; Project identification _Excel_Close($oExcel)  
×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.