Jump to content

Compiler issue with #include-once


Recommended Posts

I wanted to run this past the community before sumbitting a bug report. Maybe I am missing something.

I was re-scanning my dictionary to an SQLite database, to include definitions for new project. While testing, and running from SciTe, Everything works perfectly without any errors. When I compile and run the compiled version, I get a duplicate function name error.

To narrow down the duplicate function, stripped out all of the func statements from the _Obfuscated file, then started looking for a duplicate. The only function duplicated was the _TempFile() function.

I then went through and copied all of the included files (including nested includes) into a single folder, and scanned them for the _TempFile() function. The only one was in file.au3. The file.au3 UDF does in fact have two #include references; one in one of my include files, and one in the sqlite.au3 UDF. I did confirm that the file.au3 UDF does have an #include-once statement at the top.

I then uninstalled AutoIt, made sure the program folder was deleted, rebooted, and reinstalled. The problem was repeated.

So, did the compiler include file.au3 twice, despite the #include-once?

Running the latest stable version (3.3.8.1)

You can download the pertinent files to reproduce the problem in a zip file from http://www.fileswap.com/dl/ADkEkxTExU/ (approx 1.4 MB)

Any ideas would be appreciated.

Link to comment
Share on other sites

i suppose it has to do with creating the debug files in the user data folder and referring to them would be better.

Thank you for the suggestion.

This sounds like the opposite of my problem. When I run the script from within SciTe (F5), it runs without any errors. The problem is when it is compiled to an EXE.

Link to comment
Share on other sites

Does it work if you compile without the obfuscator? Do you have file.au3 in different locations in you include paths?

Edited by ProgAndy

*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Link to comment
Share on other sites

Does it work if you compile without the obfuscator? Do you have file.au3 in different locations in you include paths?

It compiles the same without obfuscator.

I did temporarily copy file.au3 to the script folder, but only for the debugging I listed above, after the problem was first encountered.

--- edit ---

Correction. I checked again through my includes path. I let someone use my computer to test a script. He copied several of the UDFs to my personal Includes folder (something I never would have expected). Files.au3 was one of them.

Deleting the duplicate UDFs fixed the problem. ;)

So it seems that when the compiler encounters an included file with #include-once, it does not stop there, but continues to look in the path to see if it finds another one with the same name. Not a show-stopper now that I know what happened, but maybe the developers might want to look at it. I'll let them decide if that qualifies as a bug or a works-as-designed.

Edited by willichan
Link to comment
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
 Share

  • Recently Browsing   0 members

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