How to add an Icon to an application built with Eclipse Galileo C and MinGW?

后端 未结 4 1488
梦如初夏
梦如初夏 2020-12-01 15:25

I\'ve read a lot about how to add an icon to an application built with Visual Studio, but I have no idea how to do this with Eclipse Galileo / C / MinGW.

Can anyone

4条回答
  •  伪装坚强ぢ
    2020-12-01 16:10

    Eclipse isn't set to look at resource files. BUG. So they also have steps to add it to processing. Here are the steps for June. [http://wiki.eclipse.org/CDT/User/FAQ#How_to_handle_Resource-Script-Files_.27.2A.rc.27_with_CDT.3F][1]

    How to handle Resource-Script-Files '*.rc' with CDT? Currently handling of windres.exe with CDT is not possible. You can not add the .rc file to the project to be compiled and linked with automatically. This is already raised as a bug in bugzilla.

    One way is to create a Pre-Build Step. Under menue Project | Properties | C/C++-Build | Settings | Build Steps | Pre-Build Steps fill in the command-line: windres --use-temp-file -i..\MyProject.rc -o..\MyProject_rc\MyProject_rc.o Make the object known to the linker. Under menue Project | Properties | C/C++-Build | Settings Tool Settings | MinGW C++ Linker | Miscellaneous | Other Objects click the icon 'Add', fill in the line: "C:\MyWorkspace\MyProject\MyProject_rc\MyProject_rc.o" 'MyWorkspace' and 'MyProject' replace with whatever is fitting for your purpose.

    You have to add the folder .\MyProject_rc before you build.

    The path to windres.exe must be known to eclipse.

提交回复
热议问题