Hot answers tagged

11 votes

Undefined reference to `GetString'

A library's header file (the one that ends with the .h extension) doesn't contain function definitions. Instead, it contains the library's resources that are available for you to use. These resources ...
user avatar
  • 17.4k
8 votes

Installing cs50.h on a Mac

Follow the steps below, and see if it helps... [Optional, you may choose to not install Xcode as long as you have any text editor] On a Mac, make sure you have installed Xcode first of all. It's ...
user avatar
  • 1,146
7 votes

Undefined reference to `GetString'

Did you compile it using make? If not (and why not?) did you remember to include the -lcs50 clang compile flag that links the library?
user avatar
  • 18.4k
7 votes

Undefined reference to `GetString'

Download the cs50 from: http://mirror.cs50.net/library50/c/library50-c-5.zip Extract it. (You will get two files cs50.c and cs50.h) Now copy both the files to your default library folder. (which ...
user avatar
5 votes

Undefined reference to `GetString'

I have had the same problem in CS50 2015 VMware appliance. I even include CS50.h library like that: #include<cs50.h> But I was keep getting error 1 of Undefined reference to `GetString' or '...
user avatar
4 votes

cs50.h header files download

It depends on your compiler, but odds are the simplest method of installation is to: Download and unzip library50-c-5.zip. Copy cs50.c and cs50.h into the same directory as your own code.
user avatar
  • 1,211
3 votes
Accepted

CS50 IDE seems to use an old version of the CS50 library

It should be sufficient to update the IDE, using the update50 command, on the terminal. It is also possible that the announced changes take a few days or weeks to complete
user avatar
  • 5,172
2 votes

CS50 IDE seems to use an old version of the CS50 library

What IDE version? It is displayed in the menu bar next to the cloud9 icon. You can version50 at the command line. Current version is 94 as of this writing. Did you run update50 as per the Updating ...
user avatar
2 votes
Accepted

automatically link cs50 when using make? - not using appliance

cs50.h is a header file. Header files are NOT linked. They are included. What is linked is a library binary file. If you have successfully installed the cs50 library according to the instructions ...
user avatar
  • 17.4k
2 votes

GetInt + sscanf -- why doesn't it accept only characters?

Good catch. Actually, c will never be populated with this command if (sscanf(line, " %i %c", &n, &c) == 1). It is a matching failure. From man sscanf: A conversion specification, which ...
user avatar
1 vote
Accepted

Unable To Install CS50 Library for C on Android Termux

1. Edit the Makefile From DESTDIR ?= /usr/local MANDIR ?= share/man/man3 To DESTDIR = /data/data/com.termux/files/usr/local MANDIR = /data/data/com.termux/files/usr/share/man/man3 In the Makefile, ...
user avatar
1 vote
Accepted

Help in Resize, biSize headers not sizing correctly

Hmmm..... So here's my question for you. WHICH fields are supposed to be updated in the headers when resizing to something other than 1? Hint: check50 is giving you a clue. If this answers your ...
user avatar
  • 64.2k
1 vote
Accepted

Compilation error in hello.c: undefined reference to `get_string'

Compiler does not complain about missing cs50.h, so that looks right. The linker does complain, though, and that's probably because you did not pass -lcs50 when compiling (telling the linker to ...
user avatar
  • 20.7k
1 vote

cannot find cs50.h within the cs50 ide

Instead of getstring, it should be get_string.
user avatar
1 vote
Accepted

Functions outside Cs50.h

As one can see on https://github.com/cs50/libcs50/tree/master/src those contain quite some code to keep you from messing up and provide a nice user interface. The simplest alternative would be scanf, ...
user avatar
  • 20.7k
1 vote
Accepted

CS50 IDE cs50.h library problem 2017

The compiler command is make test (unless you want to supply all the switches for clang). Notice that make echos to the terminal the actual clang command it uses.
user avatar
1 vote
Accepted

String error #include <cs50.h>

Check your spelling of string. You spelt it as stirng it is spelled string
user avatar
1 vote
Accepted

"string" data type in cs50 library

The string type is just a defined type of char* (a char pointer) which since it is a pointer has a size of 4 bytes.
user avatar
  • 7,326
1 vote

Error using string as a data type while including the cs50 library

Clang is telling you exactly what is going wrong..."unused variable 's'". Your code gets input from the user and stores it in a string variable s, then does nothing with it. If you do something with s ...
user avatar
1 vote
Accepted

unable to access functions in cs50.h

Are you using the virtual machine? If that's the case, then execute: update50 It will update your vm to the latest version. It will probably fix the issue. If you are not using the vm, the download ...
user avatar
1 vote

Problem with cs50.h header file!

I solved the cs50.h problem by updating my appliance. For updating open the terminal in the appliance and type-- update50 After the process is completed, cs50.h will work..
user avatar
1 vote

Problem including cs50.h with Visual Studio 2013

In order to use the CS50 library, download it from here. Now, copy the files cs50.h and cs50.c to any arbitrary folder. Right click on the project, and got to Properties --> Configuration Properties ...
user avatar
  • 1,146

Only top scored, non community-wiki answers of a minimum length are eligible