News:

The new Release 25.03 is out! You can download binaries for Windows and many major Linux distros here .

Main Menu

[Solved] ColorDialog API problem

Started by rittwik, May 26, 2008, 11:39:11 AM

Previous topic - Next topic

rittwik

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

rittwik

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

dje

Hi !

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

Dje

rittwik

Thanks Dje, it works now... :D

rittwik