| | |
Compile time errors in C++ while generating random numbers
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
Can you please post your code here? That second part looks like you've not defined a function or something. Perhaps you've misnamed a function that you created, or you're #including a wrong library or something. Either way, post your code, and we'll be able to help you troubleshoot it.
Alex Cavnar, aka alc6379
•
•
Join Date: Feb 2008
Posts: 1
Reputation:
Solved Threads: 0
•
•
•
•
I have borland C++ compiler on my system.while generating random numbers in C++,though i have incuded #include<cstdlib> and #include<iostream> i get these errors
1.cannot open include file cstdlib
2.call to undefined function rand
please help me with a solution
•
•
•
•
I checked my old Borland C++ compiler, you may have to add the .h to your includes!
#include<iostream.h>
#include<cstdlib.h>
•
•
•
•
as for the second error its because your calling rand() which is in the file math.h try including that the compile again
Obviously iostream worked. But cstdlib didn't. Change it to stdlib.h instead. We won't even mention math.h
You might consider upgrading to at least Borland 5.5
Or one of these that have an IDE:
Code::Blocks
MSVC++ Express
Open Watcom C++/Fortran
Bloodshed DevC
Last edited by WaltP; Feb 9th, 2008 at 10:06 pm.
The 3 Laws of the Procrastination Society:
1) Never do today that which can be put off until tomorrow
2) Tomorrow never comes
1) Never do today that which can be put off until tomorrow
2) Tomorrow never comes
![]() |
Similar Threads
Other Threads in the C++ Forum
- Previous Thread: FindFirstFile()
- Next Thread: if statement involving array of a class (C2451)
| Thread Tools | Search this Thread |
api array based beginner binary bitmap c++ c/c++ calculator char class classes code coding compile compiler console conversion count database delete deploy desktop developer directshow dll download dynamic dynamiccharacterarray email encryption error file forms fstream function functions game givemetehcodez google graph gui homeworkhelp homeworkhelper iamthwee ifstream int integer java lib linkedlist linker linux list loop looping loops map math matrix memory multiple news node number output parameter pointer problem program programming project python read recursion recursive reference return rpg string strings struct temperature template templates test text text-file tree unix url variable vector visualstudio win32 windows winsock word wordfrequency wxwidgets






