Questions tagged [compilation-error]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
-1
votes
1answer
21 views

Do I need to install any compiler for compiling a C program in cs50 sandbox? If not then why am I not being able to compile my program?

I am new to programming and has basicly started with c program but after i write a code and try to compile it by,"make untitled1" I get an error message.
0
votes
1answer
36 views

PSET5 Compiling issue

So I finally finished my code and received 20 errors when attempting to compile, after my first attempt fixing the errors I tried again and received 15 errors, once more and received 17, and now am ...
0
votes
1answer
28 views

Readability compiling issue

Readability (Problem Set 2) #include <stdio.h> #include <cs50.h> #include <string.h> #include <ctype.h> #include <math.h> // Letters detects letters // Words detects ...
0
votes
0answers
16 views

Final Project C Makefile

For my final project for CS50, I'm designing a command-line C program but I'm having issues with compiling the program to test before submitting. I'm using three separate c files to store all my code (...
0
votes
1answer
24 views

Expected expression on “valid triangle” exercise? i thought the 'or' symbol was 2 lines ( || ) what have i done wrong here?

#include <stdio.h> #include <cs50.h> #include <string.h> #include <ctype.h> #include <math.h> // PROTOTYPE THE FUNCTON bool valid_triangle(float input1, float input2, ...
0
votes
2answers
26 views

Can anyone tell me what ive done wrong and breakdown how to properly prototype and deploy created functions?

code: #include <stdio.h> #include <cs50.h> #include <string.h> #include <ctype.h> #include <math.h> // PROTOTYPE THE FUNCTONS & DECLARE VARIABLES int multiply(int ,...
0
votes
1answer
40 views

initializer element is not a compile-time constant and expected identifier or '(' errors

I used the CS50 IDE for C on cloud9. When I run the program I get the errors 3:8: warning: **implicit declaration of function 'GetInt' is invalid in C99 [-Wimplicit-function-declaration] int x= ...
0
votes
2answers
192 views

Pset 4 filter: reflect help

I have been stuck on pset4 for a while and when I try to compile my code I now get 3 errors in the reflect function which are: helpers.c:83:6: error: conflicting types for 'swap' void swap(int *a,...
0
votes
3answers
929 views

pset 3 plurality code help

My code prints all names in the case of a two way/threeway tie, but for some reason I still get an error message in check50 that it does not. The only thing I could think of was maybe it had to do ...
1
vote
3answers
144 views

Can't compile readability in cs50 IDE

I'm trying to do the readability exercise for week 2 in the cs50 IDE and am unable to compile my program. I followed the steps below exactly, but am getting the error message depicted below the steps ...
0
votes
1answer
31 views

scores2 keep giving error even after copying the code verbatim from CS50 2018

I am a beginner in CS50 2018. I was following the 2018 YouTube lecture 2 - Arrays and wrote the codes in CS50 sandbox as the lecture was proceeding. However, I am getting errors even after writing the ...
0
votes
1answer
142 views

Cannot Compile Due to Error in cs50.h

I recently migrated my old Cloud9 IDE over to the new AWS format per instructions and all of my files appeared in the new environment. I had only just completed lecture 1 and was starting to make the ...
0
votes
1answer
157 views

PSET2 Vigenere: Control may reach end of non-void function error

I wrote a function to return the shift value for a certain character inputted. Where A, a = 0, B,b =1, etc. int shift(char c) { int asc; if (isupper(c)) { asc = atoi(&c) - 65;...
0
votes
1answer
2k views

When compiling I get an error: note: expanded from macro 'get_float'

When I try to compile with make file, I get the following error /usr/local/include/cs50.h:177:91: note: expanded from macro 'get_float' #define get_float(...) __extension__ IF_ELSE(ISEMPTY(...
0
votes
1answer
253 views

Compilation error in hello.c: undefined reference to `get_string'

I'm getting the following error after running make hello. I downloaded the latest version of libcs50from the GitHub releases page and installed using sudo make install. I'm running the program on ...
0
votes
2answers
78 views

Keep getting this compile-time message: error: unused parameter 'argv' [-Werror,-Wunused-parameter]

I'm working on pset2 from cs50 and am down to the last bug which I can't seem to wrap my head around. When I read my code, I AM using the parameter argv in line 3. Why the error message? int main(int ...
0
votes
1answer
95 views

pset5 speller dictionary errors

Can someone give me feedback on my code please? I can't compile this, and it says too many errors. A lot of the errors don't seem to make sense. For example, it says "error: use of undeclared ...
0
votes
1answer
26 views

speller make error #endif without #if

When I try to 'make' speller, I get this error message: ./dictionary.h:17:2: error: #endif without #if How can this be, when we were given the dictionary.h file? I haven't changed anything there. The ...
0
votes
1answer
236 views

error: linker command failed with exit code 1

While compiling speller using make command the following shows up: /usr/bin/ld: cannot find -lstdbool /usr/bin/ld: cannot find -ldictionary /usr/bin/ld: cannot find -lctype /usr/bin/ld: cannot find -...
0
votes
1answer
110 views

Pset3 - Music: Unused parameters and control reaches end of non-void function errors

I have tried and googled everything, but I cannot seem to fix these mysterious errors. Within my helpers.c file, it is saying that I haven't used any of the parameters although I've used all of them. ...
0
votes
1answer
74 views

PS3's Fifteen won't compile only during check50?

I have created my solution for pset3's problem "Fifteen". It compiles fine with the standard makefile in cs50's on-line terminal window, and runs correctly as well (also tested with the given 3x3 and ...
0
votes
1answer
394 views

CS50 pset 4 recover.c timed out while waiting for program to exit

#include <stdio.h> #include <stdlib.h> #include <stdint.h> #include <string.h> typedef uint8_t BYTE; int main(int argc , char* argv[]){ //checking number of arguments ...
0
votes
1answer
549 views

Problem with “expression result unused error” in for-loop?

I am getting an error message of "expression result unused" for the bottom two for loops (specifically h + 1 and s - 1). I've tried looking for through the other questions for an answer but nothing ...
0
votes
1answer
103 views

pset5 load function has “expression result unused” errors

I think this relates to my understanding (or lack of) of pointers. I have 3 errors for the following code -- this is just inside my while statement. Both root and current are defined as nodes and ...
0
votes
1answer
15 views

Pset2: Code not compiling for Initials

I wrote code for Initials, but when I put the command to make initials.c in the window, it gives me the message : make: *** No rule to make target `initials.c'. Stop. I tried compiling the programs ...
0
votes
1answer
73 views

strange error message when compiling helpers.c

I am very new to programming. When I try and compile helpers.c using the command "make helpers" I get the following error messages: /usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(....
0
votes
1answer
914 views

compiling clang string.c says relocation 0 has invalid symbol index 11

When i try to compile string.c file whose code is given below it say relocation 0 has invalid symbol index 11 ... and this happens on and on.. my code is : - #include <cs50.h> #include <...
1
vote
1answer
67 views

Error in Caesar , can't fix . Need help

#include <stdio.h> #include <cs50.h> #include <string.h> #include <ctype.h> #include <stdlib.h> int main(int argc, string argv[]) { if (argc == 2) ...
0
votes
1answer
67 views

What does “using” a variable entail and why does this inconsistency come up? (pset1, greedy, general question)

During the greedy problem in pset1 I wrote this function: void greedy(int coin_type, int *change, int *coins) { while (*change / coin_type > 0) { *coins++; *change -= coin_type;...
0
votes
1answer
401 views

pset1 - Greedy Errors “error: expected expression”

Please help! I cant solve some errors (from: [http://docs.cs50.net/problems/greedy/greedy.html][1]) running this code: int main(void) { float change = 0; int coin_used = 0; int change2 = ...
0
votes
1answer
45 views

CODE ON http://cdn.cs50.net/2015/fall/lectures/1/w/src1w/thadgavin.c NOT WORKING [duplicate]

ERROR MESSAGE FOR CODE// URL/// http://cdn.cs50.net/2015/fall/lectures/1/w/src1w/thadgavin.c clang -ggdb3 -O0 -std=c11 -Wall -Werror -Wshadow coolcode.c -lcs50 -lm -o coolcode /usr/bin/ld: /...
0
votes
2answers
5k views

Subscripted value is not an array

I am using exactly the same code as at HowStuffWorks to create a bubbling sorting. But I cannot compile code as I get the following error message: sorting.c:29:22: error: subscripted value is not an ...
0
votes
1answer
667 views

Pset3- Find: “control may reach end of non-void function” (error)

I know that this question has been asked before, but none of the answers have helped me. I keep getting the "control may reach end of non-void function" error when I try to make find after editing ...
1
vote
2answers
128 views

PSET6 server: Make server error - Please please help =(

I was almost finished debugging server.c (the only thing that didn't work was that I was getting a 404 error when submitting my query on hello.html) by using gdb. When I thought I'd noticed what the ...
0
votes
1answer
6k views

How to fix the `unused variable` error?

I understand how to extract the query from request line, but when I make the program, it gives me the error unused variable query although it's used later in the code. I don't know what's wrong. here ...
1
vote
1answer
163 views

pset3 - recursive binary search not compiling

I wrote a recursive function for binary search in pset" and I keep getting the same error from clang: "control may reach end on non-void function" it is driving me crazy... some help would be very ...
0
votes
1answer
634 views

How to fix the “undefined references to GetString” error?

I can't get the GetString() function from the cs50 library to work. I have tried update50 and have rebooted several times and it is still throwing out this error: jharvard@appliance (~/Dropbox): ...
0
votes
1answer
197 views

“Control may reach end of non-void function” but I'm sure my else statements take care of it? [duplicate]

I know this has been asked many times before, but I looked through all the questions and still don't get it. I know what the error means, I'm just convinced that my code ensures that whatever happens,...
0
votes
0answers
1k views

how to fix the “expected identifier of '('” error?

what does this error mean? expected identifier or '(' { ^
0
votes
1answer
263 views

compilation error multi-character character constant in caesar

The code is: string plaintext = GetString(); for (int i = 0, n = strlen(plaintext); i < n; i++) { printf("%c", plaintext[i]); if ((isalpha(plaintext[i])) && (isupper(...
0
votes
2answers
1k views

why do I get “error: expected expression” when I try to compile my binary search implementation?

Having some trouble figuring out this error message as I write the Binary Search function. Any advice greatly appreciated! bool binarySearch(int key, int array[], int min, int max); bool search(int ...
0
votes
0answers
26 views

Am I using the “return” statement incorrectly?

I am getting this error message while trying to compile: "error: expected identifier or '('" "return (int)" ^ My code preceding the "return (int)" is a do ...while loop that sets int as n and uses "n ...
0
votes
1answer
2k views

How to fix the “expression result unused” compilation error?

When I try to run this code through the compiler, I get the error: expression result unused referring to the line cents - 25; How do I fix this error? How exactly do I "use" the expression ...
0
votes
1answer
1k views

Error: control may reach end of non-void function [duplicate]

I am currently working on pset3/search and when I try to compile the codes it keeps telling me that ^ error. I know that it is because I must not be returning a boolean value as needed, but I do not ...
2
votes
2answers
354 views

why can't I compile the program that I wrote to test helpers.c?

I've made a program to test my sort function. The only problem is that when I try to compile it gives me the "undefined reference to 'sort'" error as seen in the below: For context, I have taken the ...
0
votes
2answers
580 views

pset1 "expected identifier error in do-while loop

I have been struggling with this for weeks now, have done several searches and posts and can not seem to get around this. I have tried everything and it just makes it worse. I wish there was a video ...
0
votes
0answers
135 views

I can't compile my code for pset 1 and I don't know why

I don't know what the problem is, it says the error was the lack of an "expected identifier or '('"
0
votes
0answers
280 views

week 4 | walkthroughs | button | compiler error “use of undeclared identifier 'GButton'”

make button » error: use of undeclared identifier 'GButton' jharvard@appliance (~/Dropbox/pset3): make button clang -ggdb3 -O0 -std=c99 -Wall -Werror button.c -lcs50 -lm -o button button.c:12:5: ...
2
votes
1answer
3k views

pset2 vigenere error “incompatible integer to pointer conversion”

This is the error I get: vigenere.c:34:34: error: incompatible integer to pointer conversion passing 'char' to parameter of type 'const char *'; take the address with & [-Werror,-Wint-...
0
votes
1answer
29k views

Why do I get an “undefined identifier” error even though the variable is defined in my code?

I've been trying to get the Mario problem finished. What appears to me to be a workable solution keeps generating error messages (when I run the compiler) around an "undeclared identifier" (even ...