# Error while compiling

## Recommended Posts

Hello all,

Today I just updated my beta version of AU3 using the AutoUpdateIt.exe tool. I 've also updated Scite manually to the latest version. Since then, when I try to compile a script within Scite I get the following error:

Error changing icon: Unable to read icon or icon was of the wrong format.

Searching on the forum I found this http://www.autoitscript.com/forum/index.php?showtopic=44313 which clearly says that this bug has been fixed since version 3.2.3.6. I am using 3.2.2.0 (stable) and 3.2.3.13 (beta). I am also using the aut2exe.exe from the beta folder while compiling and Scite recognizes it as version 3.2.3.13.

So what could be the problem with all this?

##### Share on other sites

Hello all,

Today I just updated my beta version of AU3 using the AutoUpdateIt.exe tool. I 've also updated Scite manually to the latest version. Since then, when I try to compile a script within Scite I get the following error:

Error changing icon: Unable to read icon or icon was of the wrong format.

Searching on the forum I found this http://www.autoitscript.com/forum/index.php?showtopic=44313 which clearly says that this bug has been fixed since version 3.2.3.6. I am using 3.2.2.0 (stable) and 3.2.3.13 (beta). I am also using the aut2exe.exe from the beta folder while compiling and Scite recognizes it as version 3.2.3.13.

So what could be the problem with all this?

What icon was you using??

##### Share on other sites

One which exists. The path is correct and actually it is the same icon that I have been using the last 2 years for that script without altering it at all.

In any case, even if I choose any of the AU3 icons (in the Icons folder) the result is the same.

Edit: Ok, now if I remove the icon, it produces another error: Error: Unable to execute upx.exe to compress stub file.

What is going on..?! upx.exe is in place in both the stable and the beta version...

Edit 2: I removed anything, stable, beta and Scite. I also removed the remaining folders by hand. I reinstalled latest stable, latest beta, latest Scite and the update. Now I can only compile using Aut2Exe from the stable release. Aut2Exe from the beta just stacks.

Anyone?

Edited by erebus

##### Share on other sites

Ok I have done more testing on this.

I cannot compile a specific script so far (which I used to in the past and I haven't change anything in it).

However I can normally compile some other scripts I tested with the beta aut2exe.exe.

I have no errors now. The aut2exe.exe from the beta version just hangs...

##### Share on other sites

Ok I have done more testing on this.

I cannot compile a specific script so far (which I used to in the past and I haven't change anything in it).

However I can normally compile some other scripts I tested with the beta aut2exe.exe.

I have no errors now. The aut2exe.exe from the beta version just hangs...

How are you compiling ? Alt+F7 ?

If so:

- do you have #COmpiler directives for the ICO?

- can you show the OUTPANE info ?

Have you tried to start Aut2EXE manually and clear the custom ICO ?

Live for the present,
Dream of the future,
Learn from the past.

##### Share on other sites

1) Yes I am compiling with Alt+F7. In any case, even if compiling normally (Ctrl+F7) the defined AUT2EXE in Scite is the beta one (because of older compilations an the existance of the script.au3.ini file in the same folder).

2) What do you mean by #Compiler directives for the ICO? I just declare it in the "Icon" field when pressing Ctrl+F7. The icon is in place, I can see it normally when pressing Ctrl+F7.

3) If I understand correctly, here it is:

>"C:\Program Files\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /beta /CompileDefaults /in "C:\Documents and Settings\erebus\Î¤Î± Î­Î³Î³ÏÎ±ÏÎ¬ Î¼Î¿Ï\UNICODE\AU3\l2city\l2city.au3" /autoit3dir "C:\Program Files\AutoIt3\beta"
+>20:16:47 Starting AutoIt3Wrapper v.1.8.0
>Running AU3Check (1.54.7.0)  from:C:\Program Files\AutoIt3\beta
+>20:16:49 AU3Check ended.rc:0
+>20:16:52 RC.exe ended.rc:0
+>20:16:53 ResHacker ended.rc:0
>Running:(3.2.3.12):C:\Program Files\AutoIt3\beta\aut2exe\aut2exe.exe
+>20:16:57 Aut2exe.exe ended.rc:0
+>20:16:57 AutoIt3Wrapper Finished
>Exit code: 0   Time: 10.608

Now instead of hanging up, AUT2EXE again terminates with the error: Error changing icon: Unable to read icon or icon was of the wrong format. If I remove the ICO from the settings, it produces the error Error: Unable to execute upx.exe to compress stub file.

I really removed everything related to AutoIT and Scite and reinstalled them from scratch. 99% it has nothing to do with Scite, as when trying to manually compile it using AUT2EXE directly (beta .13) it produces the same errors. Some times it just hangs up for ever with no errors. Also it does it to a specific big script (so far). With some other smaller scripts I tested, it compiles normally. The same behaviour occurs also with beta .12. If you want, I can do a backward test to see from which beta and afterwards this problem occurs.

Anyway, I cannot understand anything about these errors. Now they occur even if I try to compile with the latest stable's AUT2EXE... I will try it on another computer and I will post the results.

Edit: Everytime AUT2EXE that hangs up, gives a CPU time of 50%... Maybe that, tells you something.

Also after removing manually any setting left in registry after the uninstall, I can now compile all my scripts only with the stable compiler. The problem with the beta persists...

Edited by erebus

##### Share on other sites

Ok, here is some testing within different beta versions:

v3.2.3.0 - compiled ok

v3.2.3.1 - compiled ok

v3.2.3.2 - compiled ok

v3.2.3.3 - aut2exe crashed (windows message)

v3.2.3.4 - aut2exe crashed (windows message)

v3.2.3.5 - aut2exe crashed (windows message)

v3.2.3.6 - aut2exe hangs up (cpu load ~50%)

v3.2.3.12 - aut2exe hangs up (cpu load ~50%) or error messages about icon or upx.exe

v3.2.3.13 - aut2exe hangs up (cpu load ~50%) or error messages about icon or upx.exe

I have noticed in the changelog that since 3.2.3.3 AutoIt is compiled for Unicode. Maybe this could cause all these problems to me? Can you give me some information of how to further test it?

Thanks a lot.

Edit: Now I found a Jon's post in the devs forum which possibly describes my situation. Quoting him:

3.2.3.3 (15th April 2007) (Beta)

AutoIt is now compiled for Unicode.

Binary data handling completely rewritten.

>> THIS WILL ALMOST CERTAINLY BREAK SOME SCRIPTS - POST PROBLEMS IN BUG FORUM <<

How can I verify this?

Edited by erebus

##### Share on other sites

We need a way to be able to replicate your issue and when its confirmed , it needs to be posted in the Bug reports forum.

Any idea how we can get it to fail ?

Live for the present,
Dream of the future,
Learn from the past.

##### Share on other sites

The method used in passing the switch to aut2exe is done through windows so what you pass and what aut3exe receives can be 2 different things. Unicode has been an issue through the command prompt for some time and some use I believe is "Edit" and use the converted string or similar to convert unicode to some format suitable for command prompt to interpret. The command prompt is not unicode by default so passing unicode to AutoIt maybe a similar issue. Something to consider, english here so little experience to this.

##### Share on other sites

Ok, first of all thank you both for helping me to clarify this thing a bit.

Although I am a Greek, I have the use to write my scripts all in English. So if I am correct (let me know if not) this unicode problem (because of the parsing conversion or not) should happen only if anywhere in my script I had used anything else than English/Latin whatever. Right?

In addition, I don't believe that this problem has anything to do with Scite, as even if I try to compile my scripts directly within AUT2EXE (beta) the result is the same.

Now I can verify that I have the same problem on another computer too. So I think that it is not machine related.

I cannot help you to reproduce the problem, since on any new scripts that I have written the last two days, it works as expected with no crashes. However, as I wouldn't like to publish the source, I can send it in private if you are interested to analyze and help me on this. I will PM both of you when I upload it.

Thank you very much so far,

##### Share on other sites

I can replicate the issue with the PMed script ......

Live for the present,
Dream of the future,
Learn from the past.

##### Share on other sites

I can replicate the issue with the PMed script ......

After stripping till I isolated the issue I found that the @ character is the source of the problem in the Commentblock

Try compiling this with the latest Beta:

#cs
Problem with this @ character
#ce oÝ÷ ÚØb²+)«­¢+ØÌ(%AÉ½±´Ý¥Ñ Ñ¡¥Ì¡ÉÑÈ(\$

Live for the present,
Dream of the future,
Learn from the past.

##### Share on other sites

Same here. Stripping comments made compile work fine. Some trailing whitespace found in 23 lines also that Scite can remove with the "Cleanup script WhiteSpace" option, does not effect operation, but good to do anyway.

##### Share on other sites

Glad to have found that there is a bug anyway. I can recall that a few years ago there was again a similar bug in the comments section.

However, I think it is not that simple and not only the @ character is the problem. Here are my tests:

#cs
i.e.
.i.
#ceoÝ÷ Ù8^iº/z×¬´3IÊ&¦)^jëh×6#cs
a.b.
#ce

The above test DOES compile.

So from all these I really can't tell at the moment under which circumstances the error can exactly be reproduced. Maybe Jon can find something more on this...

Edited by erebus

##### Share on other sites

Earlier, when I stripped comments out with the comment stripper in my SendToA3X program, it compiled fine but when I tried again by removing manually until it compiled, I found I kept getting a UPX error so was left unsure as to the difference between doing it manually or by program. Perhaps the original file needs to be rewritten to a new file to remove the issue affecting it, i.e corruption in the original file? ...as well as the issue JdeB found.

##### Share on other sites

Maybe you have to compare the manually affected file and the one resulting by your program to find out what is going on. To me it seems like a parsing error of AUT2EXE in the #cs section that I cannot understand.

Are you able to reproduce the error with the #cs code I provided above?

##### Share on other sites

Just for reference: bug fixed in beta 3.2.3.14.

## Create an account

Register a new account