Questions tagged [clang]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
1answer
27 views

clang-7: error: linker command failed with exit code 1 (use -v to see invocation

I just watched the C lecture the other day, and tried making my first program in the online developer environment (CS50 IDE). Just like the lecture, I am trying to use the compiler command to turn my &...
1
vote
1answer
16 views

CS50.h library in ubuntu

every time i create program i have to write "clang prog.c -o prog lcs50" link with cs50 but when I try "make prog" it prints following error: /usr/bin/ld: /tmp/cc8noHLN.o: in ...
0
votes
1answer
51 views

clang issue keeps saying error

I'm doing the hello project for week one and I can't get pass the clang issue. I keep putting clang and it keeps saying error" no such file or directory. but the hello.c file is literally in the ...
1
vote
1answer
21 views

Cant get past the ls command in hello.c

I cant get past the List command in hello.c, and i'm not sure if i'm supposed to get something in the terminal after i type in ls, so i kept going and typed clang and i get the error message. I've ...
0
votes
1answer
48 views

Says that ./hello is a directory and error code when say clang -0 hello hello.c

I was following the directions from the website and was putting clang -0 hello hello.c I got an error code. I'm not sure if this means anything but when I put ls it says a.out* hello/ and hello.c. ...
0
votes
2answers
84 views

Problem Set 1 help, clang hello.c, and ls (list)

When I follow the directions from Problem Set 1 on the website, I get an error code when I type in clang hello.c and when i type in ls the list doesn't show up. Before I made the new file so I could ...
0
votes
1answer
266 views

clang- error: linker command failed with exit code 1

I use the CS50 online IDE and I have the following error: ex1.c:(.text+0x1b): undefined reference to `get_int' clang-7: error: linker command failed with exit code 1 (use -v to see invocation) Code #...
0
votes
1answer
26 views

Problems executing make clang-7 error cs50

Hi, do you know how to solve this error? Thanks!!
0
votes
1answer
19 views

CS50 2018 Lecture 1C. Unable to figure out syntax error in code

My code : #include <stdio.h> #include <cs50.h> int get_positive_int(string prompt); int main(void) { int i = get_positive_int("Positive interegr: "); printf("%i\n", i); } int ...
0
votes
1answer
29 views

In pset2, Vigenere, I made and used an array that I would like for it to be explained

I’ve successfully solved Caesar and Vigenere pset but made and used an array that I stumbled upon through trial and error but don’t exactly know why and how it worked. I’m hoping someone could clarify ...
0
votes
1answer
83 views

recover.c:43:34: error: use of undeclared identifier 'out' fwrite(temp, 1, 512, out);: WHAT?

When I compile my program, clang is probably not working. I get this when I compile: ~/pset3/recover/ $ make recover clang -fsanitize=signed-integer-overflow -fsanitize=undefined -ggdb3 -O0 -std=c11 -...
0
votes
1answer
79 views

pset1, Cash, having problem in a single test case 4.2 [duplicate]

I was writing a code to calculate the minimum no. of coins required to return the change mentioned by the user. my code works on all test cases but returns 418 when i enter 4.20. this is the only ...
0
votes
1answer
30 views

error to run all my programs

Hy, I´m new in programming and sice today I was getting to run, test and submitted my programs. But now, every time I try to run then I have the same problem, for example: ~/workspace/pset1/cash/ $ ...
0
votes
1answer
561 views

bash: clang: command not found

When I type 'clang hello.c' in the terminal, i get the following message after pressing enter: 'bash: clang: command not found', how do I get rid of it? Also, program runs fine and does print 'Hello ...
1
vote
1answer
2k views

Crack - launching and crypt function

I'm on the crack challenge from pset2 and I don't understand how to compile the program. When I use clang -ggdb3 -O0 -std=c11 -Wall -Werror -Wshadow crack.c -lcrypt -lcs50 -lm -o crack as ...
3
votes
1answer
582 views

Week 1 compiling String.c using clang instead of make

in week 1 as I understood : make= compile the file and name the compiled file with the same name. clang= compile the file with the default name. when I've used make it worked and when I used clang it ...
0
votes
2answers
1k views

C++ at CS50 ide

While trying to compile c++ files at CS50 ide it seemed to be not supported by clang .. is there a specific way to fix that or it's not supported at all ? Thanks in advance
0
votes
1answer
118 views

Clang error with compiling code

I am working on the load function of pset 5 speller. My code, however, displays an error message when compliling, that basically looks like this: (.text+0x20): undefined reference to `main' ...
0
votes
2answers
169 views

Pset5 speller - load clang error (linker command error) and multiple definition

I typed make speller and clang produces the output below. I'm really not sure how to resolve this. I thought that it might be saying that I defined the hash function twice but I don't think I have. ...
0
votes
1answer
893 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
2answers
158 views

pset 1, clang error in make hello

I made a file called hello.c and typed in the code exactly as required for pset1 but when I type in make hello in the terminal I receive the following text: clang -fsanitize=integer -fsanitize=...
0
votes
1answer
52 views

Setting up clang on ubuntu pc

I am using CS50 appliance to do psets but since I have a laptop with ubuntu on it, I would like to set up a similar environment to the cs50 in my laptop, starting with clang, and the C libraries that ...
0
votes
1answer
45 views

Pset 4-resize.c problem with clang

I have been trying to solve an issue I'm having, when I try to compile my resize program, but I get the same error again and again and I can't really understand what's going on. In the screenshot you ...
0
votes
0answers
161 views

I have a error during compilation of pset1 water.c

Any idea why this error is showing clang -ggdb3 -O0 -std=c11 -Wall -Werror -Wshadow water.c -lcs50 -lm -o water
0
votes
2answers
2k views

No such file or directory, pset1

I have exercise 1 of pset1 ready to go. However, I seem unable to compile the program. I follow the below steps (in fact, I deleted everything and created it from scratch): Create New Folder, name it ...
0
votes
1answer
103 views

control may reach end of non-void function… but not really

I have an error message from the compiler that many others have reported, but I know why I got it and how to fix it. I'm posting this question because I think the error message is wrong and I'm hoping ...
0
votes
1answer
123 views

Clang error while compiling find

so I finished my find.c but when I run make find or make all I get the error "clang: error: cannot specify -o when generating multiple output files". What can I do?
0
votes
1answer
25 views

what is the funny symbol printed when char[] uninitialized

char name[20]; strcpy(name,"incredible hulk"); printf("%s\n",name); I get this funny symbol What does that represent?
0
votes
0answers
22 views

why can't i get clang to work for me [duplicate]

#include <cs50.h> #include <stdio.h> int main(void) { printf("Please give me an int: "); int x = GetInt(); printf("please give me another int: "); int y = GetInt(); printf("The sum of %...
1
vote
1answer
677 views

cc or clang and GNU make utility

while configuring my own system (Debian) to behaves like cs50-appliance I did realize that there is a variable, CC, that I had have to change its value to "clang". And looks like, by default, Debian ...
0
votes
1answer
267 views

The compiler Clang isn't showing

The compiler Clang isn't showing and I'm at a complete lost of why it isn't. Please help me. bash: clang: command not found cs50
0
votes
1answer
274 views

Makefile config

As we know.. in the appliance when we use the command.. . make [file-name] .. It automatically complied with some flag....-ggdb -O0 -std=c99 -Wall - Werror But I need to know in which directory the ...
0
votes
1answer
211 views

automatically link cs50 when using make? - not using appliance

On Ubuntu 14.10, how to automatically link cs50.h when using make, without needing to link it manually like with GCC. I need to make cs50 link automatically when I call make on my c file. When I use ...
0
votes
1answer
269 views

pset3 command line error make/clang

clang testing.c -lcs50 -o testing /tmp/testing-6c5209.o: In function `main': testing.c:(.text+0x3f): undefined reference to `sort' clang: error: linker command failed with exit code 1 (use -v to see ...
2
votes
1answer
892 views

C Preprocessor Output: What is <built-in>

I wrote one of the most simple programs I could imagine: int main (void) { int a; } As you can see, there are no include files. The purpose is to understand a little bit more about the ...
0
votes
3answers
703 views

Problem with cs50.h header file!

In pset1 for the mario program,when I compile my code including cs50.h header file in my code it throws up the following error However,when I don't include the cs50.h file and use scanf function ...
0
votes
0answers
1k views

What does clang's “undefined reference” error mean?

What do the following compilation errors mean and how can I fix them? jharvard@appliance (~/Dropbox/pset3/find): make helpers clang -ggdb3 -O0 -std=c99 -Wall -Werror helpers.c -lcs50 -lm -o ...
1
vote
1answer
148 views

What does flag -o stands for in clang?

The purpose of -o is to specify the name of the program produced by clang. But what does it stands for?
0
votes
0answers
614 views

“linker command failed with exit code 1” and other errors when using make

I get multiple errors when I try to compile speller.c from pset6. I've tried switching to -std=gnu89 and I get the same thing. What is going on? jharvard@appliance (~/Dropbox/pset6): make clang -...
0
votes
1answer
584 views

Nothing to be done for `adder'

When I try to compile the adder program from the week1 walkthrough, I get an error saying make: Nothing to be done for 'adder'" I have checked that I am in the right directory, and have included &...
0
votes
1answer
819 views

what does '-Wall' flag in the clang mean?

I am reading a Makefile of one c file. clang -ggdb -std=c99 -Wall -Werror -o generate generate.c I am unable to understand what -Wall flag in the above line means?
1
vote
2answers
122 views

Why “make” doesn't throw error when I include some libraries like “string.h”?

Why doesn't make throw an error when I include some libraries like string.h? make uses options such as -lcs50 and -lm to link the object files for header file cs50.h and math.h. For example, the ...
1
vote
1answer
3k views

What do these Check50 errors mean?

I get many compilation errors when I compile greedy.c. However, my mario.c and greedy.c programs with 2 and 3 residual appear to pass check50 tests! jharvard@appliance (~/Dropbox/pset1): check50 ...
1
vote
2answers
2k views

What does -std=c99 command do?

When I run make, I see a lots of clang commands. I know the meaning of all of them except -std=c99. So, what does this command do?