HW0 Compilation Notes

Website Initialization

Run these commands on your instructional account
mkdir ~/public_html
echo "Hello World" > ~/public_html/index.html
chmod 701 ~
chmod -R 755 ~/public_html
You may need to run
chmod -R 755 ~/public_html
again when you add new files/directories to it. You can open index.html in any text editor and edit the HTML.

Eclipse

If you encounter an error with
enum {FLOOR, CUBE} ;
It should be changed to:
const unsigned int FLOOR = 0 ;
const unsigned int CUBE = 1 ;

Windows

Using Visual Studio, download: http://inst.eecs.berkeley.edu/~cs184/sp12/Additional_Libraries.zip (As a quick reminder, Visual Studio can be downloaded for free on https://www.dreamspark.com/ ) Copy:
Dll\glew32.dll              to          %SystemRoot%\system32
Dll\glut32.dll              to          %SystemRoot%\system32
Lib\glew32.lib              to          {VC Root}\Lib
Lib\glut32.lib              to          {VC Root}\Lib
Include\GL\glew.h           to          {VC Root}\Include\GL
Include\GL\glut.h           to          {VC Root}\Include\GL
%SystemRoot% on Windows 7 x64 is typically C:\Windows\System32. {VC Root} for VS2008 is typically C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC, and for VS2010 is typically C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC. If it still doesn't work, some students have reported that
Include\GL\glew.h           to          C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Include\GL
Include\GL\glut.h           to          C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Include\GL
Lib\glew32.lib              to          C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib
Lib\glut32.lib              to          C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib
Dll\glew32.dll              to          ...hw0\Debug
Dll\glut32.dll              to          ...hw0\Debug
Or
Dll\glew32.dll              to          C:\Windows\SysWOW64\
Dll\glut32.dll              to          C:\Windows\SysWOW64\
Help solve issues as well. (And finally open the .sln) (Thanks Xiaohan and Anonymous)

Linux

If you are using a synaptic-based distribution, like Ubuntu, running
apt-get install freeglut3-dev glew-utils libglew1.6-dev
with the OSX/Linux HW0 package seems to work. (Adding -lGLU to the LD Flags in the Makefile also seems to make the No GLEW HW0 download work as well). If libglew1.6-dev cannot be found, try installing an older version, such as libglew1.5-dev. (And finally run make inside the directory) (Thanks Brian, Ibrahim)

OSX

Download and install XCode from the App Store, or from http://developer.apple.com/xcode/ (you may need an older version if you're on an older OSX version) If using make, just run make in the directory. If you wish to use XCode's IDE, add GLUT framework(and maybe OpenGL framework also), and change include headers from GL/glut.h to GLUT/glut.h in main.cpp(or anywhere it appears).

General

If you are getting the error:
ERROR: 0:9: error(#137) 'attribute' supported in vertex shaders only
ERROR: 0:10: error(#137) 'attribute' supported in vertex shaders only
ERROR: 0:11: error(#137) 'attribute' supported in vertex shaders only
Please replace the following lines in shaders/light.frag.glsl (lines 9 through 11):
attribute vec4 color ;
attribute vec3 mynormal ; 
attribute vec4 myvertex ; 
With:
varying vec4 color ;
varying vec3 mynormal ; 
varying vec4 myvertex ;