반응형
음 보통 저건 link를 안걸어 주면 나는 오류 입니다. ^^;;

그런데

LINUX에서 순서가 매우 중요한 것 같습니다. T.T

gcc test.c

test.c:(.text+0x49): undefined reference to
test.c:(.text+0x71): undefined reference to
test.c:(.text+0x82): undefined reference to
test.c:(.text+0xaa): undefined reference to
test.c:(.text+0xbb): undefined reference to
test.c:(.text+0xe3): undefined reference to
test.c:(.text+0xf4): undefined reference to
test.c:(.text+0x130): undefined reference to
test.c:(.text+0x141): undefined reference to
test.c:(.text+0x17d): undefined reference to
test.c:(.text+0x18e): undefined reference to
test.c:(.text+0x1ca): undefined reference to
test.c:(.text+0x1db): undefined reference to
test.c:(.text+0x217): undefined reference to
test.c:(.text+0x228): undefined reference to
test.c:(.text+0x27d): undefined reference to
test.c:(.text+0x28e): undefined reference to
test.c:(.text+0x2d3): undefined reference to
test.c:(.text+0x30c): undefined reference to

일단 뒤에 함수명은 이유가 있어서 제끼고 ㅋㅋㅋ

to 뒤에는 함수명이 옵니다. ^^;;






네이버를 열심히 뒤지다 보니

저 함수들을 포함하는 라이버러리가 없다 그래서

T.T

gcc -lmylib test.c

이렇게 했습니다.

그래도 똑같이 나는 겁니다.

gcc -lmylib -L/usr/local/lib test.c

이렇게 해주라 그래서 또 해봤는데 똑같은 오류가 납니다. ^^;;

그래서 또 네이버와 구글을 전전 긍긍하다가

KLDP에서

순서 이야기를 살짝 본 기억이 나서 T.T

gcc test.c -lmylib -L/usr/local/lib

이렇게 했습니다.

T.T

a.out가 나옵니다. 흑흑흑

gcc -o test.exe test.c -lmylib -L/usr/local/lib

이렇게 하시면

a.out가 아니고

test.exe로 실행 파일을 생성 할 수 있습니다.

여튼 일단 제가 원하는 것을 컴파일을 했구용 ^^;;

이제 퇴근 하렵니다. ^^;;


반응형
반응형
1호점에서 가져 왔습니다.

여러분들은 프로그램을 작성하시면서 많은 자바 스크립트를 활용할 겁니다. 그 자바 스크립트와 PHP를 섞어서 함수화 해놓고 그걸 가지고 잘 활용한다면 엄청 편해 질 것이라는 생각이 듭니다. ^^;; 그래서 오늘은 언제 또 업데이타 될지 모르겠지만 개인 라이버러리 구축의 제 일단계로 history 함수를 작성해 보겠습니다.

우선 함수를 작성하는 방법은 다음과 같습니다.

function function_name() {
문장
}

저위의 형식으로 함수를 작성합니다. function_name()가 함수명이 됩니다. 이 함수의 () 안에는 여러변수들이 나열 될 수 있습니다.

function go_back($msg, $num) {
echo ("
<script>
alert('$msg');
history.go($num);
</script>
");
exit;
}

함수는 위와 같이 작성합니다.

그리고 활용하는 것은요

저걸 파일에 저장해 놓고 include를 시켜두 되구요.

아예 페이지에다 저 코드를 뿌려 주셔두 됩니다.

그리고 함수를 호출하는 방법은

예를 들어서 '이름을 넣지 않으셨습니다.' 라는 메시지를 나타내고 한칸 뒤로 가시려면

이렇게 하시면 됩니다.

go_back("이름을 넣지 않으셨습니다.", -1);
반응형

+ Recent posts