Menu

ImageLists

2002-12-04
2012-09-26
  • Nobody/Anonymous

    I've tried to use an imagelist, to add icons to the treeview control I have on my dialog. To make a imagelist, one must use the ImageList_Create Win32 API call. I have added the library where this function is defined, "commctrl.h", but it still doesn't work.

    The call I make to it is:

    HIMAGELIST hImageList = Imagelist_Create (15, 15, ILC_COLOR, 3, 0);

    I get a linker error like this:

    [LINKER ERROR] undefined reference to 'ImageList_Create@20'

    I would appreciate any help anyone could give me.

    -GLENN-

     
    • Nobody/Anonymous

      Oh, and I am using Dev-C++ 4.9.6.0 and YES, I spelled it correctly. If I hadn't I would have got the IMPLICIT DECLARATION error instead.

      -GLENN-

       
    • Nobody/Anonymous

      Okay, I checked out another post on this forum called "undefined reference to InitCommonControls". There is mentioned that I would need to add the common control .lib file. I did some searching and I found the answer.

      For those who have the same problem, you need to go to project options and add "-lcomctl32" (without the qoutes) to the linker options. I found this in the MDI example added with Dev-c++

       
    • Nobody/Anonymous

      Thanks Glenn! 

      This bears out my observation that when you see the @ in the function name in the error message, its a hint that you have a link problem.

      Wayne

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.