Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

basshead6949

macrumors newbie
Original poster
Oct 11, 2007
2
0
greetings all. im doing music tech at uni and have a programming module and am understanding the basics well. my only problem is that when i try and do my coursework on my laptop (rather than the uni computers) i am always left with one red cross when i build and go. at the beginning of the page, no matter what im building, i see this

#include <iostream>

int main (int argc, char * const argv[]) {

and every time a red cross comes up by the include <iostream> part saying at the bottom, and i quote, "error: stdint.h: no such file or directory"

please could someone tell me asap what this means and possible routes to retify it.

many thanks

ps. this is using the c++ tool, under the command line utility section of the program
 

Eraserhead

macrumors G4
Nov 3, 2005
10,434
12,250
UK
Also what operating system and version are you using at Uni?

EDIT: If you don't know the details a rough answer is still useful, basically I want to know if you are using Linux, OS X or Windows, but the more detail the better :).

For what its worth I have no idea what version of Linux we use at my Uni, though today I did scare everyone in my lecture class by knowing that you can turn off optimisation on a compiler ;).
 

willyme

macrumors newbie
Oct 11, 2007
2
0
Some advice..

You really have to be more specific as to what you are doing. Are you compiling? linking? both??

There are generally two steps (although you can do it in one) to compiling a simple program such as your example. First you compile your source into an object via:

c++ -c myFile.cpp

which produces the file myFile.o. You can then link this object into an executable via:

c++ -o myExecutable myFile.o

So long as the environmental variables are set correctly all will work well. If `modifications' have been made then the compiler might not know where to find the required resources. It appears that this is what is happening to you.

You could try to find out what is wrong but it takes way too much time. Simply create a new user account with default settings. See if using this new account solves the problem. It should. If it does not then there is something wrong with your setup - reinstall the developer tools.

It is important that you understand the two steps listed above - compile and link. They are separate and do very different things. When using the command line tools do not take shortcuts - perform the tasks separately. I know it's a pain, but if you do not learn how your tools actually work it will haunt you for years... Invest the time early.. Try to understand the tool - don't just use it..

Oh, I forgot you are doing music tech... Don't worry too much about the tools unless you are going to use them all the time.. You probably won't so invest your time into learning something more relevant. I just assumed you were a CompSci major. It's scary how many CompSci majors grad without this basic knowledge... ;)
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.