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.

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

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?

• Game Developer Survey

We are looking for qualified game developers to participate in a 10-minute online survey. Qualified participants will be offered a \$15 incentive for your time and insights. Click here to start!

• 9
• 11
• 15
• 21
• 26