User forums > Help
Help with setup
Jenna:
Do you include stdlib.h from the libc6-dev package, or another header that implicitely includes this ?
fanotto:
--- Quote from: jens on December 06, 2008, 03:47:20 pm ---Do you include stdlib.h from the libc6-dev package, or another header that implicitely includes this ?
--- End quote ---
I have the following in former.cpp:
#include "Point2D.h"
#include "Color.h"
#include <string>
#include <vector>
#include <GL/glut.h>
#include "former.h"
#include "Viewer.h"
#include <time.h>
#include <unistd.h>
#include <queue>
using namespace std;
Jenna:
--- Quote from: fanotto on December 06, 2008, 03:56:22 pm ---
--- Quote from: jens on December 06, 2008, 03:47:20 pm ---Do you include stdlib.h from the libc6-dev package, or another header that implicitely includes this ?
--- End quote ---
I have the following in former.cpp:
#include "Point2D.h"
#include "Color.h"
#include <string>
#include <vector>
#include <GL/glut.h>
#include "former.h"
#include "Viewer.h"
#include <time.h>
#include <unistd.h>
#include <queue>
using namespace std;
--- End quote ---
I use gcc-4.2 as default compiler and srand is found.
To test it with gcc-4.3 I have set up an extra toolchain, and ...
... srand is no longer in scope.
Add #include <stdlib.h> and it should work.
fanotto:
Thanks a lot Jens. It worked.
For now I am very confused about the standard libraries and STL and what to include where. But if I need to include less files for the functions I want it might be a good thing. Been a while since programming at school and hope I can get into it as hobbyist.
Thanks again.
Navigation
[0] Message Index
[*] Previous page
Go to full version