Results 1 to 12 of 12

Thread: Qt and global variables

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #11
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    28
    Thanked 976 Times in 912 Posts

    Default Re: Qt and global variables

    Quote Originally Posted by Lykurg View Post
    When compiling I receive the error (which I don't understand == don't know what to do/where the error could be):
    .comp/sw_normal.o: In function `operator delete(void*, void*)':
    /usr/include/qt4/QtCore/qatomic_i386.h:62: multiple definition of `configuration::m_instance'
    .comp/qvortaro.o:/home/lykurg/Programmierung/qvortaro/src/qvortaro.cpp:194: first defined here
    collect2: ld returned 1 exit status
    You have placed the definition of static member variable in a header file, therefore every .cpp file that includes it has it's own copy of that variable. Better move that line to one of the .cpp files, say configuration.cpp.

  2. The following user says thank you to jacek for this useful post:

    Lykurg (1st February 2007)

Similar Threads

  1. Replies: 1
    Last Post: 22nd January 2007, 09:41
  2. Declarate global parameters
    By Dark_Tower in forum Qt Programming
    Replies: 7
    Last Post: 11th December 2006, 18:01
  3. Global variables
    By Mariane in forum Newbie
    Replies: 14
    Last Post: 10th October 2006, 17:23
  4. Creating a global array in my code???
    By therealjag in forum General Programming
    Replies: 5
    Last Post: 13th March 2006, 11:13
  5. declaration of global variables???
    By pranav_kavi in forum Newbie
    Replies: 6
    Last Post: 31st January 2006, 19:56

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.