Help with linking fiels for game

This is a discussion on Help with linking fiels for game within the Game Programming forums, part of the General Programming Boards category; Im having a problem with my linking constantly with getting double the intialize items then i requested , but thou ...

  1. #1
    Registered User
    Join Date
    Oct 2006
    Location
    New York
    Posts
    123

    Help with linking fiels for game

    Im having a problem with my linking constantly with getting double the
    intialize items then i requested , but thou i did use comma guides and pragma once....
    Attached Files Attached Files

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,845
    You've got initialisations inside header files, like
    bool GAMESTARTED=false; //used by NewBlock()

    In the header, you should have
    extern bool GAMESTARTED;

    In exactly ONE .cpp file, you should have
    bool GAMESTARTED=false; //used by NewBlock()

    In header files,
    - structs and classes
    - extern data
    - const data (as you have it now)
    - function prototypes
    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.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Problems linking with g++
    By Just in forum Linux Programming
    Replies: 11
    Last Post: 07-24-2006, 02:35 AM
  2. strange linking error -- can not find shared library
    By George2 in forum C Programming
    Replies: 2
    Last Post: 07-10-2006, 11:51 PM
  3. Replies: 8
    Last Post: 04-27-2006, 11:39 AM
  4. Grrr.... SDL Linking Problem
    By 7EVEN in forum Game Programming
    Replies: 5
    Last Post: 08-12-2005, 09:44 PM
  5. Linking error with DirectDrawCreateEx
    By jjj93421 in forum Game Programming
    Replies: 6
    Last Post: 04-06-2004, 04:57 PM

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