4
votes
Accepted
why doesn't getColor work?
It returns an int that represents a color. See http://www.programmingsimplified.com/c/graphics.h/colors for more info. Also google getColor for more explanation.
You could use the actual color ...
4
votes
Running breakout on Mac OS X
As such, the Stanford Portable Library is under a GNU license, which makes it legal for us (or in fact, me) to redistribute it to you, or anyone else, as stated by the license:
/**********************...
3
votes
Accepted
PSET 4(breakout) : Paddle goes out of window
Are you doing anything with x ? Checking it to make sure that you don't go outside (ie, checking that it is within the bounds of width of the window?) And when you do that, make sure you take into ...
2
votes
Accepted
Why do my SPL example programs fail to compile?
Be sure that you have Makefile from the src4m file in the same directory and use make click to compile. This Makefile contains compilation rules for each specific file that override the generic one of ...
2
votes
Accepted
How come we can use objects in a structured programming language like C?
the SPL is originally written in Java. as you probably know, Java is an object-oriented programming language.
basically a C program that makes use of the SPL creates a process in the background ...
2
votes
Accepted
SPL question, how to use it in CS50 IDE?
I'm afraid there is no way for the SPL to work on the CS50 IDE the same way it works on the appliance. what you can do though is to download VMware's alternative, Oracle's VirtualBox, which is free of ...
2
votes
Accepted
What fonts are available using Stanford Portable Library?
You should be able to use whatever fonts are installed in your machine (i.e., in the appliance). You can see them by running the Settings Manager app from the CS50 menu. Choose Appearance and then ...
1
vote
Accepted
How to install SPL libraries on ubuntu?
Just for reference, the problem was that the OP installed Oracle's JDK manually, and the directories containing the JDK's programs were not on root's PATH. That's why sudo make install failed, when it ...
1
vote
Accepted
Pset3 (breakout) -- problems initiating score label
You haven't set the location where the label is supposed to appear in initScoreboard. Do it like that:
setLocation(label, x, y);
1
vote
Why is SPL library not be linked
Do you have the following in your file?
#include <spl/gevents.h>
#include <spl/gobjects.h>
#include <spl/gwindow.h>
and are those files in the correct directory, /usr/include/spl ?
1
vote
Can't run Breakout outside of appliance
You need to recompile the c source in order to get a binary file that the Debian system can execute. However, even if you compile for your Debian system, you will run into some more problems. The SPL ...
1
vote
Accepted
Can't run Breakout outside of appliance
As Kareem said in his comment, you need to recompile your code in the Debian environment in order to run it in that environment.
When you compile C source code, the compiler translates it into the ...
1
vote
Accepted
(pset3) breakout initBrick issue
x_coord is incrementing by 10 each time, yet your brick width is set to 30. Looks like you might have mixed your x's and y's up!
x_coord = x_coord + 10;
Instead of 10, you will need to increment by ...
1
vote
Accepted
Fatal error "spl/gwindow.h"
This is because you are trying to compile the 2015 version of breakout with the 2014 version of the appliance.
The best thing you can do is install the new appliance and then the files in src4m/ ...
1
vote
How to install and compile the Stanford Portable Library on windows?
If you want to find a easier way, go for a compiler like devcpp which also compiles C code.
Since the souce for SPL is available in the comments already shared above, you can compile them and get a ...
1
vote
Accepted
correct use of getColor from SPL/gobjects.h
It's a bug in the SPL library. getColor() doesn't actually work.
1
vote
Program failing to compile. Please see code below. Not a p-set problem
Even I have faced the same problem.
You cannot use the default Make command to compile programs which use the Stanford Portable Library.
The default Make command doesn't link this library.
That is ...
1
vote
What's causing the "'spl/gevents.h' file not found" error when compiling `breakout`?
The 2015 breakout problem set was modified slightly from last year. You are using Appliance 19 from 2014, but you seem to be following the 2015 problem set specification judging by your include ...
1
vote
Accepted
Week 5 Walkthroughs
Place the file named spl.jar (from pset4 files) in the same directory as your executable!
1
vote
Compilation error when using #include "gwindow"
It's
#include "gwindow.h"
NOT
#include gwindow
UPDATE:
two main solutions
copy the Makefile of breakout to the directory where your source code file is, open it, alternate every "breakout" with ...
1
vote
Accepted
Stanford library is missing GRectangle and getBounds
The provided version of the Stanford Portable Library does provide GRectangle. Your code just needs to include the correct .h file in order to be able to use it. In this case, the file you need is ...
1
vote
Running breakout on Mac OS X
This is what i did to get this working on osx el capitan. (I already have a working cs50 library installed)
you will need to install git first https://git-scm.com/
open a terminal and clone the spl ...
1
vote
Accepted
Running breakout on Mac OS X
Does this work??
https://www.dropbox.com/s/8g3uo5biu2g4x7r/libcs.a
[30 char limit blahhhh]
Only top scored, non community-wiki answers of a minimum length are eligible