Questions tagged [compiler]

The tag has no usage guidance.

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

make: Nothing to be done for `caesar'

a quick look around shows that my error is usually related to someone attempting to compile a .c file but that is not my case here. I cant run make caesar on my program and I dont know why. [EDIT: ...
0
votes
1answer
43 views

Why C doesn't check for memory leaks automatically?

If there is a tool like valgrind which allows to prevent memory leaks in a program, why the compiler doesn't use it and gives you the appropriate warnings? It would be too slow?
0
votes
1answer
105 views

Declaring an Array - CS50 IDE

When I use a different compiler (i.e. Visual Studio), I can't declare an Array without a constant argument. I know that when declaring an Array without a constant, I must use a pointer. On the other ...
0
votes
1answer
110 views

Fatal error: <cs50.h> file not included

I'm at pset3 and this error has never happened to me and it's pretty strange to me. When I 'make' the file in my IDE, I get no errors whatsoever and my program runs smoothly. However, when I upload ...
0
votes
2answers
72 views

Why do we not have to link stdio?

In the video of compiler, we have to link the math library with hello.o with with the -lm flag. Why don't we have to link stdio library with hello.o?
0
votes
1answer
53 views

For week 4 walkthrough unused variable even though I typed the same code as David

I type the same code as David, yet I get an unused window error and he doesn't. My code follows, and you can just as easily compare with his. #include <spl/gevents.h> #include <spl/gwindow....
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
0answers
279 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: ...
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
2answers
78 views

why always link library at the end of commands?

for this: Clang -ggdb -Wall -Werror hello.c -lcs50 -o hello if the library (such as cs50 library) is loaded and processed before source code ,then it's as if I didn't write the -lcs50 at all so ...
1
vote
1answer
1k views

Why do I not have to link stdio.h while compiling with clang?

To compile this source code with clang, we had to link "cs50" library like this: clang hello.c -lcs50 but we did not have to link "stdio". why? /* hello.c */ #include <stdio.h> #include <...
-1
votes
3answers
576 views

I'm not going to use the appliance, what software should I install?

My HDD space Is tiny and the ram Is very slow, so what are the software to install to compensate for the appliance?
0
votes
1answer
508 views

“make” not working (“undefined reference to GetString”)

I'm testing out a basic program called getname that prompts the user for their name to store it in a string variable. However make doesn't seem to work. This is make's output: jharvard@ubuntu:~$ ...
0
votes
2answers
251 views

Test program compiles with <math.h>, speller.c shows error

I've edited the pset6 Makefile to include all headers, and was careful not to edit any spaces or tabs. When I try to compile speller, I get the following error: make: *** No rule to make target `math....
0
votes
1answer
47 views

Trying to compile f2c.c from walkthrough week1 without success [duplicate]

I'm trying to compile the programming from the walkthrough week1 f2c but it doesn't work. I don't know what I'm doing wrong. When I type in "make f2c" it returns *** No rule to make target `f2c'. ...
1
vote
2answers
383 views

Code in “Compilers” video shows several ^@^@^@ lines as an example of machine code. Shouldn't it be binary code?

On week 1 short video "Compilers reources", at 5'06'' they show the "assembled file" (machine code the assembler produces from the assembly code). Screenshot: We've been taught that machine code is ...
2
votes
1answer
635 views

How does the Makefile from pset 6 work?

Could someone help provide clarity in the matter of the Makefile used for pset 6? I understand everything up to line 32, that is where it gets confusing. Here the dependencies for the program $(EXE) ...
-8
votes
2answers
786 views

mario8.c Clang compiling errors

Being a novice to C language programming,my initial attempts consisted of several syntax errors. As per the advice hence I have been reading the lecture notes concentrating on syntax and wanted to ...
4
votes
1answer
246 views

Computing speed difference between n++ and n=n+1 in C

I am curious to know the computing speed difference between n++ and n=n+1 in C. I found a rather lengthy discussion on Stack Overflow, where some people are literally contradicting each other. To ...
0
votes
2answers
860 views

Compiler errors while using Clang [duplicate]

I have been using Clang Compiler and check50 to write the programs in pset1 i.e hello.c and greedy.c I have found that check50 appears to say that hello.c and greedy.c compile ,even though the Clang ...
12
votes
2answers
905 views

What does the linker do?

If pre-processor copies the code from library to my source code, and then compiles the combined code, that should mean, that with my code, the library is also compiled, and linked. What does the ...
0
votes
2answers
62 views

C language Libraries are precompiled. Then how is it linked in a different processor based computer?

Libraries are pre-compiled, whether they are static or dynamic. Thus if I compile a library in my computer (say an intel processor), how is my library going to help or "understood" when it is linked ...
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?
1
vote
1answer
1k views

What's the difference between #include <abc.h> and #include “abc.h”

I know this might sound a little unrelated, but, while working on hacker3, I created my own implementation of A* and had decided to keep it seperate from the main program to ensure I can still mess up ...