I'm learning C in college. And I wanted to try new things, so I decided to use the allegro Game library to create some stuff. I followed the tutorial, and everything went fine. I wrote a piece of code in the text editor and executed the commands provided by the tutorial and it compiled and run. (I'm on linux btw).
These are the commands:
gcc hello.c -o hello $(pkg-config allegro-5 allegro_font-5 --libs --cflags)
./hello
So, I understand that gcc is calling the gcc compiler and hello.c is the name of the source code file and -o hello specifies the name of the compiled file. but the next part is ambiguous and beyond my knowledge:
$(pkg-config allegro-5 allegro_font-5 --libs --cflags)
So can anyone explain what it means (it has something to do with linking). and if I remove that part the compiler returns these error codes:
/usr/bin/ld: /tmp/ccIQsEis.o: in function `main':
hello.c:(.text+0x2f): undefined reference to `al_install_system'
/usr/bin/ld: hello.c:(.text+0x34): undefined reference to `al_install_keyboard'
/usr/bin/ld: hello.c:(.text+0x45): undefined reference to `al_create_timer'
/usr/bin/ld: hello.c:(.text+0x4e): undefined reference to `al_create_event_queue'
/usr/bin/ld: hello.c:(.text+0x61): undefined reference to `al_create_display'
/usr/bin/ld: hello.c:(.text+0x6a): undefined reference to `al_create_builtin_font'
/usr/bin/ld: hello.c:(.text+0x73): undefined reference to `al_get_keyboard_event_source'
/usr/bin/ld: hello.c:(.text+0x85): undefined reference to `al_register_event_source'
/usr/bin/ld: hello.c:(.text+0x91): undefined reference to `al_get_display_event_source'
/usr/bin/ld: hello.c:(.text+0xa3): undefined reference to `al_register_event_source'
/usr/bin/ld: hello.c:(.text+0xaf): undefined reference to `al_get_timer_event_source'
/usr/bin/ld: hello.c:(.text+0xc1): undefined reference to `al_register_event_source'
/usr/bin/ld: hello.c:(.text+0xd4): undefined reference to `al_start_timer'
/usr/bin/ld: hello.c:(.text+0xe7): undefined reference to `al_wait_for_event'
/usr/bin/ld: hello.c:(.text+0x125): undefined reference to `al_is_event_queue_empty'
/usr/bin/ld: hello.c:(.text+0x13d): undefined reference to `al_map_rgb'
/usr/bin/ld: hello.c:(.text+0x16a): undefined reference to `al_clear_to_color'
/usr/bin/ld: hello.c:(.text+0x17e): undefined reference to `al_map_rgb'
/usr/bin/ld: hello.c:(.text+0x1ca): undefined reference to `al_draw_text'
/usr/bin/ld: hello.c:(.text+0x1cf): undefined reference to `al_flip_display'
/usr/bin/ld: hello.c:(.text+0x1e7): undefined reference to `al_destroy_font'
/usr/bin/ld: hello.c:(.text+0x1f3): undefined reference to `al_destroy_display'
/usr/bin/ld: hello.c:(.text+0x1ff): undefined reference to `al_destroy_timer'
/usr/bin/ld: hello.c:(.text+0x20b): undefined reference to `al_destroy_event_queue'
collect2: error: ld returned 1 exit status
And for the second part of the question, I tried to compile this code in code:blocks but it returns the same errors given by the compiler without the term: $(pkg-config allegro-5 allegro_font-5 --libs --cflags)
So, what configuration should I change in codeblocks so that it compiles well code using allegro libraries.
PS. I didn't include the source code intentionally as it adds no useful information to the question, only clutters it.
This is a Bash command-syntax feature which executes another command and then provides its output as a string. This idiom is being used here to programmatically provide command-line parameters to the gcc command. The pkg-config command is being executed, and it returns a string which becomes part of – is textually included in – the command-string for invoking gcc. (Which of course neither knows nor cares where its command-line parameters "come from.")
(Clever, huh?)
For example, try this:
echo $(ls)
You will be rewarded with a list of all the files in the current directory, concatenated as a string.
To elaborate on the answer by #Mike Robinson,
$(pkg-config allegro-5 allegro_font-5 --libs --cflags) will execute the command pkg-config and substitute the result. pkg-config is build utility that helps when compiling C programs. It's not specific to allegro, it is used by many C libraries.
In this particular case, pkg-config is called with the parameters allegro-5 allegro_font-5 --libs --cflags, which asks pkg-config "what are the compiler options (--cflags) and libraries (--libs) I need when compiling and linking with allegro?" Allegro consists of several modules, in this case you chose the main module 'allegro' and the font module 'allegro_font'. In both cases you're referring to major version 5 of allegro.
On your system, the result of the command is -I/usr/include/x86_64-linux-gnu -lallegro_font -lallegro. The meaning of these options is as follows:
-I/usr/include/x86_64-linux-gnu tells the compiler to add the path /usr/include/x86_64-linux-gnu to the header search path (because the allegro headers are located there)
-lallegro_font and '-lallegro` tells the linker to add the allegro_font and allegro libraries respectively. That also explains why you get all those undefined reference errors when you remove this - you are no longer telling the linker to add the allegro library, so it can't find all those functions anymore.
Related
I am trying to compile some cgo code for Solaris. I get these errors when I try to build:
$ CGO_LDFLAGS="-L$(pwd)/solaris-11.4-amd64-libs" CGO_CFLAGS='-I/home/shane/src/ioctl-experimentation/solaris-11.4-headers -Wno-unknown-pragmas' CGO_ENABLED=1 GOOS=solaris GOARCH=amd64 go build
# runtime/cgo
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x16): undefined reference to `__libc_csu_fini'
/usr/bin/ld: (.text+0x1d): undefined reference to `__libc_csu_init'
/usr/bin/ld: (.text+0x2a): undefined reference to `__libc_start_main'
/usr/bin/ld: $WORK/b003/_x003.o: in function `_cgo_release_context':
gcc_context.c:(.text+0x5c): undefined reference to `__stack_chk_fail'
/usr/bin/ld: $WORK/b003/_x004.o: in function `x_cgo_sys_thread_create':
gcc_libinit.c:(.text+0x87): undefined reference to `__stack_chk_fail'
/usr/bin/ld: $WORK/b003/_x004.o: in function `_cgo_wait_runtime_init_done':
gcc_libinit.c:(.text+0x121): undefined reference to `__stack_chk_fail'
/usr/bin/ld: $WORK/b003/_x004.o: in function `_cgo_try_pthread_create':
gcc_libinit.c:(.text+0x291): undefined reference to `__stack_chk_fail'
/usr/bin/ld: $WORK/b003/_x006.o: in function `x_cgo_init':
gcc_solaris_amd64.c:(.text+0xb6): undefined reference to `__stack_chk_fail'
/usr/bin/ld: $WORK/b003/_x006.o:gcc_solaris_amd64.c:(.text+0x214): more undefined references to `__stack_chk_fail' follow
collect2: error: ld returned 1 exit status
I am cross-compiling on Linux. Here is my Go version:
$ go version
go version go1.18.3 linux/amd64
The solaris-11.4-amd64-libs directory contains a copy of all files under /lib/amd64 from a Solaris 11.4 AMD64 machine. The solaris-11.4-headers directory contains a copy of all files under /usr/include from a Solaris 11.4 AMD64 machine.
Here is my Go code in main.go:
//go:build solaris
// +build solaris
package main
import "C"
func main() {
}
I know cgo is fully supported for Solaris as of Go 1.5, and I am using Go 1.18.
I'm looking for help understanding why these linker errors are happening, even when I copied across all libs from the /lib/amd64 directory. Is it possible there are more libs I also need to copy over from somewhere else?
Edit
At the suggestion of Liam Kelly, I looked at this question about how to link against a different libc. I tried passing -Xlinker -rpath=$(pwd)/solaris-11.4-amd64-libs as part of CGO_LDFLAGS, but I got the same errors as before. I tried using -nodefaultlibs and -nostdlib both separately and together along with -Xlinker -rpath=$(pwd)/solaris-11.4-amd64-libs, but using either of these two flags either separately or together just increased the number of linker errors.
I am going to assume that libxnet is needed for Solaris and that is why is is being automatically added.
First confirm that the libxnet library is where is should be with sudo find /lib libxnet*. I expect you will see one line of the output show:
lib/64/libxnet.so
Assuming you see the above output, I believe you just need to tell the linker to look in that location with CGO_LDFLAGS="-L/lib/64" CGO_ENABLED=1 GOOS=solaris GOARCH=amd64 go build. If that works then you should be able to embedded that LDFlag in your main.go file with:
// #cgo LDFLAGS: -L/lib/64
import "C"
Once embedded you will not need to explicitly set CGO_LDFLAGS
For my bachelor thesis I want to apply this algorithm proposed here: Binarization by Tissier
I cloned the repository and tried to run cd near-lossless-binarization in the corrsponding directory.
However there comes up an error I don't know how to solve.
cd near-lossless-binarization && make
gcc binarize.c -o binarize -ansi -pedantic -Wall -Wextra -Wno-unused-result -Ofast -funroll-loops -lblas -lm
/usr/bin/ld: /tmp/ccxe5d0J.o: in function `apply_regularizarion_gradient':
binarize.c:(.text+0xddc): undefined reference to `cblas_sgemm'
/usr/bin/ld: binarize.c:(.text+0xf9e): undefined reference to `cblas_sgemm'
/usr/bin/ld: /tmp/ccxe5d0J.o: in function `apply_reconstruction_gradient':
binarize.c:(.text+0x1059): undefined reference to `cblas_sgemm'
/usr/bin/ld: binarize.c:(.text+0x12fb): undefined reference to `cblas_sgemm'
/usr/bin/ld: binarize.c:(.text+0x1800): undefined reference to `cblas_sgemm'
/usr/bin/ld: /tmp/ccxe5d0J.o:binarize.c:(.text+0x1e71): more undefined references to `cblas_sgemm' follow
collect2: Error: ld gab 1 as end-Status returned
Seems like there is an issue inside the corresponding file.
I already opened an issue in the repo, but need answers pretty soon..
Hoped to find anyone with C experience here who may solve my problem.
Requirements named in the repo are fulfilled.
This is a rookie question and I might be doing something stupid, but I wrote a C program that includes two non default libraries: curl and libxml2. I am trying to go through the compilation process in detail to learn the process and statically link the libraries. These are the steps I took:
Downloaded libxml2 and curl and compiled it with the included makefile and did the following:
ar rcs libcurl.a /home/${USER}/Desktop/Curl/curl-7.73.0/lib/*.o
ar rcs libxml2.a /home/${USER}/Desktop/xml2/libxml2-2.7.2/*.o
Even though I only use a few functions from those libraries I packed all together in case they needed each other, or at least I think that's how it works. I copied the generated arhive library to a separate location and lastly I did:
cp ~/Desktop/libxml2-2.7.2/libxml2.a ~/Desktop/libs/
cp ~/Desktop/Curl/curl-7.73.0/lib/libxml2.a ~/Desktop/libs/
gcc WolframParser.c -I/home/${USER}/Desktop/Curl/curl-7.73.0/include/ -I/home/${USER}/Desktop/libxml2-2.7.2/include/ -L/home/${USER}/Desktop/libs/ -lcurl -lxml2 -lm
The linker reports a bunch of errors of undefined references, the likes of:
/usr/bin/ld: /home/${USER}/Desktop/libs//libcurl.a(libcurl_la-multi.o): in function `multi_getsock':
multi.c:(.text+0x18e): undefined reference to `Curl_ssl_getsock'
/usr/bin/ld: /home/${USER}/Desktop/libs//libcurl.a(libcurl_la-easy.o): in function `curl_global_init':
easy.c:(.text+0x172): undefined reference to `Curl_ssl_init'
/usr/bin/ld: /home/${USER}/Desktop/libs//libcurl.a(libcurl_la-easy.o): in function `curl_global_init_mem':
easy.c:(.text+0x22e): undefined reference to `Curl_ssl_init'
/usr/bin/ld: /home/${USER}/Desktop/libs//libcurl.a(libcurl_la-easy.o): in function `curl_global_cleanup':
easy.c:(.text+0x295): undefined reference to `Curl_ssl_cleanup'
. . .
Can someone please point out what I did wrong, and can this be done like this at all?
I have been searching for a couple of hours and found several threads with the same problem and tried all their suggestions.
My curl.h is in C:\MinGW\msys\1.0\curl-7.29.0\include\curl and I've included it at compile time but for some reason gcc claims it can't find it:
gcc -o curl.exe curl.c -IC:/MinGW/msys/1.0/local/ -IC:/MinGW/msys/1.0/curl-7.29.0/lib/.libs/ -IC:/MinGW/msys/1.0/curl-7.29.0/include/curl -IC:/MinGW/msys/1.0/OpenSSL-Win32/ -lcurl -lws2_32
and the result:
curl.c:4:32: fatal error: curl/curl.h: No such file or directory
UPDATE: (With the suggestion from H2CO3)
$ gcc -o curl.exe curl.c -IC:/MinGW/msys/1.0/local -IC:/MinGW/msys/1.0/curl-7.29.0/lib/.libs/ -IC:/MinGW/msys/1.0/curl-7.29.0/include/ -IC:/MinGW/msys/1.0/OpenSSL-Win32/include/ -lws2_32
C:\DOCUME~1\J10441\LOCALS~1\Temp\ccHP6WWt.o:curl.c:(.text+0xa8): undefined reference to `_imp__curl_global_init'
C:\DOCUME~1\J10441\LOCALS~1\Temp\ccHP6WWt.o:curl.c:(.text+0xe6): undefined reference to `_imp__curl_formadd'
C:\DOCUME~1\J10441\LOCALS~1\Temp\ccHP6WWt.o:curl.c:(.text+0x124): undefined reference to `_imp__curl_formadd'
C:\DOCUME~1\J10441\LOCALS~1\Temp\ccHP6WWt.o:curl.c:(.text+0x162): undefined reference to `_imp__curl_formadd'
C:\DOCUME~1\J10441\LOCALS~1\Temp\ccHP6WWt.o:curl.c:(.text+0x169): undefined reference to `_imp__curl_easy_init'
C:\DOCUME~1\J10441\LOCALS~1\Temp\ccHP6WWt.o:curl.c:(.text+0x183): undefined reference to `_imp__curl_slist_append'
C:\DOCUME~1\J10441\LOCALS~1\Temp\ccHP6WWt.o:curl.c:(.text+0x1b8): undefined reference to `_imp__curl_easy_setopt'
C:\DOCUME~1\J10441\LOCALS~1\Temp\ccHP6WWt.o:curl.c:(.text+0x211): undefined reference to `_imp__curl_easy_setopt'
C:\DOCUME~1\J10441\LOCALS~1\Temp\ccHP6WWt.o:curl.c:(.text+0x237): undefined reference to `_imp__curl_easy_setopt'
C:\DOCUME~1\J10441\LOCALS~1\Temp\ccHP6WWt.o:curl.c:(.text+0x245): undefined reference to `_imp__curl_easy_perform'
C:\DOCUME~1\J10441\LOCALS~1\Temp\ccHP6WWt.o:curl.c:(.text+0x25e): undefined reference to `_imp__curl_easy_strerror'
C:\DOCUME~1\J10441\LOCALS~1\Temp\ccHP6WWt.o:curl.c:(.text+0x288): undefined reference to `_imp__curl_easy_cleanup'
C:\DOCUME~1\J10441\LOCALS~1\Temp\ccHP6WWt.o:curl.c:(.text+0x296): undefined reference to `_imp__curl_formfree'
C:\DOCUME~1\J10441\LOCALS~1\Temp\ccHP6WWt.o:curl.c:(.text+0x2a4): undefined reference to `_imp__curl_slist_free_all'
collect2: ld returned 1 exit status
If I try to compile with -lcurl it says ..... ld.exe: cannot find -lcurl is this because it can't find the dll?
You're including <curl/curl.h>, and not <curl.h>. So you have to tell the compiler to look for header files in the include directory, and not in include/curl:
gcc -IC:\MinGW\msys\1.0\curl-7.29.0\include etc. etc.
This might be beyond the scope of what you're doing, but, I found it best to install a version of cURL(libcurl) into the MinGW/MSYS environment. After installed, any program can be compiled to use it with the typical <curl/curl.h> and -lcurl conventions since it's installed where GCC would expect it. I documented my process here.
I'm having some problems statically linking ncurses to one of my programs
Here's a really simple sample program:
#include<ncurses.h>
int main(){
initscr();
printw("Hello world\n");
refresh();
getch();
endwin();
return 0;
}
When I compile it with
gcc -static -lncurses hello_curses.c -o curses
I get these errors:
/tmp/ccwHJ6o1.o: In function `main':
curses_hello.c:(.text+0x5): undefined reference to `initscr'
curses_hello.c:(.text+0x14): undefined reference to `printw'
curses_hello.c:(.text+0x1b): undefined reference to `stdscr'
curses_hello.c:(.text+0x20): undefined reference to `wrefresh'
curses_hello.c:(.text+0x27): undefined reference to `stdscr'
curses_hello.c:(.text+0x2c): undefined reference to `wgetch'
curses_hello.c:(.text+0x31): undefined reference to `endwin'
collect2: ld returned 1 exit status
I'm a little confused why this isn't working. What am I missing here?
You need to pass -l options at the end of the command line:
gcc -static hello_curses.c -o curses -lncurses
When the compiler encounters -lfoo, it links in all the symbols from foo that have been requested by a previous file. If you put -lfoo at the beginning, no symbol has been requested yet, so no symbol gets linked.
Edit:
I think the real problem is that you need to specify your -l option at the end of the command. I just tried it the way you had it and reproduced your error. If I put -l:libncurses.a at the end of the line then it works. All without the -static option BTW.
I think what is happening is that you have a dynamic library for ncurses but you have used the -static option which means to not use any dynamic libraries. I suspect you do not actually have a static version of the ncurses library i.e. one ending with a .a suffix.
If you want to link with the static version (.a) of ncurses rather than the dynamic version (.so) then temporarily remove the symlink for libncurses.so so that the linker picks up the .a file instead. Alternatively copy the .a file somewhere else and add that to an earlier search path.
Alternatively if your linker supports it (eg. ld) then you could specify -l:libncurses.a instead of -lncurses.
I just spent a few hours on an ARM processor, trying to get it to work, as the accepted answer didn't work for me.
Here are my findings:
Apparently
gcc -static hello_curses.c -o curses -lncurses
works on an x64 processor, but not on an ARM processor.
When I tried with the above line, I still got all the "undefined reference errors" (and a lot more) of the OP.
You need to also link against libtinfo.a, and note that sequence matters.
This is the correct command line that works:
gcc -static hello_curses.c -o curses -lncurses -ltinfo
If you mix up the sequence, then it won't work...
gcc -static hello_curses.c -o curses -ltinfo -lncurses
undefined reference to `unctrl'
Of course this also works if you use the :lib syntax
This compiles
gcc -static hello_curses.c -o curses -l:libncursesw.a -l:libtinfo.a
This does not compile
gcc -static hello_curses.c -o curses -l:libtinfo.a -l:libncursesw.a
Oh how I like gcc...
This program should never have been allowed to graduate from kindergarden
(.text+0x2a8): undefined reference to cur_term'
/usr/lib/gcc/arm-linux-gnueabihf/4.8/../../../arm-linux-gnueabihf/libncursesw.a(lib_color.o):
In functioninit_pair': (.text+0x2ac): undefined reference to
cur_term'
/usr/lib/gcc/arm-linux-gnueabihf/4.8/../../../arm-linux-gnueabihf/libncursesw.a(lib_color.o):
In functioninit_pair': (.text+0x50a): undefined reference to tparm'
/usr/lib/gcc/arm-linux-gnueabihf/4.8/../../../arm-linux-gnueabihf/libncursesw.a(lib_color.o):
In functioninit_pair': (.text+0x518): undefined reference to
_nc_putp'
/usr/lib/gcc/arm-linux-gnueabihf/4.8/../../../arm-linux-gnueabihf/libncursesw.a(lib_color.o):
In functioninit_color': (.text+0x552): undefined reference to
cur_term'
/usr/lib/gcc/arm-linux-gnueabihf/4.8/../../../arm-linux-gnueabihf/libncursesw.a(lib_color.o):
In functioninit_color': (.text+0x556): undefined reference to
cur_term'
/usr/lib/gcc/arm-linux-gnueabihf/4.8/../../../arm-linux-gnueabihf/libncursesw.a(lib_color.o):
In functioninit_color': (.text+0x5e4): undefined reference to
tparm'
/usr/lib/gcc/arm-linux-gnueabihf/4.8/../../../arm-linux-gnueabihf/libncursesw.a(lib_color.o):
In functioninit_color': (.text+0x5f2): undefined reference to
_nc_putp'
/usr/lib/gcc/arm-linux-gnueabihf/4.8/../../../arm-linux-gnueabihf/libncursesw.a(lib_color.o):
In functioncan_change_color': (.text+0x740): undefined reference to
cur_term'
/usr/lib/gcc/arm-linux-gnueabihf/4.8/../../../arm-linux-gnueabihf/libncursesw.a(lib_color.o):
In functioncan_change_color': (.text+0x744): undefined reference to
cur_term'
/usr/lib/gcc/arm-linux-gnueabihf/4.8/../../../arm-linux-gnueabihf/libncursesw.a(lib_color.o):
In functionhas_colors': (.text+0x768): undefined reference to
cur_term'
/usr/lib/gcc/arm-linux-gnueabihf/4.8/../../../arm-linux-gnueabihf/libncursesw.a(lib_color.o):
In functionhas_colors': (.text+0x76c): undefined reference to
cur_term'
/usr/lib/gcc/arm-linux-gnueabihf/4.8/../../../arm-linux-gnueabihf/libncursesw.a(lib_color.o):
In functioncolor_content': (.text+0x7c2): undefined reference to
cur_term'
/usr/lib/gcc/arm-linux-gnueabihf/4.8/../../../arm-linux-gnueabihf/libncursesw.a(lib_color.o):(.text+0x7c6):
more undefined references tocur_term' follow
/usr/lib/gcc/arm-linux-gnueabihf/4.8/../../../arm-linux-gnueabihf/libncursesw.a(lib_color.o):
In function _nc_do_color': (.text+0x8de): undefined reference to
tparm'
/usr/lib/gcc/arm-linux-gnueabihf/4.8/../../../arm-linux-gnueabihf/libncursesw.a(lib_color.o):
In function _nc_do_color': (.text+0x8e6): undefined reference to
tputs'
/usr/lib/gcc/arm-linux-gnueabihf/4.8/../../../arm-linux-gnueabihf/libncursesw.a(lib_color.o):
In function _nc_do_color': (.text+0x958): undefined reference to
tputs'
/usr/lib/gcc/arm-linux-gnueabihf/4.8/../../../arm-linux-gnueabihf/libncursesw.a(lib_color.o):
In function set_foreground_color': (.text+0x62): undefined reference
totputs'
/usr/lib/gcc/arm-linux-gnueabihf/4.8/../../../arm-linux-gnueabihf/libncursesw.a(lib_color.o):
In function set_background_color': (.text+0xa2): undefined reference
totputs'
/usr/lib/gcc/arm-linux-gnueabihf/4.8/../../../arm-linux-gnueabihf/libncursesw.a(lib_hline.o):
In function whline': (.text+0xec): undefined reference toacs_map'
/usr/lib/gcc/arm-linux-gnueabihf/4.8/../../../arm-linux-gnueabihf/libncursesw.a(lib_hline.o):
In function whline': (.text+0xf0): undefined reference toacs_map'
/usr/lib/gcc/arm-linux-gnueabihf/4.8/../../../arm-linux-gnueabihf/libncursesw.a(lib_add_wch.o):
In function wadd_wch': (.text+0x4fe): undefined reference to
TABSIZE'
/usr/lib/gcc/arm-linux-gnueabihf/4.8/../../../arm-linux-gnueabihf/libncursesw.a(lib_add_wch.o):
In function wadd_wch': (.text+0x502): undefined reference to
TABSIZE'
/usr/lib/gcc/arm-linux-gnueabihf/4.8/../../../arm-linux-gnueabihf/libncursesw.a(lib_add_wch.o):
In function wecho_wchar': (.text+0x6d8): undefined reference to
TABSIZE'
/usr/lib/gcc/arm-linux-gnueabihf/4.8/../../../arm-linux-gnueabihf/libncursesw.a(lib_add_wch.o):
In function wecho_wchar': (.text+0x6dc): undefined reference to
TABSIZE'
/usr/lib/gcc/arm-linux-gnueabihf/4.8/../../../arm-linux-gnueabihf/libncursesw.a(lib_wunctrl.o):
In function wunctrl': (.text+0x30): undefined reference tounctrl'
collect2: error: ld returned 1 exit status