logo codesdope

Compiling in mac mojave

   JeppeF

Hi! 

I have been having a lot of trouble since I began learning C++ from this great website. Please be patient with me because I have a hard time understanding where my exact problem lies. I usually type the examples in sublime text 3. In the beginning the way of building in sublime was enough (just pressing cmd + b) but when I got to the cin parts I wanted to compile the program so I could try inputting things myself. 
I have clang installed and command line tools and have succesfully built other things (Otto an opensource synth). However, when I tried to build (from terminal) the example from “Taking input for different data-types” I got an error saying “'wchar.h' file not found”. I found this stack overflow thread that seemed to describe the issue https://stackoverflow.com/questions/46342411/wchar-h-file-not-found. However, after trying out some of the things (unsuccesfully) i seem to have wrecked more than repaired. Now when I try to build the old way in sublime I get these error most of the time “/Users/myusername/Desktop/helloworld.cpp:1:10: fatal error: 'iostream' file not found
/Users/myusername/Desktop/helloworld.cpp:6:2: error: use of undeclared identifier 'std'

Right when I open sublime I can build for approx. 10-20 seconds but after that, these errors appear. 

I don’t really know where to begin and end with this question so please ask any info you might need! I have had a very frustrating evening with these problems. 

 


Answers

Write your answer
Close

Welcome.please sign up.

Close

Welcome.please login.