unit 1 - wantok plus fadhil
TRANSCRIPT
-
8/16/2019 Unit 1 - Wantok Plus Fadhil
1/4
Fadhil Ramadhan Santoso(36284) - Ikhwan luthfi syafjon(36292)
PERCOBAAN 1:
my first program#include
main() {
printf("this is my first program...\n");
}
my second program
#include
main() {
printf("this is my second program...\n");}
terminal
praktikum@komputer16:~$ ls
data-praktikum Documents Music Public Templates
Desktop Examples Pictures [email protected] Videos
praktikum@komputer16:~$ cd data-praktikum
praktikum@komputer16:~/data-praktikum$ ls
34755_34898 36611 EMHA35221 mysecondprogram.c
34777_34755 (Adek_Adit)35099_35217 file.tar.gz mysecondprogram.c~
34785_34840 adhim_azwar GAMA (35051) rerata1.c34806 Andi34777&Yogie34686 GILANG (35034) rerata1.c~
34932-34913 a.out Karin(35975) rerata.c
35051,35034 AriefBudiM35231 linking1.c ridwan_35189
35108 basdat-5.odt linking1.c~ sekar35060,wisnu35096
35260-35105 Benhard (35139) linking2.c unit3.c~
35591 Benhard_35239_TUGAS linking2.c~ untitled folder
36284-36292 debug.c mirwand.c UVAN_36496
36496 debug.c~ myfirstprogram1.c
36513_36600 Dindy(35332) myfirstprogram.c
praktikum@komputer16:~/data-praktikum$ cd 36284-36292praktikum@komputer16:~/data-praktikum/36284-36292$ gcc myfirstprogram.c
praktikum@komputer16:~/data-praktikum/36284-36292$ ./a.out
this is my first program...
praktikum@komputer16:~/data-praktikum/36284-36292$ gcc mysecondprogram.c
praktikum@komputer16:~/data-praktikum/36284-36292$ ./a.out
this is my second program...
praktikum@komputer16:~/data-praktikum/36284-36292$
-
8/16/2019 Unit 1 - Wantok Plus Fadhil
2/4
PERCOBAAN 2 :
linking1.c
#include
main(){
printf("first file to be linked...\n"); linking2();
}
linking2.c
#include
linking2(){printf("second file to be linked...\n");
}
terminal
praktikum@komputer16:~/data-praktikum/36284-36292$ gcc -c linking1.c
praktikum@komputer16:~/data-praktikum/36284-36292$ gcc -c linking2.c
praktikum@komputer16:~/data-praktikum/36284-36292$ gcc -o linkedprogram linking1.o
linking2.o
praktikum@komputer16:~/data-praktikum/36284-36292$ ./linkedprogram
first file to be linked...
second file to be linked...praktikum@komputer16:~/data-praktikum/36284-36292$
praktikum@komputer16:~/data-praktikum/36284-36292$ gcc -o linkedprogram linking1.o
linking1.o: In function `main':
linking1.c:(.text+0x1e): undefined reference to `linking2'
collect2: ld returned 1 exit status
praktikum@komputer16:~/data-praktikum/36284-36292$ linkedprogram
bash: linkedprogram: command not found
praktikum@komputer16:~/data-praktikum/36284-36292$
-
8/16/2019 Unit 1 - Wantok Plus Fadhil
3/4
PERCOBAAN 3:
Debug.c
#include
main(){
printf("for debugging use only... \n");
}
TERMINAL 1
praktikum@komputer16:~/data-praktikum/36284-36292$ gcc -g -o debugfile debug.c
praktikum@komputer16:~/data-praktikum/36284-36292$ gdb debugfile
GNU gdb 6.6-debian
Copyright (C) 2006 Free Software Foundation, Inc.GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i486-linux-gnu"...
Using host libthread_db library "/lib/tls/i686/cmov/libthread_db.so.1".
(gdb) run
Starting program: /home/data-praktikum/36284-36292/debugfile
for debugging use only...
Program exited with code 033.(gdb)
TERMINAL 2
praktikum@komputer16:~/data-praktikum/36284-36292$ gcc -o debugfile debug.c
praktikum@komputer16:~/data-praktikum/36284-36292$ gdb debugfile
GNU gdb 6.6-debian
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i486-linux-gnu"...
Using host libthread_db library "/lib/tls/i686/cmov/libthread_db.so.1".
(gdb) run
Starting program: /home/data-praktikum/36284-36292/debugfile
for debugging use only...
-
8/16/2019 Unit 1 - Wantok Plus Fadhil
4/4
Program exited with code 033.
(gdb)