• Advertisement
  • Popular Tags

  • Popular Now

  • Advertisement
  • Similar Content

    • By Michael Santer
      Hi!
      We're currently two programmers and a game designer working on a turn-based tactics fantasy board game. For reference you can search for images of "Tactics Arena Online", a fairly dated game that used to have a lot of depth and complexity.
      Our goal is to use the same combat concepts, but giving it a much needed modern touch as well as a whole new set of heroes to choose from with additional abilities. The game is a mix of isometric and 3D and we plan to release the game on Steam and hopefully Android & iOS as well.
      We are looking for someone to work with us pro-bono (just like we're doing) as a 3D character artist. The skills needed are creativity, a hard working attitude and an ability to make minor animations (things like idle, walk, block and very rudimentary attack animations). A perk to have would be the ability to make some VFX. If the game makes it on steam and money starts coming in, you'd obviously be compensated for your hard work, but as it stands this is a hobby project to garnish your portfolio.
      A bit more about the game:
      This game will be an online multiplayer game where each user gets to pick up to 10 characters to place on his half of the board (this would be done before even entering matchmaking. Think runes in League of Legends for example). The user can place his 10 units of choice anywhere he likes on his half board. Some units can be used more than once. So if you want 4 knights and 2 mages or even if you want 10 clerics, you can do as you please. You can then save your setups for future use. The goal of the game is to wipe out the enemy team.
      Each character or Hero (except premium and abyss characters) start with 1 ability and they can ascend (either by playing a certain amount of matches with the character or by forcing the ascension with real money) to gain a new ability or passive. Acquiring a new character can be done by using in-game currency that you earn from playing matches or using real money with the exception of Abyss characters which can only be acquired by winning certain rare matches. The goal is to offer a freemium game with lots of customizable elements while making sure that no user can "buy power" with real money. We want everything that a paying user can get to be available to non-paying users who play the game a lot.
      Ultimately we want this to become a competitive game that people can enjoy and really get invested in. Each character is designed with options for counterplay in mind and synergy with other heroes.
       
      We sincerely believe in what this game can become and we home to find someone just as passionate as we are to get involved in this project!
    • By CrazyApplesStudio
         Hello , i would like to showcase my first game project, a simple endless casual arcade game called Apples Mania : Apple Catcher. The game has simple goal , scoring as high as possible by collecting falling apples while the difficulty gradually increases. Different apples are worth different amount of points and there are also 2 power-ups to help you in your challenge.
        The game took me about 2 months to complete and polish and i made everything except for the music tracks and some of the sound files. Made in unity and blender3d.
        Would appreciate any kind of feedback.
      Google Play Link
       
        A trailer showing basic game-play:
       
    • By Paszq
      Troglodytes are a playable races in Arpago - they usually don't talk much and most of them lives near water sources.
    • By Paszq
      a Fox in a dungeon :)
    • By Paszq
      Fox Folk is one of 3 playable races in Arpago.
  • Advertisement
  • Advertisement
Sign in to follow this  

Unity Never understood Visual studio linker- Error lnk2005.

This topic is 544 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello,

I build a library which uses other libraries. 

I've encountered a linking error which I could not solve it in a simple manner.

 

I've downloaded TinyObjLoader which is a only header obj loader.

I've put the header in an api source folder which the project configuration references. (Include section)

Then you have to specifcy #define Tinyobject_Implementation to include the implementation in the header only.

The library build and link goes well, the issue is referencing it from another project.

I have a test project which defines a program.cpp (Main here) and it reference a "ClassRenderer.h" which includes my render object, this file includes the "MeshLoader" which includes the TinyObjLoader header.

The output is "ClassRenderer.obj" and "program.obj". (After compilation)

The issue is in the linker, it tries to link program.obj but fails because functions from tinyobjloader are already defined in ClassRenderer.obj.

 

So I solved it by making a new project from the tinyobjloader and creating a static library and removing the #define tinyobject_Implementation preprocessor definition.

Now the test project also links against TinyObjectLoader.lib, which I find unnessecery in a header only library.

How can I solve this without using a .lib or .dll file? 

 

I'm using Visual studio 2013 Community edition.

 

Thanks !

Edited by WoopsASword

Share this post


Link to post
Share on other sites
Advertisement

Then you have to specifcy #define Tinyobject_Implementation to include the implementation in the header only.


To understand the problem, you should read C++ FAQ lite’s “why can’t I separate the definition of my templates class from its declaration and put it inside a .cpp file?”. While not the exact issue described, it provides insight as to what is at play here.

First, the issue is that you apparently didn’t read the readme very thoroughly, as it states you should only define TINYOBJLOADER_IMLEMENTATION for only one translation unit: :^)
 

USAGE
-----
 

#define TINYOBJLOADER_IMPLEMENTATION // define this in only *one* .cc
#include "tiny_obj_loader.h"



Second, the actual issue is that the TINYOBJLOADER_IMPLEMENTATION switches tiny_obj_loader from a symbol importer to symbol exporter. The correct set up should look something like:
// source1.cpp
#define TINYOBJLOADER_IMLEMENTATION
#include <tiny_obj_loader.h>

// source1.cpp will contain all of tiny_obj_loader’s symbols.


// source2.cpp
#include <tiny_obj_loader.h>

// from here, the symbols in tiny_obj_loader contains stubs, which will
// be resolved when the linker links source2.obj with source1.obj

If both source2.cpp and source1.cpp define TINYOBJLOADER_IMLEMENTATION, then the linker sees two different sets of identical symbols for tinyobjloader, and that’s an error.

Share this post


Link to post
Share on other sites

 

Then you have to specifcy #define Tinyobject_Implementation to include the implementation in the header only.


To understand the problem, you should read C++ FAQ lite’s “why can’t I separate the definition of my templates class from its declaration and put it inside a .cpp file?”. While not the exact issue described, it provides insight as to what is at play here.

First, the issue is that you apparently didn’t read the readme very thoroughly, as it states you should only define TINYOBJLOADER_IMLEMENTATION for only one translation unit: :^)
 

USAGE
-----
 

#define TINYOBJLOADER_IMPLEMENTATION // define this in only *one* .cc
#include "tiny_obj_loader.h"


Second, the actual issue is that the TINYOBJLOADER_IMPLEMENTATION switches tiny_obj_loader from a symbol importer to symbol exporter. The correct set up should look something like:
// source1.cpp
#define TINYOBJLOADER_IMLEMENTATION
#include <tiny_obj_loader.h>

// source1.cpp will contain all of tiny_obj_loader’s symbols.


// source2.cpp
#include <tiny_obj_loader.h>

// from here, the symbols in tiny_obj_loader contains stubs, which will
// be resolved when the linker links source2.obj with source1.obj

If both source2.cpp and source1.cpp define TINYOBJLOADER_IMLEMENTATION, then the linker sees two different sets of identical symbols for tinyobjloader, and that’s an error.

 

 

So if I got it right,

I do not need to specify TINYOBJLOADER_IMLEMENTATION in the library?
Because I use it in only in 1 file (MeshLoader.h) that gets included in couple of files. (And yeah I wrote it inside a single cpp file).

 

It seems weird because I want my library to do all the work so I don't have to specify additional libraries or preprocessor definitions.

 

I've also checked the linked, I was there already and it did not help my case. Neither explains it :|

Edited by WoopsASword

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement