Questions tagged [spl]

This tag refers to the Stanford Portable Library - not to be confused with other libraries that have the same initials.

Filter by
Sorted by
Tagged with
0
votes
1answer
282 views

How to install SPL libraries on ubuntu?

I was following instructions here https://github.com/cs50/spl apt-get install -y build-essential git openjdk-7-jdk git clone git@github.com:cs50/spl.git cd spl make sudo make install make gcc -o ...
1
vote
1answer
117 views

SPL question, how to use it in CS50 IDE?

First, this question has nothing to do with any current CS50 problem sets...but its related. Thanks for reading it. I started CS50 online in 2015, with the appliance. After the breakout problem set,...
0
votes
0answers
31 views

SPL issue. Not rendering [correctly]

I experience some troubles using SPL. I am running Windows 7 Ultimate, I am following CS50 via edx.org. When installing the appliance I followed the instructions for 2014 version(where SPL is pre-...
1
vote
1answer
84 views

What fonts are available using Stanford Portable Library?

Specifically for GLabels. I would just like to rub it in with some dark, bold text if the player loses. On the other hand, something celebratory would be in order for breaking out all bricks, right?
0
votes
1answer
45 views

GetWidth error CS 50 breakout

How do I fix this problem? breakout.c:109:26: error: expected expression if (getX(ball) + getWidth() >= getWidth(window)) ^ /usr/include/spl/generic.h:44:49: note: ...
0
votes
2answers
432 views

Pset3 (breakout) — problems initiating score label

Below is the code I'm using to initiate the label showing the score. Unfortunately, the label doesn't appear on the screen, and I'm clueless as to why that is the case. I'd very much appreciate any ...
-1
votes
1answer
41 views

How do I get spl in usr folder to get my window.c program to work?

I can't figure out how to get spl into usr folder to get my spl to link and display I wrote my own code in Makefile directory but it comes back with error here is the code I wrote: window2: window2....
0
votes
1answer
90 views

Why is SPL library not be linked

I am trying to run the window.c file I unzipped from src5m. It runs fine but when I copy and paste the code in a new gedit console and try to make it gives me this error message: window2.c:1:10: ...
1
vote
0answers
97 views

Cannot find lcs : Error when compiling window.c in breakout

I am having issue on using spl library in ubuntu. When I try to compile window.c using make as given in the instructions I am always getting the same error(in pic) even though the spl/include folder ...
1
vote
1answer
198 views

How come we can use objects in a structured programming language like C?

I noticed that data types like GWindow, GOval, etc. are actually classes and we are declaring objects using those eg. GWindow window; and GOval circle;. Here window and circle are objects right? How ...
0
votes
1answer
112 views

why doesn't getColor work?

I have almost all of my PSET3 breakout program complete. I want to add different point values based on the color of the bricks. I have each row colored differently and now when trying to determine ...
0
votes
1answer
205 views

(pset3) breakout initBrick issue

I'm currently trying to instantiate 1 row of bricks before moving on to 5. Before implementing the for loop I made sure I could instantiate 1 brick on the screen, exactly where i want it. No problem ...
2
votes
0answers
56 views

Why am I getting linking errors when trying to make a program that uses the SPL? [duplicate]

Why is it, whenever he uses "make" to generate the program, it works flawlessly; but when I do the same, I always receive linking errors? make text clang -ggdb3 -O0 -std=c99 -Wall -Werror text.c -...
1
vote
1answer
113 views

Why does setLabel() freeze the program randomly?

I have a decent implementation of the Breakout program that normally runs perfectly all the way through. I have noticed, however, that occasionally the program will freeze. After a joint effort of ...
0
votes
0answers
86 views

Cannot access SPL include files

My appliance cannot access the SPL library. I have executed update50 but no "/usr/include/spl" directory exists on my appliance. Is there something else I need to do to access the SPL library?
0
votes
1answer
461 views

pset3 - Error: Could not find or load main class stanford.spl.JavaBackEnd

Before you shout at me, I know this is a duplicate (Why do I get Error: Could not find or load main class stanford.spl.JavaBackEnd?) but that article did not help solve my problem. I ran sudo chown ...
1
vote
2answers
1k views

Fatal error “spl/gwindow.h”

I followed the instructions in pset3 but received a fatal error shown below. It was stated that the spl is stored somewhere in the new version of appliance which I think I have. I tried replacing ...
0
votes
3answers
1k views

How to install SPL libraries in ubuntu?

I tried https://github.com/cs50/spl Even got little success, but it's not working properly and keeps throwing me this error... /** * bounce.c * * David J. Malan * malan@harvard.edu * * ...
5
votes
1answer
2k views

How to install and compile the Stanford Portable Library on windows?

Self-explonatory title, I can't install the appliance for some reasons - Google just left me pretty confused - I would like to use the Stanford Portable Libray in a windows enviroment. I am using ...
0
votes
1answer
150 views

correct use of getColor from SPL/gobjects.h

To get myself started with Breakout I've been trying to create a simple program that, upon the click of a button, will change the color of a filled circle from black to yellow, and vice versa. My ...
1
vote
1answer
530 views

Program failing to compile. Please see code below. Not a p-set problem [duplicate]

I have spent days trying to understand what went wrong, but there is no answer to this on Stack Exchange or the web. The problem below comes from the first video walk-through in week 4 of CS50x, from ...
0
votes
1answer
152 views

Error while executing `./window` from problem set 3: `java.awt.HeadlessException` [duplicate]

I tried to execute ./window in the /Dropbox/src4m directory and encountered the following error message: jharvard@appliance (~/Dropbox/src4m): make window clang -ggdb3 -O0 -std=c99 -Wall -Werror -o ...
0
votes
1answer
687 views

What's causing the “'spl/gevents.h' file not found” error when compiling `breakout`?

After executing the command make breakout I'm getting this error: breakout.c:16:10: fatal error: 'spl/gevents.h' file not found #include <spl/gevents.h> I'm using Appliance version 19.
0
votes
0answers
66 views

Couldn't exec spl.jar

This is the problem i cant execute the spl.jar file i already tried installing java jdk but it yet didn't work.
1
vote
1answer
461 views

Why do my SPL example programs fail to compile?

When I rewrite pset3's programs associated with Stanford Portable Library (SPL) on my own, they always fail to compile even though I write them out exactly the same as the original program. For ...
1
vote
0answers
46 views

Why redefining `bool` primitives in 'SPL' as a typedef (rather than using stdbool.h)?

While reading through files included in /spl library (Stanford Portable Code), downloaded with pset4.zip distro, I came across this definitions in cslib.h: /* * Type: bool * ---------- * This type ...
0
votes
0answers
67 views

Play sounds using the SPL

I would like to include sounds in the game Breakout. I tried a simple test to get a sound file to play with the following code: ... #include "sound.h" int main(void) { Sound paddle_sound = ...
0
votes
0answers
879 views

Breakout: Missing spl folder

Problem Set 3: https://d2o9nyf4hwsci4.cloudfront.net/2014/fall/psets/3/pset3/pset3.html (Section "Breaking Out", after "Backstory") Hello. I tried to do make window (for window.c) on the terminal and ...
0
votes
1answer
161 views

error could not exec spl.jar

When I run ./windows I get "error could not exec spl.jar". What to do about it? In 19 version of appliance this worked now it is not working (2014). I have googled but couldn't come across answer. It ...
0
votes
1answer
151 views

Week 5 Walkthroughs

I am trying to get Button.c to work, which is the first of the Walkthroughs from Week 5. I transferred the spl folder to my current directory, altered the Makefile from Breakout so it is working on ...
0
votes
1answer
449 views

Compilation error when using #include “gwindow”

When compiling a game program I keep getting an "unable to find" error directed to the Stanford Portable Library (#include gwindow). I have tried unzipping all files in pset4, searched Google and ...
0
votes
0answers
1k views

How do I link the Stanford Portable Library (SPL) to a program?

I was on the walkthroughs of week 5 and I wanted to do the programs mentioned for practice with GButton, GCheckbox and so on. On the header files there is the #include gevents.h gobjects.h and so on, ...
2
votes
1answer
84 views

Stanford library is missing GRectangle and getBounds

I'm doing pset4 which uses the Stanford Portable Library. David mentioned the documentation is buggy but it appears wrong in some parts. In particular there is a type GRectangle and the method ...
4
votes
4answers
1k views

Running breakout on Mac OS X

There's a similar question about running breakout on Linux variants: Can't run Breakout outside of appliance My question is specifically about compiling breakout (and hence SPL) on Mac OS X. So ...
1
vote
2answers
674 views

Can't run Breakout outside of appliance

I have just finished implementing Breakout, and tried running it outside of the appliance in my Debian machine, but i get the following error, even though it's the same directory that's shared between ...
1
vote
2answers
342 views

PSET 4(breakout) : Paddle goes out of window

When i try code for moving paddle setting location x = getX(event) -getWidth(paddle)/2; but with this a part of my paddle goes out of window. What should i do ?