Menu

Map Code Linker Errors

2012-01-25
2013-04-30
  • Tyler N Petresky

    I created a map and exported for Visual C++. I copied the code from the .c file into my .h file and everything is errorless, but when I run the program and try to access the content I get linker errors.

    error LNK2005: "int * TerrainSeqPosition" (?TerrainSeqPosition@@3PAHA) already defined in game_engine.obj

    There are about 30 of them and they are all the same except for the names of the variables change.
    Any ideas?

     
  • URB

    URB - 2012-09-15

    A .c is compiled once, a .h is compiled each time it is included. So if you transform a .c in .h, the global variable become "already defined".

    I don't know what the resulting .c is like so I can't tell you more, but the problem comes from something like this.

     
  • Mike Wiering

    Mike Wiering - 2012-09-25

    The .TSD files should be seen as examples on how to create your own. These are often very old and won't work just like that. The idea is that you change the TSD to export the images/maps in a format you need for your project.

     

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.