Hey,
I'm trying to adjust a customized icon for my application. I searched and found
a couple threads but it still doesn't want to work. Here are my file:
My CPP file:
=========================================================
#include <FL/Fl.H>
#include <FL/Fl_Window.H>
#include <FL/Fl_Box.H>
#ifdef WIN32
// the following is needed for the window icon (WIN32 only)
#include <windows.h>
#include <FL/x.H>
#include "resource.h"
#endif
int main(int argc, char **argv) {
Fl_Window *window = new Fl_Window(300,180);
Fl_Box *box = new Fl_Box(FL_UP_BOX,20,40,260,100,"Hello, World!");
box->labelfont(FL_BOLD+FL_ITALIC);
box->labelsize(36);
box->labeltype(FL_SHADOW_LABEL);
window->end();
#ifdef WIN32
// set window icon (_before_ window->show(argc,argv)!)
window->icon((char *)LoadIcon(fl_display, MAKEINTRESOURCE(IDI_ICON1)));
#endif
window->show(argc, argv);
return Fl::run();
}
My resource.h:
=========================================================
#ifndef RESOURCE_H_
#define RESOURCE_H_
#define IDI_ICON1
#endif /*RESOURCE_H_*/
My favicon.rc:
=========================================================
#include "resource.h"
IDI_ICON1 ICON DISCARDABLE "favicon.ico"
I took the FLTK icon and made also an object file with this command:
windres favicon.rc favicon.o
And linked it to the linker.
I can't get rid of my error message:
=========================================================
**** Internal Builder is used for build ****
g++ -DWIN32 -IC:\workspace\LIMSUI\include -O0 -g3 -Wall -mwindows -c
-fmessage-length=0 -osrc\main.o ..\src\main.cpp
.\src\main.cpp: In function `int main(int, char**)':
.\src\main.cpp:22: error: expected primary-expression before "char"
.\src\main.cpp:22: error: expected `)' before "char"
Build error occured, build is stopped
Time consumed: 828 ms.
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk