1

I use the cs50 app and VS2013. Of course, all is well with the cs50 app (since it is designed to be) but when I use VS2013 to code, any functions I use from cs50.h produce an error that looks like this (below is when I used GetString):

1>------ Build started: Project: tester_application, Configuration: Debug Win32 ------
1>  tester.c
1>tester.obj : error LNK2019: unresolved external symbol _GetString referenced in function _main
1>C:\Users\Jinyoung\Desktop\CSCI E-50\VS projects\tester\Debug\tester_application.exe : fatal error LNK1120: 1 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

I'm 100% sure that cs50.h and cs50.c are included in the same folder as stdio.h or iostream.h.

What should I do to fix this?

1
  • Please follow the instructions here to compile the CS50 library on Windows! – kzidane Sep 16 '14 at 14:36
1

In order to use the CS50 library, download it from here.

  1. Now, copy the files cs50.h and cs50.c to any arbitrary folder.

  2. Right click on the project, and got to Properties --> Configuration Properties --> C/C++ --> General...

  3. Include the path of the folder where the header files are to the additional include directories.

    1. Afterward, simply using #include or using #include "cs50.h" should do the job.

Happy Coding...

3
  • I tried your answer and still not working. I don't know why this is happening. Guess I'll just use gedit then... – jyj Sep 16 '14 at 18:39
  • @jyj if you're getting the same error as before, try compiling a simpler app... Ie. Try an app that's not complex and rather simply does some little thing... – Nib Sep 17 '14 at 3:23
  • Any improvements? I`ve been trying to use cs50 libraries in Visual Studio 2017 ... nothing so far If you guys have figured out a way, let me know =) – Gilmar Neves Dec 9 '17 at 12:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .