Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


Linkage Error:Lnk2019

This topic is 5251 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

Since 1 week, i have got a error of linkage in my project. I''m working on a game engine. In this, there are some interfaces for each part of the engine, 1 for graphic, 1 for texture manager, 1 for sound manager, etc ... Also, we can say that the engine have its own data type: Entity. An entity is composed by its coordonates (x,y), and by a list of states. Each state is defined by his visual data, his physic behavior, by his sound data, by a list of action that he must accomplish, and by a list of conditions that are checked to change to another state. All the interfaces are implemented by a dll. In this, when i want create an entity, i have got a linkage Error Lnk 2019 with Entite:Entite(), he doesn''t know the constructor ? I dont understand. Then,I have tried to move the implementation of entity in his .h, and it''s run, but now when i compile the main program, i have got ERROR LNK2005 which said that entite is already defined in *obj. Also, I have tried to encapsulate the include of entity in my dll by extern "C", and it said that linkage C cannot run with template. Yes, i use template to make lists, and an entity have a list of states. Well, i don''t know what i must do Please, help me PS: Sorry for my poor english, i am french Get the Ganah Style !!

Share this post

Link to post
Share on other sites
I don''t must do this, because, i load dynamically the .dll .
And, it''s only the dll project which have the Lnk2019 error, not the main program.
In fact, in a dll project, when i include a .h, it must contain the definition of the class but also its implementation, else the linker generate error Lnk2019.
So i don''t want include the implementation in the .h

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!