problem with undefined reference

This is a discussion on problem with undefined reference within the Windows Programming forums, part of the Platform Specific Boards category; hi, i'm trying create a simple window with a listview control, and i keep having problems with undefined references. i'm ...

  1. #1
    z9d
    z9d is offline
    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?
    Attached Files Attached Files

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,443
    > -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.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  3. #3
    z9d
    z9d is offline
    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, 08:05 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21