I am using ubuntu and i have installed cs50 library i have created a simple program with GetInt() and it's working but when I have created mario.c it raise an error that" undefined reference to GetInt" and " ld returned 1 exit status" The program is running with scanf but not with GetInt. What should i do?

  • You need to link the CS50 library on compilation using the -l option. Watch the short on libraries for more information! – Kareem Feb 25 '15 at 10:28
  • I can't understanding difference between cs50 appliance and cs50 library. – Zeba Khan Mar 1 '15 at 10:12
  • the cs50 library is a C library. To understand what a library is, you may watch the short on libraries! The cs50 appliance is a virtual machine. For more information see this! – Kareem Mar 1 '15 at 19:31
  • So without cs50 appliance i can't use cs50 library in ubuntu? Have i must install this appliance for programming with cs50 library in ubuntu? – Zeba Khan Mar 2 '15 at 7:08
  • You can install the cs50 library on your host machine. See this for more info! – Kareem Mar 2 '15 at 7:58
  1. check if you added the cs50 header
  2. "make mario" should take care of linking the cs50 library
  • I can't access GetInt() funtion although i had added cs50 header in file And also i linked with -l at the compiling. – Zeba Khan Feb 27 '15 at 7:30
  • I would make both programs with make and take note of any clang parameters differences for both. – Alexey Chugunov Feb 27 '15 at 10:05

You must log in to answer this question.

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