Questions tagged [clang]
The clang tag has no usage guidance.
47 questions
0
votes
2
answers
399
views
cs50 error - Linker command failed with Exit code 1
I've been trying to do one of the sample programs in lecture 1 and keep being prompted with the same error. However, when running a simple "Hello, world" program it executes fine. I've ...
0
votes
0
answers
38
views
My codespace updated, now I cant compile my mario.c program to continue where I left off. Details below. Any help appreciated
I was away for a month and just opened up my codespace to finish my mario.c problem set.
I had got the columns printing etc but still lots to do.
I had to update my codespace, and "rebuild"
...
0
votes
1
answer
90
views
Clang external library (libcs50) linker error "C"
I don't access to 4g internet connection, so I installed cs50 library on my lubuntu for offline use, I put the cs50.h file in /usr/local/inlcude and the libcs50.a file in /usr/local/lib. Now when i ...
2
votes
1
answer
379
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
1
answer
84
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
1
answer
340
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
1
answer
130
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
1
answer
1k
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
2
answers
1k
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
1
answer
3k
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
1
answer
48
views
Problems executing make clang-7 error cs50
Hi, do you know how to solve this error? Thanks!!
0
votes
1
answer
65
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
1
answer
43
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
1
answer
267
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
1
answer
114
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
1
answer
40
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
1
answer
897
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 ...
2
votes
1
answer
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
1
answer
902
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
2
answers
3k
views
C++ in the CS50 IDE
While trying to compile C++ files in the CS50 IDE, it seemed to be not supported by clang. Is there a specific way to fix that or is it not supported at all?
0
votes
1
answer
162
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
2
answers
232
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
1
answer
1k
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
2
answers
235
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
1
answer
68
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
1
answer
50
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
0
answers
164
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
2
answers
6k
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
1
answer
118
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
1
answer
127
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
1
answer
30
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
0
answers
23
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
1
answer
940
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
1
answer
327
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
1
answer
428
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
1
answer
348
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
1
answer
279
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
1
answer
1k
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
3
answers
964
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
0
answers
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
1
answer
306
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
0
answers
739
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
1
answer
607
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
1
answer
2k
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
2
answers
134
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
1
answer
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 ...
2
votes
2
answers
7k
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?