Jump to content

View more

Image of the Day

I've done more tweaks to my color palette selector. #gamedev #screenshotsaturday #madewithunity https://t.co/aJXrC4ruRg
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.

Sign up now

LNK2019 error with static lib dependency

4: Adsense
  • You cannot reply to this topic
No replies to this topic

#1 iliak   Members   


Posted 18 March 2014 - 12:45 PM

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?


Attached Files

- Iliak -
[ ArcEngine: An open source .Net gaming framework ]
[ Dungeon Eye: An open source remake of Eye of the Beholder II ]