I am working with a code that has mostly been developed in C++. There are a few C files too. I'm quite new to programming; this is an engineering code.
I have been using it successfully for months on a Mac, compiled with g++. Now I need to compile it using gcc/4.7.2 and Linux. I am getting this error:
factor.c:35:19: fatal error: cstdlib: No such file or directory
The file, "factor" is one of the few C files I mentioned. It does contain:
#include <cstdlib>
I tried changing it to the "C" version. That didn't work. My understanding is that "cstdlib" should be included by default with the compiler, but I can't find it. Does anyone know how to do a thorough search?
I don't have root privileges on this machine, so I probably can't install it.
I'm stuck and if anyone has any advice, I would be very grateful.
the c version. so if you are writing code in a .c file you cant have a cx file. x is a place holder for any one the c headers. so for example:
(c++ can use either c can only use the first column)
c header c++ equivalent
----------- -------------------
stdio.h cstdio
ctypes.h cctypes
string.h cstring
stdlib.h cstdlib
math.h cmath
time.h ctime
It is weird that it isn't working. I did check usr/include and it doesn't look like anything is there. This is a cluster, so maybe the setup is different.
Do you know if it is possible to get it from anywhere else and simply install it in my own directory?
Hey if you're still there, DTSCode, it did work!! I needed to add an include path to my makefile to
/usr/include/
That way, I was able to access "stdlib.h".
Your advice about needing to say <cFile.h> and not <cFile> has been a huge help. Thank you so much. I don't know if I can give you some kind of credit (like marking this answer right) for your help; if I can, I'd be happy to. Just let me know!