Custom Icon problem when targeted Windows C++

Windows has icon caching, so you need to delete or rename in order to break the cache and see the new icon changes :smile:

@Andrew_Baca If you can create a sample project that illustrates the problem you are having, it would be very helpful. Thank you!

I am sorry I couldnā€™t answer earlier.
I tried to recreate the icon in inkscape and the artifact disappeared.
So itā€™s a svg problem.

Iā€™m taking my shovel to dig this thread because Iā€™m also having problems with icons in Windows. :confused:

Theyā€™re generated correctly from the svg file but I canā€™t get it embedded in the executable file (and, also, canā€™t use Resource Hacker to change the icon).

It used to work before, but lately Iā€™ve noticed that it doesnā€™t. Anyone can help?

What version are you using? What icon do you get, no icon?

Thanks for answering. :blush:

Iā€™m currently using 3.0.2 with Lime 2.3.2. I also tested with version 2.2.8 and Lime 2.1.3, but none of them worked.

All I get is an ico file and the exe without the icon embedded:

And I canā€™t edit it in resource hacker, because it reads like this:

Donā€™t know where the problem is, though :sweat:

If it helps, Iā€™m using Visual Studio 2013 CE for C++

Does it work when you build a standard OpenFL or Lime project? Or does the icon fail for all icons?

It doesnā€™t work with the example projects (tried building Pirate Pig) and the default Lime project for FlashDevelop.

Both executables donā€™t have any icon embedded and canā€™t be opened with Resource Hacker.

The output window always ends up with this message:

O sistema nĆ£o pode encontrar o caminho especificado. (The system cannot find the specified path)
Build succeeded
Done(0)

Hello again! :smile:

Okā€¦searching through the web I found this (http://stackoverflow.com/questions/3664944/flashdevelop-specify-an-hxml-file) link, where someone mentioned removing spaces in project path.

Haxe was installed in a folder ā€œHaxe Toolkitā€ on my computer (donā€™t know why) and, just by removing that space, it compiled the icon nicely! :sweat_smile:

I didnā€™t know about there could be no spaces on Haxe or project path. So blame my lack of information. :sweat_drops:

Thanks for answering it, Joshua! :smile:

1 Like

weird, weird, weird, so Haxe itself was just not working properly? Or something in our tools were not handling spaces correctly?

Just out of curiosity, could you try putting a project in a path with a space (like C:\Projects\My Project) and see if the icons work? That would help me know if it is caused by Haxe being upset or by the tools not handling spaces

Thanks!

Hi, Joshua!

Iā€™ve tested building a project in a directory using spaces and the icon rendered and was embedded correctly with the executable, I can properly open it using Resource Hacker now to test it. :smile:

I think itā€™s just Haxe being upset with the spaces in its own path thingy. :sweat_smile:

Sorry as this is an old post, but I have the same problem targeting Windows, I have a black box for the icon, in Android I got totally empty icon.

I am using svg icon

It used to work fine before legacy mode introduced to openFL,
I am using legacy mode to build my old project, but I got a black box for the icon

My stack is:
actuate: [1.8.6]
format: [3.2.1]
hscript: 2.0.4 [2.0.5]
hxcpp: [3.2.180]
lime: 2.6.8 [2.7.0]
openfl: 3.3.8 [3.4.0]
stablexui: [1.1.5]
svg: [1.0.8]
swf: [2.1.2]

I tried to do lime rebuild tools windows, but Iā€™ve got the same resultā€¦
Any idea?

[bump!]

Does this occur on OpenFL sample projects?

My project compiles in legacy mode, so even if icons worked fine at OpenFL sample projects, it wouldnā€™t help investigating the problem at my legacy based project. Is this a correct assumption?

I tried to build PiratePig, at Windows, the icon works fine, at Android here is the log tail:

-pre-compile:

-compile:
[javac] Compiling 5 source files to D:\HaxeToolkit\haxe\lib\openfl-samples\3,3,1\demos\PiratePig\Export\android\bin\bin\classes
[javac] warning: [options] source value 1.5 is obsolete and will be removed in a future release
[javac] warning: [options] target value 1.5 is obsolete and will be removed in a future release
[javac] warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
[javac] Note: D:\HaxeToolkit\haxe\lib\openfl-samples\3,3,1\demos\PiratePig\Export\android\bin\src\org\libsdl\app\SDLActivity.java uses o
r overrides a deprecated API.
[javac] Note: Recompile with -Xlint:deprecation for details.
[javac] 3 warnings

-post-compile:

-obfuscate:

-dex:
[dex] input: D:\HaxeToolkit\haxe\lib\openfl-samples\3,3,1\demos\PiratePig\Export\android\bin\bin\classes
[dex] input: D:\HaxeToolkit\haxe\lib\openfl-samples\3,3,1\demos\PiratePig\Export\android\bin\deps\extension-api\bin\classes.jar
[dex] Pre-Dexing D:\HaxeToolkit\haxe\lib\openfl-samples\3,3,1\demos\PiratePig\Export\android\bin\deps\extension-api\bin\classes.jar ->
classes-7a1c7e6055a72034439e74f22b134d4f.jar
[dx] unknown output extension: D:\HaxeToolkit\haxe\lib\openfl-samples\3
[dx] usage:
[dx] dx --dex [ā€“debug] [ā€“verbose] [ā€“positions=] [ā€“no-locals]
[dx] [ā€“no-optimize] [ā€“statistics] [ā€“[no-]optimize-list=] [ā€“no-strict]
[dx] [ā€“keep-classes] [ā€“output=] [ā€“dump-to=] [ā€“dump-width=]
[dx] [ā€“dump-method=[*]] [ā€“verbose-dump] [ā€“no-files] [ā€“core-library]
[dx] [ā€“num-threads=] [ā€“incremental] [ā€“force-jumbo] [ā€“no-warning]
[dx] [ā€“multi-dex [ā€“main-dex-list= [ā€“minimal-main-dex]]
[dx] [ā€“input-list=]
[dx] [.class | .{zip,jar,apk} | ] ā€¦
[dx] Convert a set of classfiles into a dex file, optionally embedded in a
[dx] jar/zip. Output name must end with one of: .dex .jar .zip .apk or be a directory.
[dx] Positions options: none, important, lines.
[dx] --multi-dex: allows to generate several dex files if needed. This option is
[dx] exclusive with --incremental, causes --num-threads to be ignored and only
[dx] supports folder or archive output.
[dx] --main-dex-list=: is a list of class file names, classes defined by
[dx] those class files are put in classes.dex.
[dx] --minimal-main-dex: only classes selected by --main-dex-list are to be put in
[dx] the main dex.
[dx] --input-list: is a list of inputs.
[dx] Each line in must end with one of: .class .jar .zip .apk or be a directory.
[dx] dx --annotool --annotation= [ā€“element=]
[dx] [ā€“print=]
[dx] dx --dump [ā€“debug] [ā€“strict] [ā€“bytes] [ā€“optimize]
[dx] [ā€“basic-blocks | --rop-blocks | --ssa-blocks | --dot] [ā€“ssa-step=]
[dx] [ā€“width=] [.class | .txt] ā€¦
[dx] Dump classfiles, or transformations thereof, in a human-oriented format.
[dx] dx --find-usages <file.dex>
[dx] Find references and declarations to a field or method.
[dx] declaring type: a class name in internal form, like Ljava/lang/Object;
[dx] member: a field or method name, like hashCode
[dx] dx -J ā€¦ <arguments, in one of the above forms>
[dx] Pass VM-specific options to the virtual machine that runs dx.
[dx] dx --version
[dx] Print the version of this tool (1.11).
[dx] dx --help
[dx] Print this message.

BUILD FAILED
D:\Android\android-sdk\tools\ant\build.xml:888: The following error occurred while executing this line:
D:\Android\android-sdk\tools\ant\build.xml:890: The following error occurred while executing this line:
D:\Android\android-sdk\tools\ant\build.xml:902: The following error occurred while executing this line:
D:\Android\android-sdk\tools\ant\build.xml:283: null returned: 1

Also, how hard is it to migrate my legacy code and catch up with OpenFL? do you advice me to do so? or keep trying to solve the black box icon problem at legacy mode?

You might try rebuilding with -clean (or just deleting the icon files) so it is no longer cached and generates again ā€“ it may have improved? Or it may be that it was upset with your SVG for some reason :frowning:

That would be a case-by-case basis of trying to analyze why the SVG does not render properly. Perhaps the SVG uses a lot of scaling?

Thanks for reply, I will check and see if clean caching would fix the issue, also, is there a recommended proved SVG icon to test with?

I think the current default Lime and OpenFL icons work alright :slight_smile: