Jump to content
  • Advertisement
Sign in to follow this  
iliak

LNK2019 error with static lib dependency

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

I have a link problem in one of my projects which contains one exe and several static libs in a Visual Sutdio 2013 project.

The executable name is exec.library and rely on several static libs (intuition.library and graphics.libray to name a few).
Intuition.library calls functions in graphics.library and of course, exec.library calls functions in both graphics.library and intuition.library.

This little drawing will help in understanding the interdependences :

                  +------+
          +-------+ exec +-----+
          |       +------+     |
          |                    |
          |                    |
     +----v------+       +-----v----+
     | intuition +-------> graphics |
     +-----------+       +----------+

   
I have the following (french) error :

1>intuition.library.lib(OpenScreen.obj) : error LNK2019: symbole externe non résolu _ScreenToFront référencé dans la fonction _OpenScreen
1>D:\dev\MimicOS\SysCore\Debug\kernel.exe : fatal error LNK1120: 1 externes non résolus

ScreenToFront() and OpenScreen() functions are from intuition.library. When I compile intuition.library and graphics.library, everything is fine.
On the other hand, when I compile exec.library (which uses intuition and graphics library), I have this error. What is confusing is that these two functions are derived from the same static lib (intuition.library) ...


From what I understand, the problem lies in the fact that intuition.libray (a static library) and graphics.library (which is a static library too) calls each others.


In my fruitless search on the net, I came across several articles that may be may be related:
- http://blogs.msdn.com/b/vcblog/archive/2010/05/03/flexible-project-to-project-references.aspx
- http://stackoverflow.com/questions/9044221/unable-to-link-my-own-static-libraries


For those who have the courage to download the project (500KB), everything is available here: https://mimicos.codeplex.com/SourceControl/latest


Someone would have an idea?

 

Share this post


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

  • Advertisement
×

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!