The qDecoder Project

Modify Delete Post Reply Forward List
Written by 강창훈 ([email protected]) Hits: 68 , Lines: 573
버전엎후 컴파일시 qContentType와 sqlcxt  참조에러
qDecoder-6.0.2에서 7.0.1로 버전엎 했는 데,
똑같은 소스로 컴파일 했는 데, qContentType와 sqlcxt  참조에러가 나서 도움을 구합니다.

에러내용은 다음과 같습니다.
———————————————————-
Compiling gong_list3.c ……!!
정의되지 않음  첫번째 참조된 기호 파일의
qContentType                        gong_list3.o
sqlcxt                              gong_list3.o
ld: 치명적: 기호 참조 오류. a.out에 출력이 기록되지 않음
Link gong_list3 gong_list3.o
———————————————————–

특기사항은 오라클 버전을 7.x에서 8.x 로 up했습니다.
첨부 화일도 붙칩니다. 아무튼 고수님들의 조언을 부탁합니다.
감사합니다.


/* Result Sets Interface */
#ifndef SQL_CRSR
#  define SQL_CRSR
 struct sql_cursor
 {
   unsigned int curocn;
   void *ptr1;
   void *ptr2;
   unsigned long magic;
 };
 typedef struct sql_cursor sql_cursor;
 typedef struct sql_cursor SQL_CURSOR;
#endif /* SQL_CRSR */

/* Thread Safety */
typedef void * sql_context;
typedef void * SQL_CONTEXT;

/* Object support */
struct sqltvn
{
 unsigned char *tvnvsn;
 unsigned short tvnvsnl;
 unsigned char *tvnnm;
 unsigned short tvnnml;
 unsigned char *tvnsnm;
 unsigned short tvnsnml;
};
typedef struct sqltvn sqltvn;

struct sqladts
{
 unsigned int adtvsn;
 unsigned short adtmode;
 unsigned short adtnum;  
 sqltvn adttvn[1];       
};
typedef struct sqladts sqladts;

static struct sqladts sqladt = {
 1,1,0,
};

/* Binding to PL/SQL Records */
struct sqltdss
{
 unsigned int tdsvsn;
 unsigned short tdsnum;
 unsigned char *tdsval[1];
};
typedef struct sqltdss sqltdss;
static struct sqltdss sqltds =
{
 1,
 0,
};

/* File name & Package Name */
struct sqlcxp
{
 unsigned short fillen;
          char  filnam[14];
};
static struct sqlcxp sqlfpn =
{
   13,
   "gong_list3.pc"
};


static unsigned long sqlctx = 612371;


static struct sqlexd {
  unsigned int   sqlvsn;
  unsigned int   arrsiz;
  unsigned int   iters;
  unsigned int   offset;
  unsigned short selerr;
  unsigned short sqlety;
  unsigned int   occurs;
           short *cud;
  unsigned char  *sqlest;
           char  *stmt;
  sqladts *sqladtp;
  sqltdss *sqltdsp;
           void  **sqphsv;
  unsigned int   *sqphsl;
           int   *sqphss;
           void  **sqpind;
           int   *sqpins;
  unsigned int   *sqparm;
  unsigned int   **sqparc;
  unsigned short  *sqpadto;
  unsigned short  *sqptdso;
           void  *sqhstv[5];
  unsigned int   sqhstl[5];
           int   sqhsts[5];
           void  *sqindv[5];
           int   sqinds[5];
  unsigned int   sqharm[5];
  unsigned int   *sqharc[5];
  unsigned short  sqadto[5];
  unsigned short  sqtdso[5];
} sqlstm = {10,5};

/* SQLLIB Prototypes */
extern sqlcxt (/*_ void **, unsigned long *,
                  struct sqlexd *, struct sqlcxp * _*/);
extern sqlcx2t(/*_ void **, unsigned long *,
                  struct sqlexd *, struct sqlcxp * _*/);
extern sqlbuft(/*_ void **, char * _*/);
extern sqlgs2t(/*_ void **, char * _*/);
extern sqlorat(/*_ void **, unsigned long *, void * _*/);

/* Forms Interface */
static int IAPSUCC = 0;
static int IAPFAIL = 1403;
static int IAPFTL  = 535;
extern void sqliem(/*_ char *, int * _*/);

static char *sq0002 =
"select G_SERIAL ,G_TITLE ,G_CONTENT ,to_char(G_DATE,’yyyy/mm/dd’) G_DATE ,G
_DISPLAY  from OA_GONGJI where G_DISPLAY=’Y’ order by G_SERIAL desc          
  ";

typedef struct { unsigned short len; unsigned char arr[1]; } VARCHAR;
typedef struct { unsigned short len; unsigned char arr[1]; } varchar;

/* CUD (Compilation Unit Data) Array */
static short sqlcud0[] =
{10,4130,0,0,0,
5,0,0,1,0,0,27,38,0,0,4,4,0,1,0,1,9,0,0,1,9,0,0,1,10,0,0,1,10,0,0,
36,0,0,2,155,0,9,154,0,0,0,0,0,1,0,
51,0,0,2,0,0,13,161,0,0,5,0,0,1,0,2,3,0,0,2,97,0,0,2,97,0,0,2,97,0,0,2,97,0,0,
86,0,0,2,0,0,15,188,0,0,0,0,0,1,0,
};


#include <stdio.h>
#include <stdlib.h>
#include <sqlca.h>
#include <oraca.h>
#include <string.h>
#include <qDecoder.h>
#include  <time.h>
#define  TRUE         1
#define  FALSE        0

/* EXEC SQL BEGIN DECLARE SECTION; */

 int  G_SERIAL;    
 char  G_TITLE[110];
 char  G_CONTENT[2002];
 char  G_DATE[12];
 char  G_DISPLAY[2];
/* EXEC SQL END DECLARE SECTION; */


int  OralceConnect(char *szUser, char *szPasswd);
void display();
void Process();
void get_gongji();
/*void GetParameter();*/
int trim(char s[]);
void str_replace(char t[], char s[], char r[]);
char* putYearMonth(char *value);

int OracleConnect(char *szUser, char *szPasswd)
{
  /* EXEC SQL BEGIN DECLARE SECTION; */

       /* VARCHAR  szUserName [20] ; */
struct { unsigned short len; unsigned char arr[20]; } szUserName;

       /* VARCHAR  szPassword [20] ; */
struct { unsigned short len; unsigned char arr[20]; } szPassword;

  /* EXEC SQL END DECLARE SECTION; */

  memcpy (szUserName.arr, szUser, 7) ;
  szUserName.len = 7 ;
  memcpy (szPassword.arr, szPasswd, 8) ;
  szPassword.len = 8 ;
  /* EXEC SQL CONNECT :szUserName IDENTIFIED BY :szPassword ; */

{
  struct sqlexd sqlstm;
  sqlstm.sqlvsn = 10;
  sqlstm.arrsiz = 4;
  sqlstm.sqladtp = &sqladt;
  sqlstm.sqltdsp = &sqltds;
  sqlstm.iters = (unsigned int  )10;
  sqlstm.offset = (unsigned int  )5;
  sqlstm.cud = sqlcud0;
  sqlstm.sqlest = (unsigned char  *)&sqlca;
  sqlstm.sqlety = (unsigned short)256;
  sqlstm.occurs = (unsigned int  )0;
  sqlstm.sqhstv[0] = (         void  *)&szUserName;
  sqlstm.sqhstl[0] = (unsigned int  )22;
  sqlstm.sqhsts[0] = (         int  )22;
  sqlstm.sqindv[0] = (         void  *)0;
  sqlstm.sqinds[0] = (         int  )0;
  sqlstm.sqharm[0] = (unsigned int  )0;
  sqlstm.sqadto[0] = (unsigned short )0;
  sqlstm.sqtdso[0] = (unsigned short )0;
  sqlstm.sqhstv[1] = (         void  *)&szPassword;
  sqlstm.sqhstl[1] = (unsigned int  )22;
  sqlstm.sqhsts[1] = (         int  )22;
  sqlstm.sqindv[1] = (         void  *)0;
  sqlstm.sqinds[1] = (         int  )0;
  sqlstm.sqharm[1] = (unsigned int  )0;
  sqlstm.sqadto[1] = (unsigned short )0;
  sqlstm.sqtdso[1] = (unsigned short )0;
  sqlstm.sqphsv = sqlstm.sqhstv;
  sqlstm.sqphsl = sqlstm.sqhstl;
  sqlstm.sqphss = sqlstm.sqhsts;
  sqlstm.sqpind = sqlstm.sqindv;
  sqlstm.sqpins = sqlstm.sqinds;
  sqlstm.sqparm = sqlstm.sqharm;
  sqlstm.sqparc = sqlstm.sqharc;
  sqlstm.sqpadto = sqlstm.sqadto;
  sqlstm.sqptdso = sqlstm.sqtdso;
  sqlcxt((void **)0, &sqlctx, &sqlstm, &sqlfpn);
}


  if (sqlca.sqlcode == 0)
    return (TRUE) ;
  else
  {
    printf("DB 접속 에러1n,%d", sqlca.sqlcode);
    return (FALSE) ;
  }
}

void display()
{
   qContentType("text/html");

   printf("n<HTML> ");


   printf("n<HEAD>");
   printf("n<META HTTP-EQUIV=’Content-Type’ CONTENT=’text/html; charset=ks_c_5601-1987′>");

   printf("n<TITLE>공지사항</TITLE>");


   printf("n<style type="text/css">");
   printf("n<!–");

   printf("n td { font-size:9pt; font-family:"굴림";}");
   printf("n  a:link{text-decoration:none; color:black}");
   printf("n  a:visited{text-decoration:none; color:black}");
   printf("n  a:active {text-decoration: none ;color:black}");
   printf("n  a:hover {text-decoration: none ; color:black}");
   printf("n A.txt2 {TEXT-DECORATION: none; color:091FC0}");
   printf("n A.txt2:link {TEXT-DECORATION: none; color:091FC0}");
   printf("n A.txt2:visited {TEXT-DECORATION: none;color:D41BDF}");
   printf("n A.txt2:hover {TEXT-DECORATION:none;color:D41BDF}");
   printf("n ");
   printf("n A.txt1 {TEXT-DECORATION: none; color:black}");
   printf("n A.txt1:link {TEXT-DECORATION: none; color:black}");
   printf("n A.txt1:visited {TEXT-DECORATION: none;color:E82903}");
   printf("n A.txt1:hover {TEXT-DECORATION:none;color:E82903}");


   printf("n –>");
   printf("n</style>");

   printf("n</HEAD>");

printf("n<SCRIPT LANGUAGE="JavaScript">");
printf("n<!–");

printf("n function open_gongji(no)");
printf("n {");
printf("n window.open("gong_view?G_SERIAL="+no, "gongji", "left=0, top=0, width=309, height=78, status=no, toolbar=no, menebar=no, resizable=no, scrollbars=no, location=no, alwaysRaised=yes")");
printf("n }");


printf("n//–>");
printf("n</SCRIPT>");
printf("n ");
   printf("n<BODY BGCOLOR="#e8ecf8" topmargin=0 leftmargin=0>");

   printf("n<table border=0 cellpadding=0 cellspacing=0 width=309>");

   get_gongji();

   printf("n</table>");

   printf("n</BODY>");
   printf("n</HTML>");

/*printf("n%s",sq0002);*/
}

int oracle_con()
{

  if (OracleConnect ("winpla", "winpla") == 0)
   {
       printf("오류 – 데이터베이스에 접속되지 않습니다.n") ;
       return FALSE ;
   }
   return TRUE ;

}

void main()
{
  int cntrec=0;

  /* ORACLE 환경변수 */
  putenv (ORA_STRING1) ;
  putenv (ORA_STRING2) ;
  putenv (ORA_STRING3) ;
  putenv (ORA_STRING4) ;
  putenv (ORA_STRING5) ;
  putenv (ORA_STRING6) ;

  if(oracle_con() == TRUE)
     Process();
}
  
/* 입력(2),취소(3),처음으로 들어올시(1) */
void Process()
{
/* GetParameter();*/
 display();
}

void get_gongji()
{   

/* EXEC SQL DECLARE GONGJI_LIST CURSOR FOR
SELECT G_SERIAL, G_TITLE, G_CONTENT, to_char(G_DATE, ‘yyyy/mm/dd’ ) as G_DATE, G_DISPLAY
FROM OA_GONGJI WHERE G_DISPLAY = ‘Y’
 ORDER BY G_SERIAL desc ; */

  
 /* EXEC SQL OPEN GONGJI_LIST; */

{
 struct sqlexd sqlstm;
 sqlstm.sqlvsn = 10;
 sqlstm.arrsiz = 4;
 sqlstm.sqladtp = &sqladt;
 sqlstm.sqltdsp = &sqltds;
 sqlstm.stmt = sq0002;
 sqlstm.iters = (unsigned int  )1;
 sqlstm.offset = (unsigned int  )36;
 sqlstm.selerr = (unsigned short)1;
 sqlstm.cud = sqlcud0;
 sqlstm.sqlest = (unsigned char  *)&sqlca;
 sqlstm.sqlety = (unsigned short)256;
 sqlstm.occurs = (unsigned int  )0;
 sqlcxt((void **)0, &sqlctx, &sqlstm, &sqlfpn);
}


  

 while(1)
 {
G_SERIAL = 0;
     
   /* EXEC SQL FETCH GONGJI_LIST
   INTO  : G_SERIAL, G_TITLE, G_CONTENT, G_DATE, G_DISPLAY; */

{
   struct sqlexd sqlstm;
   sqlstm.sqlvsn = 10;
   sqlstm.arrsiz = 5;
   sqlstm.sqladtp = &sqladt;
   sqlstm.sqltdsp = &sqltds;
   sqlstm.iters = (unsigned int  )1;
   sqlstm.offset = (unsigned int  )51;
   sqlstm.cud = sqlcud0;
   sqlstm.sqlest = (unsigned char  *)&sqlca;
   sqlstm.sqlety = (unsigned short)256;
   sqlstm.occurs = (unsigned int  )0;
   sqlstm.sqhstv[0] = (         void  *)&G_SERIAL;
   sqlstm.sqhstl[0] = (unsigned int  )sizeof(int);
   sqlstm.sqhsts[0] = (         int  )0;
   sqlstm.sqindv[0] = (         void  *)0;
   sqlstm.sqinds[0] = (         int  )0;
   sqlstm.sqharm[0] = (unsigned int  )0;
   sqlstm.sqadto[0] = (unsigned short )0;
   sqlstm.sqtdso[0] = (unsigned short )0;
   sqlstm.sqhstv[1] = (         void  *)G_TITLE;
   sqlstm.sqhstl[1] = (unsigned int  )110;
   sqlstm.sqhsts[1] = (         int  )0;
   sqlstm.sqindv[1] = (         void  *)0;
   sqlstm.sqinds[1] = (         int  )0;
   sqlstm.sqharm[1] = (unsigned int  )0;
   sqlstm.sqadto[1] = (unsigned short )0;
   sqlstm.sqtdso[1] = (unsigned short )0;
   sqlstm.sqhstv[2] = (         void  *)G_CONTENT;
   sqlstm.sqhstl[2] = (unsigned int  )2002;
   sqlstm.sqhsts[2] = (         int  )0;
   sqlstm.sqindv[2] = (         void  *)0;
   sqlstm.sqinds[2] = (         int  )0;
   sqlstm.sqharm[2] = (unsigned int  )0;
   sqlstm.sqadto[2] = (unsigned short )0;
   sqlstm.sqtdso[2] = (unsigned short )0;
   sqlstm.sqhstv[3] = (         void  *)G_DATE;
   sqlstm.sqhstl[3] = (unsigned int  )12;
   sqlstm.sqhsts[3] = (         int  )0;
   sqlstm.sqindv[3] = (         void  *)0;
   sqlstm.sqinds[3] = (         int  )0;
   sqlstm.sqharm[3] = (unsigned int  )0;
   sqlstm.sqadto[3] = (unsigned short )0;
   sqlstm.sqtdso[3] = (unsigned short )0;
   sqlstm.sqhstv[4] = (         void  *)G_DISPLAY;
   sqlstm.sqhstl[4] = (unsigned int  )2;
   sqlstm.sqhsts[4] = (         int  )0;
   sqlstm.sqindv[4] = (         void  *)0;
   sqlstm.sqinds[4] = (         int  )0;
   sqlstm.sqharm[4] = (unsigned int  )0;
   sqlstm.sqadto[4] = (unsigned short )0;
   sqlstm.sqtdso[4] = (unsigned short )0;
   sqlstm.sqphsv = sqlstm.sqhstv;
   sqlstm.sqphsl = sqlstm.sqhstl;
   sqlstm.sqphss = sqlstm.sqhsts;
   sqlstm.sqpind = sqlstm.sqindv;
   sqlstm.sqpins = sqlstm.sqinds;
   sqlstm.sqparm = sqlstm.sqharm;
   sqlstm.sqparc = sqlstm.sqharc;
   sqlstm.sqpadto = sqlstm.sqadto;
   sqlstm.sqptdso = sqlstm.sqtdso;
   sqlcxt((void **)0, &sqlctx, &sqlstm, &sqlfpn);
}


     
   if (G_SERIAL == 0 )
   {
break;
   }  

   
   trim(G_TITLE);
trim(G_CONTENT);
trim(G_DATE);
trim(G_DISPLAY);
/*
str_replace(EDU_CONTENT2, EDU_CONTENT, "<br>");*/

   printf("n  <tr>");
printf("n    <td width=8><p> </td>");
printf("n    <td width=11><p>");
printf("n    <img src=http://100.1.22.11/img/intra_noticeicon.gif width=12 height=13 border=0>");
printf("n    </td>");
printf("n    <td width=*><a href="javascript:open_gongji(%d)">%s (%s)</a>", G_SERIAL, G_TITLE, G_DATE);
printf("n    </td>");
printf("n  </tr>");


}
 /* EXEC SQL CLOSE GONGJI_LIST ; */

{
 struct sqlexd sqlstm;
 sqlstm.sqlvsn = 10;
 sqlstm.arrsiz = 5;
 sqlstm.sqladtp = &sqladt;
 sqlstm.sqltdsp = &sqltds;
 sqlstm.iters = (unsigned int  )1;
 sqlstm.offset = (unsigned int  )86;
 sqlstm.cud = sqlcud0;
 sqlstm.sqlest = (unsigned char  *)&sqlca;
 sqlstm.sqlety = (unsigned short)256;
 sqlstm.occurs = (unsigned int  )0;
 sqlcxt((void **)0, &sqlctx, &sqlstm, &sqlfpn);
}


}

/*

void GetParameter()
{
time_t  curtime;
struct  tm  *loctime;
long tmpTime;
char *tmp;

tget_month = qValue("EDU_DATE");
 if (tget_month == NULL )
{
curtime  =  time  (NULL);
loctime  =  localtime  (&curtime);
strftime (GET_MONTH, 7, "%Y%m", loctime);


}
else
{
strcpy(GET_MONTH, tget_month);
}

strncpy(tYear, GET_MONTH, 4);
strncpy(tMonth, GET_MONTH+4, 2);

curtime  =  time  (NULL);
loctime  =  localtime  (&curtime);
strftime (GET_MONTH2, 7, "%Y%m", loctime);
}*/

int trim(char s[])
{
  int n;   

  for(n=strlen(s)-1; n>=0; n–)
     if( s[n] !=’ ‘ && s[n] !=’t’ && s[n] !=’n’&& s[n]!=NULL )
         break;        

  s[n+1] = NULL ;
  return n;
}

void str_replace(char t[], char s[], char r[])
{
  int n, m, l;   

  m = 0;

for(n=0; n < strlen(s); n++)
{
  if(s[n] == 13)
{
  for (l=0; l < strlen(r); l++)
  {
  t[m] = r[l];
m++;
  }
}
else if (s[n] == 10)
{

}
else
{
  t[m] = s[n];
m++;
}
}
}


Prev : Re: php는 웹에서 C/C++의 계승자인가?
Next : NT서버에서 exe허용문제 관련질문입니다
August 20, 2002 (18:19) from 203.231.153.199
CrazyWWWBoard 98 Professional Edition II
Modify Delete Post Reply Forward List

[Home] [About] [Examples] [Changes] [Download] [Install] [Reference] [Bugs] [Q&A;]
Netchestra bizWorker