Skip to main content
GameDev.net gamedev.net
🔒 Locked

g++ broken?

Started by walkingcarcass Jan 17, 2007 at 12:57 PM 3 replies 1k views
Original Post
walkingcarcass
walkingcarcass
test.hpp:
class Test {
public:
	double test (	unsigned int i,
			double * buffer,
			void * argument = NULL) const;
};
test.cpp:
#include "test.hpp"
output:
Quote:
g++ -c test.cpp test.hpp:5: error: ‘NULL’ was not declared in this scope
This suddenly started. Code that compiled yesterday now fails with this error. What's going on?
spraff.net: don't laugh, I'm still just starting...
NLDEV
NLDEV
NULL is not a keyword; it is a macro. Are you including a header which defines NULL?
gumpy
gumpy
Quote:
Original post by walkingcarcass
What's going on?


exactly what the error says. NULL isn't defined. i believe it's defined in quite a few header files so you probably just removed an #include and now it doesn't know what you're talking about. you can just define if yourself if you need to.
This space for rent.
Nitage
Nitage
Try:
#include <cstddef>
Zahlman
Zahlman
Or you could try spelling it the modern (for now) way: 0.

Oh, and what are you doing with those void*s in my C++? :(

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.