Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NULL keyword not declared? #1

Open
nesanders opened this issue Jul 30, 2014 · 0 comments
Open

NULL keyword not declared? #1

nesanders opened this issue Jul 30, 2014 · 0 comments

Comments

@nesanders
Copy link

Hello,

When trying to compile this project, I received the following error:

g++ main.cpp corpus.cpp slda.cpp utils.cpp opt.cpp -o slda -lgsl -lm -lgslcblas
In file included from corpus.cpp:22:0:
corpus.h: In constructor ‘document::document()’:
corpus.h:39:17: error: ‘NULL’ was not declared in this scope
         words = NULL;
                 ^
corpus.h: In destructor ‘document::~document()’:
corpus.h:55:22: error: ‘NULL’ was not declared in this scope
         if (words != NULL)

Looking at [http://stackoverflow.com/questions/462165/error-null-was-not-declared-in-this-scope](this thread) suggests that the cstddef library needs to be included in corpus.h.

#include <cstddef>

With this change, I can compile successfully.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant