pro*c에서 에러가 납니다.

cjy1126의 이미지

제 소스가 갑자기 안되서 제대로되는 소스를 받아서 했는데도 에러가 납니다.

pro*c를 제대로 할줄몰라 에러 메세지를봐도 모르겠습니다.

고수님들 도움 부탁드립니다.

[cjy1126@svr052 test]$ gcc -o test test.c
/tmp/ccqT3e9H.o: In function `main':
/tmp/ccqT3e9H.o(.text+0x17b): undefined reference to `sqlcxt'
/tmp/ccqT3e9H.o(.text+0x21b): undefined reference to `sqlcxt'
/tmp/ccqT3e9H.o(.text+0x394): undefined reference to `sqlcxt'
/tmp/ccqT3e9H.o(.text+0x41f): undefined reference to `sqlcxt'
/tmp/ccqT3e9H.o(.text+0x4ba): undefined reference to `sqlcxt'
collect2: ld returned 1 exit status
markboy의 이미지

pro*c 에서 빌드할때 gcc 그대로 쓰나요?

기억이 희미한데(대충 99년도 쯤 기억입니다 :) .pc 파일 작성해서

proc iname=어쩌구.pc

해서 .c 파일 만들고 그걸 다시

gcc -c 어쩌구.c

해서 .o 파일 만든 다음에

make -f proc.mk exe=어쩌구 OBJS="어쩌구.o" build

해서 만들었던 기억이 있습니다. (너무 오래전 기억이라서 정확하지는 않군요 :( )

proc.mk는 pro*c 쪽 뒤지면 있었던 걸로 기억하고요.

cjy1126의 이미지

블로그 찾아서 보니까

pcscfg.cfg 셋팅하면 그냥 컴파일해도 되는듯해서요.

그 전에도 계속

proc test.pc

gcc -o test test.c

이렇게해도 문제가 없었거든요.

갑자기 그러네요.

#include <sqlca.h>

하면 계속 sqlca.h가 없다고 나오네요.

sqlca.h를 같은 디렉토리에 복사하고

#include "sqlca.h"

이렇게하면 위와같은 에러가 나오고요.

indie의 이미지

설정파일을 편집한 후 재대로 됐는지 확인 해보시기 바랍니다.
그리고 $ORACLE_HOME/precomp/demo/proc 디렉토리에 있는
예제 소스들을 컴파일 해보세요.

make -f demo_proc.mk build

정상적으로 컴파일이 되지 않으면 설정 파일을 다시 수정하세요...

예전에 제가 레뎃 8에 오라클 9i 설치 해서 쓰던 파일 입니다.
$ORACLE_HOME/precomp/admin/pcscfg.cfg

sys_include=(/oracle/product/9i/precomp/public,/usr/include,/usr/lib/gcc-lib/i386-redhat-linux/3.2/include)
include=(/oracle/product/9i/precomp/lib)
include=(/oracle/product/9i/rdbms/lib)
include=(/oracle/product/9i/rdbms/public)
include=(/oracle/product/9i/rdbms/demo)
include=(/oracle/product/9i/network/lib)
include=(/oracle/product/9i/plsq/public)
ltype=short

집에나 갈까?

cjy1126의 이미지

[cjy1126@svr052 proc]$ make -f demo_proc.mk build
cc -o   -L/usr/oracle/product/8.1.7/lib/ -lclntsh   `cat /usr/oracle/product/8.1.7/lib/sysliblist` -ldl -lm
/usr/bin/ld: cannot open output file -L/usr/oracle/product/8.1.7/lib/: 그런 파일이나 디렉토리가 없음
collect2: ld returned 1 exit status
make: *** [build] 오류 1

pcscfg.cfg의 sys_include를 아래와같이하면
/usr/lib/gcc-lib/i386-redhat-linux/egcs-2.96/include

아래와 같은 오류가 나옵니다.

Pro*C/C++: Release 8.1.7.0.0 - Production on Tue Feb 1 10:44:42 2005

 (c) Copyright 2000 Oracle Corporation.  All rights reserved.

 System default option values taken from: /usr/oracle/product/8.1.7/precomp/admin/pcscfg.cfg

 Error at line 34, column 11 in file /usr/include/stdio.h
 # include <stddef.h>
 ..........1
 PCC-S-02015, unable to open include file
 Error at line 29, column 10 in file /usr/include/bits/types.h
 #include <stddef.h>
 .........1
 PCC-S-02015, unable to open include file
 Syntax error at line 48, column 3, file /usr/include/bits/pthreadtypes.h:
 Error at line 48, column 3 in file /usr/include/bits/pthreadtypes.h
   size_t __guardsize;
 ..1
 PCC-S-02201, Encountered the symbol "size_t" when expecting one of the following
 :

    } char, const, double, enum, float, int, long, ulong_varchar,
    OCIBFileLocator OCIBlobLocator, OCIClobLocator, OCIDateTime,
    OCIExtProcContext, OCIInterval, OCIRowid, OCIDate, OCINumber,
    OCIRaw, OCIString, short, signed, sql_context, sql_cursor,
    struct, union, unsigned, utext, uvarchar, varchar, void,
    volatile, a typedef name,
 The symbol "enum," was substituted for "size_t" to continue.

 Syntax error at line 51, column 3, file /usr/include/bits/pthreadtypes.h:
 Error at line 51, column 3 in file /usr/include/bits/pthreadtypes.h
   size_t __stacksize;
 ..1
 PCC-S-02201, Encountered the symbol "size_t" when expecting one of the following
 :

    } char, const, double, enum, float, int, long, ulong_varchar,
    OCIBFileLocator OCIBlobLocator, OCIClobLocator, OCIDateTime,
    OCIExtProcContext, OCIInterval, OCIRowid, OCIDate, OCINumber,
    OCIRaw, OCIString, short, signed, sql_context, sql_cursor,
    struct, union, unsigned, utext, uvarchar, varchar, void,
    volatile, a typedef name,
 The symbol "enum," was substituted for "size_t" to continue.

sys_include를 /usr/lib/gcc-lib/i386-glibc21-linux/egcs-2.91.66/include/로 고치면

proc test.pc

는 잘되지만...

[cjy1126@svr052 test2]$ gcc -o test test.c
test.c:137:19: sqlca.h: 그런 파일이나 디렉토리가 없음

이렇게 나옵니다.

GCC 버전은 아래와 같습니다.

[cjy1126@svr052 test2]$ gcc -v
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/2.96/specs
gcc version 2.96 20000731 (Red Hat Linux 7.3 2.96-110)

너무 답답하네요 ㅠㅠ

make -f demo_proc.mk build 도 에러가 납니다.

indie의 이미지

Makefile을 만들어서 써보세요...

/* test_src_proc.mk */
include $(ORACLE_HOME)/precomp/lib/env_precomp.mk
SRC=test_src
build:
$(PROC) $(PROCFLAGS) iname=$(SRC).pc
$(CC) -g $(CFLAGS) -c $(SRC).c
$(CC) -g -o $(SRC) $(SRC).o -L$(LIBHOME) $(PROLDLIBS)

집에나 갈까?

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.