LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 09-24-2009, 10:43 AM   #1
eljuventino
LQ Newbie
 
Registered: May 2009
Posts: 26
Blog Entries: 1

Rep: Reputation: 15
cpp command for .pc file


hello everyone !!!i'm here again for he help and i'm grateful for all the members that help me go on with my project!!i'm porting a product from aix system to linux rhel5 system !!

i'm compiling withy gcc and i'm using pro*C for precompiling!!
i have in one of the makefiles that i have to compile .pc file with cpp then put the reslt of this command in ...tmp.pc than precompile this one with pro*C :

1- do a cpp command to .pc file.
2-put the result of this command to ...tmp.pc file.
3-precompile with pro*C the ...tmp.pc file.

is that possible to do a cpp command to a .pc file ?

anyway i execute the cpp command to the .pc file
then this result :

Code:
# 1 "su_lgm_lib_commit.pc"
# 1 "<interne>"
# 1 "<ligne de commande>"
# 1 "su_lgm_lib_commit.pc"
# 22 "su_lgm_lib_commit.pc"
# 1 "/usr/local/oracle/9.2.0/precomp/public/sqlca.h" 1
# 59 "/usr/local/oracle/9.2.0/precomp/public/sqlca.h"
struct sqlca
         {
                   char sqlcaid[8];
                   int sqlabc;
                   int sqlcode;
         struct
           {
                     unsigned short sqlerrml;
                     char sqlerrmc[70];
           } sqlerrm;
                   char sqlerrp[8];
                   int sqlerrd[6];
                   char sqlwarn[8];
                   char sqlext[8];
         };





         struct sqlca sqlca
# 94 "/usr/local/oracle/9.2.0/precomp/public/sqlca.h"
         ;
# 23 "su_lgm_lib_commit.pc" 2
# 1 "su_lgm.h" 1
# 18 "su_lgm.h"
# 1 "/home/oracle/Open2/syu/inc/su_globals.h" 1
# 22 "/home/oracle/Open2/syu/inc/su_globals.h"
static char globals_h[]="@(#)$Workfile:   su_globals.h  $,$Revision: 2.1 $,$Modtime:   30 Jan 2003 15:36:32  $";
static char su_globals_h[] = "@(#)## su_globals.h 02.00.00 17/07/97 $Revision: 2.1 $";
# 19 "su_lgm.h" 2
# 1 "/home/oracle/Open2/syu/inc/su_logclass.h" 1
# 21 "/home/oracle/Open2/syu/inc/su_logclass.h"
static char logclass_h[]="@(#)$Workfile:   su_logclass.h  $,$Revision: 2.1 $,$Modtime:   05 Feb 2003 11:39:48  $";
static char su_logclass_h[] = "@(#)## su_logclass.h 02.01.01 07/10/97 $Revision: 2.1 $";
# 20 "su_lgm.h" 2
#include "/usr/include/stdio.h"
#include "/usr/include/features.h" 
#include "/usr/include/sys/cdefs.h"
#include "/usr/include/bits/wordsize.h 
#include/usr/include/gnu/stubs.h"



# 1 "/usr/include/bits/wordsize.h" 1 3 4
# 5 "/usr/include/gnu/stubs.h" 2 3 4


# 1 "/usr/include/gnu/stubs-32.h" 1 3 4
# 8 "/usr/include/gnu/stubs.h" 2 3 4
# 353 "/usr/include/features.h" 2 3 4
# 29 "/usr/include/stdio.h" 2 3 4
...
after that the precompilatin with pro*C and i got those errors:

Code:
Pro*C/C++: Release 9.2.0.4.0 - Production on Thu Sep 24 13:21:37 2009

Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.

Error at line 0, column 0 in file su_lgm_lib_commit_tmp.pc
PCC-F-02102, Fatal error while doing C preprocessing
Error at line 44, column 30 in file su_lgm_lib_commit_tmp.pc
    44  # 1 "/usr/include/stdio.h" 1 3 4
    44  .............................1
    44  PCC-S-02014, Encountered the symbol "3" when expecting one of the follo
        wing:
        
           newline,
        
Error at line 45, column 31 in file su_lgm_lib_commit_tmp.pc
    45  # 28 "/usr/include/stdio.h" 3 4
    45  ..............................1
    45  PCC-S-02014, Encountered the symbol "4" when expecting one of the follo
        wing:
        
           newline,
        
Error at line 46, column 33 in file su_lgm_lib_commit_tmp.pc
    46  # 1 "/usr/include/features.h" 1 3 4
    46  ................................1
    46  PCC-S-02014, Encountered the symbol "3" when expecting one of the follo
        wing:
        
           newline,
        
Error at line 47, column 35 in file su_lgm_lib_commit_tmp.pc
    47  # 329 "/usr/include/features.h" 3 4
    47  ..................................1
    47  PCC-S-02014, Encountered the symbol "4" when expecting one of the follo
        wing:
        
           newline,
        
Error at line 48, column 34 in file su_lgm_lib_commit_tmp.pc
    48  # 1 "/usr/include/sys/cdefs.h" 1 3 4
    48  .................................1
    48  PCC-S-02014, Encountered the symbol "3" when expecting one of the follo
        wing:
        
           newline,
        
Error at line 49, column 36 in file su_lgm_lib_commit_tmp.pc
    49  # 313 "/usr/include/sys/cdefs.h" 3 4
    49  ...................................1
    49  PCC-S-02014, Encountered the symbol "4" when expecting one of the follo
        wing:
        
           newline,
        
Error at line 50, column 38 in file su_lgm_lib_commit_tmp.pc
    50  # 1 "/usr/include/bits/wordsize.h" 1 3 4
    50  .....................................1
    50  PCC-S-02014, Encountered the symbol "3" when expecting one of the follo
        wing:
        
           newline,
        
Error at line 51, column 36 in file su_lgm_lib_commit_tmp.pc
    51  # 314 "/usr/include/sys/cdefs.h" 2 3 4
    51  ...................................1
    51  PCC-S-02014, Encountered the symbol "3" when expecting one of the follo
        wing:
        
           newline,
        
Error at line 52, column 35 in file su_lgm_lib_commit_tmp.pc
    52  # 330 "/usr/include/features.h" 2 3 4
    52  ..................................1
    52  PCC-S-02014, Encountered the symbol "3" when expecting one of the follo
        wing:
        
           newline,
obviously all those problem are because the precompile doesn't understand 1 23 near the .h file i tried to replace those number with include it works and the errors goes away but it's evident it's not the correct solution!!

finally i tried to precompile directly the .pc file it works but the problem but i don't undersatn why the creators of the product do this when they compile the code in AIX.

i hope that u can help me with this!!!
any idea that can help me with this
 
Old 09-24-2009, 01:09 PM   #2
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Rep: Reputation: 454Reputation: 454Reputation: 454Reputation: 454Reputation: 454
Quote:
Originally Posted by eljuventino View Post
hello everyone !!!i'm here again for he help and i'm grateful for all the members that help me go on with my project!!i'm porting a product from aix system to linux rhel5 system !!

i'm compiling withy gcc and i'm using pro*C for precompiling!!
i have in one of the makefiles that i have to compile .pc file with cpp then put the reslt of this command in ...tmp.pc than precompile this one with pro*C :

1- do a cpp command to .pc file.
2-put the result of this command to ...tmp.pc file.
3-precompile with pro*C the ...tmp.pc file.

is that possible to do a cpp command to a .pc file ?

anyway i execute the cpp command to the .pc file
then this result :

Code:
# 1 "su_lgm_lib_commit.pc"
# 1 "<interne>"
# 1 "<ligne de commande>"
# 1 "su_lgm_lib_commit.pc"
# 22 "su_lgm_lib_commit.pc"
# 1 "/usr/local/oracle/9.2.0/precomp/public/sqlca.h" 1
# 59 "/usr/local/oracle/9.2.0/precomp/public/sqlca.h"
struct sqlca
         {
                   char sqlcaid[8];
                   int sqlabc;
                   int sqlcode;
         struct
           {
                     unsigned short sqlerrml;
                     char sqlerrmc[70];
           } sqlerrm;
                   char sqlerrp[8];
                   int sqlerrd[6];
                   char sqlwarn[8];
                   char sqlext[8];
         };





         struct sqlca sqlca
# 94 "/usr/local/oracle/9.2.0/precomp/public/sqlca.h"
         ;
# 23 "su_lgm_lib_commit.pc" 2
# 1 "su_lgm.h" 1
# 18 "su_lgm.h"
# 1 "/home/oracle/Open2/syu/inc/su_globals.h" 1
# 22 "/home/oracle/Open2/syu/inc/su_globals.h"
static char globals_h[]="@(#)$Workfile:   su_globals.h  $,$Revision: 2.1 $,$Modtime:   30 Jan 2003 15:36:32  $";
static char su_globals_h[] = "@(#)## su_globals.h 02.00.00 17/07/97 $Revision: 2.1 $";
# 19 "su_lgm.h" 2
# 1 "/home/oracle/Open2/syu/inc/su_logclass.h" 1
# 21 "/home/oracle/Open2/syu/inc/su_logclass.h"
static char logclass_h[]="@(#)$Workfile:   su_logclass.h  $,$Revision: 2.1 $,$Modtime:   05 Feb 2003 11:39:48  $";
static char su_logclass_h[] = "@(#)## su_logclass.h 02.01.01 07/10/97 $Revision: 2.1 $";
# 20 "su_lgm.h" 2
#include "/usr/include/stdio.h"
#include "/usr/include/features.h" 
#include "/usr/include/sys/cdefs.h"
#include "/usr/include/bits/wordsize.h 
#include/usr/include/gnu/stubs.h"



# 1 "/usr/include/bits/wordsize.h" 1 3 4
# 5 "/usr/include/gnu/stubs.h" 2 3 4


# 1 "/usr/include/gnu/stubs-32.h" 1 3 4
# 8 "/usr/include/gnu/stubs.h" 2 3 4
# 353 "/usr/include/features.h" 2 3 4
# 29 "/usr/include/stdio.h" 2 3 4
...
after that the precompilatin with pro*C and i got those errors:

Code:
Pro*C/C++: Release 9.2.0.4.0 - Production on Thu Sep 24 13:21:37 2009

Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.

Error at line 0, column 0 in file su_lgm_lib_commit_tmp.pc
PCC-F-02102, Fatal error while doing C preprocessing
Error at line 44, column 30 in file su_lgm_lib_commit_tmp.pc
    44  # 1 "/usr/include/stdio.h" 1 3 4
    44  .............................1
    44  PCC-S-02014, Encountered the symbol "3" when expecting one of the follo
        wing:
        
           newline,
        
Error at line 45, column 31 in file su_lgm_lib_commit_tmp.pc
    45  # 28 "/usr/include/stdio.h" 3 4
    45  ..............................1
    45  PCC-S-02014, Encountered the symbol "4" when expecting one of the follo
        wing:
        
           newline,
        
Error at line 46, column 33 in file su_lgm_lib_commit_tmp.pc
    46  # 1 "/usr/include/features.h" 1 3 4
    46  ................................1
    46  PCC-S-02014, Encountered the symbol "3" when expecting one of the follo
        wing:
        
           newline,
        
Error at line 47, column 35 in file su_lgm_lib_commit_tmp.pc
    47  # 329 "/usr/include/features.h" 3 4
    47  ..................................1
    47  PCC-S-02014, Encountered the symbol "4" when expecting one of the follo
        wing:
        
           newline,
        
Error at line 48, column 34 in file su_lgm_lib_commit_tmp.pc
    48  # 1 "/usr/include/sys/cdefs.h" 1 3 4
    48  .................................1
    48  PCC-S-02014, Encountered the symbol "3" when expecting one of the follo
        wing:
        
           newline,
        
Error at line 49, column 36 in file su_lgm_lib_commit_tmp.pc
    49  # 313 "/usr/include/sys/cdefs.h" 3 4
    49  ...................................1
    49  PCC-S-02014, Encountered the symbol "4" when expecting one of the follo
        wing:
        
           newline,
        
Error at line 50, column 38 in file su_lgm_lib_commit_tmp.pc
    50  # 1 "/usr/include/bits/wordsize.h" 1 3 4
    50  .....................................1
    50  PCC-S-02014, Encountered the symbol "3" when expecting one of the follo
        wing:
        
           newline,
        
Error at line 51, column 36 in file su_lgm_lib_commit_tmp.pc
    51  # 314 "/usr/include/sys/cdefs.h" 2 3 4
    51  ...................................1
    51  PCC-S-02014, Encountered the symbol "3" when expecting one of the follo
        wing:
        
           newline,
        
Error at line 52, column 35 in file su_lgm_lib_commit_tmp.pc
    52  # 330 "/usr/include/features.h" 2 3 4
    52  ..................................1
    52  PCC-S-02014, Encountered the symbol "3" when expecting one of the follo
        wing:
        
           newline,
obviously all those problem are because the precompile doesn't understand 1 23 near the .h file i tried to replace those number with include it works and the errors goes away but it's evident it's not the correct solution!!

finally i tried to precompile directly the .pc file it works but the problem but i don't undersatn why the creators of the product do this when they compile the code in AIX.

i hope that u can help me with this!!!
any idea that can help me with this
AFAIK .pc files are the ones used by 'pkg-config' - have you tried

man 1 pkg-config

?

If yes, have you read the DESCRIPTION part (line #13 in my case) ?

The part gives a typical command line.


Maybe in your case .pc files are used for something else - I don't know.
 
Old 09-24-2009, 01:24 PM   #3
eljuventino
LQ Newbie
 
Registered: May 2009
Posts: 26

Original Poster
Blog Entries: 1

Rep: Reputation: 15
.pc is an extension for the file that can precompild with pro*C!!!
 
Old 09-25-2009, 12:10 AM   #4
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,348

Rep: Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749
When I used to work with Pro*C, you wrote your C and SQL code into a .pc file, then the Oracle Pre-compiler converted the Oracle stuff into pure C (ie you get a *.c file), then you used a normal C compiler to compile and link.
Your 1st post sounds like you're trying to compile, then pre-compile.
 
Old 09-25-2009, 04:16 AM   #5
eljuventino
LQ Newbie
 
Registered: May 2009
Posts: 26

Original Poster
Blog Entries: 1

Rep: Reputation: 15
Quote:
Originally Posted by chrism01 View Post
When I used to work with Pro*C, you wrote your C and SQL code into a .pc file, then the Oracle Pre-compiler converted the Oracle stuff into pure C (ie you get a *.c file), then you used a normal C compiler to compile and link.
Your 1st post sounds like you're trying to compile, then pre-compile.
yeah that's what i did all the time !!but now in the makefile where i try to lauch first it compile the .pc file with the command cpp then the makefile launch the command to precompile with pro*C to get in the final the pure C .*
the problem that i'm try to port the product and those makefile which are prepared for compiling its better to not modify it.that's the problem for me .the main question is :can we launch the cpp command ion .pc file ?
if that possible what's the idea for doing it ?
or can i just do what i usually do that i precompile .pc file then compile it with gcc?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
command for create EXE for .cpp program in vista hai12345 General 2 08-19-2008 03:21 AM
using bash find command to list *.h and *.cpp wgillett Linux - Software 3 12-15-2005 11:55 AM
How to compile a C++ file (.cpp) with allegro? RHLinuxGUY Programming 5 11-29-2005 02:06 AM
debian dpkg cpp depends on cpp error darkleaf Linux - Software 2 06-25-2004 01:47 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:42 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration