Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: rittwik on May 26, 2008, 11:39:11 am

Title: [Solved] ColorDialog API problem
Post by: rittwik on May 26, 2008, 11:39:11 am
I am using codeblocks-8.02mingw-setup in Windows XP. While trying to compile the following code, I get the error:

Code:

/.......
case WM_CREATE:
            {        CHOOSECOLOR col;
                      COLORREF color = RGB(0,0,0);
                      col.lStructSize=sizeof(CHOOSECOLOR);
                      col.hwndOwner=hwnd;
                      col.Flags=CC_SOLIDCOLOR;
                      col.lpCustColors=&color;
                      ChooseColor(&col);
            }
            break;
......./

Error:

Linking console executable: bin\Debug\test.exe
obj\Debug\main.o: In function `Z15WindowProcedureP6HWND__jjl@16':
C:/Documents and Settings/user/Desktop/test/main.cpp:84: undefined reference to `ChooseColorA@4'
collect2: ld returned 1 exit status

Can anyone help me on this?

Thanks
rittwik
Title: Re: ColorDialog API problem
Post by: rittwik on May 26, 2008, 12:53:12 pm
Sorry, forget to mention that the problem is occuring only with MinGw 4.2.1. There is no problem compiling  the code with Borland C++ 5.5.

Thanks
rittwik
Title: Re: ColorDialog API problem
Post by: dje on May 26, 2008, 01:00:55 pm
Hi !

Did you check in your project settings that comdlg32 is present in the linker properties ?

Dje
Title: [solved] ColorDialog API problem
Post by: rittwik on May 26, 2008, 01:37:54 pm
Thanks Dje, it works now... :D

rittwik