Thread: problem with undefined reference

  1. #1
    Registered User
    Join Date
    Nov 2010
    Posts
    2

    problem with undefined reference

    hi,

    i'm trying create a simple window with a listview control, and i keep having problems with undefined references.

    i'm using mingw 4.5.0, already have WINVER, _WIN32_WINNT, and _WIN32_IE defined, necessary headers included and the correct lib files linked (i think),

    here's the error output from compiler:
    Code:
    C:\Users\User\AppData\Local\Temp\ccw9OFo5.o:main.cpp:(.text+0x210): undefined reference to `InitCommonControlsEx@4'
    C:\Users\User\AppData\Local\Temp\ccw9OFo5.o:main.cpp:(.text+0x2c3): undefined reference to `SetWindowTheme@12'
    collect2: ld returned 1 exit status
    here's the command i use to compile:
    Code:
    g++ -static-libstdc++ -Wall -Wl,-subsystem,windows -I. -lcomctl32 -luxtheme main.cpp -o test.exe > o.txt 2>&1
    any idea what i'm doing wrong?

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    > -lcomctl32 -luxtheme
    Put these after main.cpp
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Registered User
    Join Date
    Nov 2010
    Posts
    2
    thanks, that works

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 4
    Last Post: 05-13-2011, 08:28 AM
  2. Using Vectors. MinGW warning
    By Viewer in forum C++ Programming
    Replies: 9
    Last Post: 03-26-2009, 03:15 PM
  3. problem with the library
    By kris.c in forum C Programming
    Replies: 21
    Last Post: 07-10-2006, 08:29 PM
  4. Linking problem - undefined reference to load_parameters
    By michaels-r in forum C++ Programming
    Replies: 3
    Last Post: 05-17-2006, 08:28 AM
  5. Undefined Reference Problem
    By esilja in forum C++ Programming
    Replies: 1
    Last Post: 11-08-2001, 09:05 AM