-1

I received the above mentioned error when trying to build a piece of sample code in visual studio. The original sample code included a makefile but I didn't know how to do the linking that the makefile was doing within the visual studio project.

Note: This is a duplicate of this question: Error LNK2019: Unresolved External Symbol in Visual Studio

The author in that case was specifically asking about how to resolve in visual studio but was closed as a duplicate of a excellent, yet general description of the fundamentals of the problem, without getting specifics for Visual Studio.

Edit: I thought I was pretty clear on why this was a different question. This is a visual studio specific error message and I was looking for a visual studio specific solution. I did not need an explination on the linker, just a better understanding what this tool was and was not doing for me.

Community
  • 1
  • 1
b_levitt
  • 7,059
  • 2
  • 41
  • 56
  • 1
    At least I've been trying to consolidate these kind of problems here: http://stackoverflow.com/questions/24715864/problems-importing-libraries-to-my-c-project-how-to-fix-this – πάντα ῥεῖ Oct 11 '14 at 19:10
  • Your answer contains no reference to the lnk 2019 error which is why I did not find it - nor does the "duplicate" article. It also does not indicate how to add the dependencies which was my issue (I had already added the directory). I'm not sure why there is a push for consolidation. I did not need to understand the linker - I needed to understand what Visual Studio was and was not doing for me. That's why this and the question I referenced are not duplicates - they are visual studio questions and they are tagged as such. Are we going to consolidate "how to compile" next? – b_levitt Oct 22 '14 at 03:23

1 Answers1

1

In the project properties, you first need to add the folder containing the .lib files under Linker-->General:-->Additional Library Directories: enter image description here

After that you have to specifically specify the libs in that folder that you are linking by going to Linker-->Input-->Additional Dependencies:

enter image description here

It was pretty easy for me to find the libs I needed by looking at the makefile that came with the code and adding ".lib" to the entry:

PROJECT_LDLIBS = s100kvs s100grp s100sess s100sym s100scr s100fax otfaia m100admin otfutils s100sig
b_levitt
  • 7,059
  • 2
  • 41
  • 56