I am trying to add a *.def file to my program to hide the console window on launch, as it doesn't need to display anything to function. It is a Windows only application.

I saw at this post (https://forum.dlang.org/post/ilj5vn$ef4$1...@digitalmars.com) that I could either use a linker flag, -L/exet:nt/su:windows, or add a module definition file. I decided on the definition file.

EXETYPE NT
SUBSYSTEM WINDOWS

I have this file named deflector.def, and I compile with the command as follows.

ldc2 source/* -of="build/SearchDeflector-x86.exe" -O3 -ffast-math -release


All of my source code and the *.def file is in the source/ directory. I am not using DUB. The issue when compiling says that those two definitions(?) aren't supported for my target. That doesn't make sense because I am using the MSVC linker with LDC2.

source\deflector.def(1) : warning LNK4017: EXETYPE statement not supported for the target platform; ignored source\deflector.def(2) : warning LNK4017: SUBSYSTEM statement not supported for the target platform; ignored

Any help would be appreciated.

I would also like to know how to add a PNG or ICO file to my compiled executable. I have icons in the resolutions of 16, 32, 64, 128, 256. Currently I'm adding them in using GitHub's RCEDIT tool (https://github.com/electron/rcedit) but I would like a more proper way.

Reply via email to