Pro C

Este forum é destinado a perguntas relacionadas a Oracle, mas que não se enquadram nos forums acima. Aqui serão tratadas também sobre outras tecnologias da oracle, como o Workflow, BPEL, Spatial, OCS, etc.
Responder
edmilton
Rank: Estagiário Pleno
Rank: Estagiário Pleno
Mensagens: 5
Registrado em: Qui, 05 Ago 2010 5:26 pm
Localização: Campinas - SP
EDI

Olá, pessoal!

Como eu não consegui identificar outro tópico para postar a minha dúvida, escolhi este e espero não ter errado.

Ao rodar o pré-processador do Pro C, ele gera o arquivo .pc corretamente, mas não está gerando o arquivo .c para servir de entrada para o CC. Alguém tem alguma dica a respeito?

Agradeço antecipadamente por qualquer help postado.

Forte abraço a todos.
victorhugomuniz
Moderador
Moderador
Mensagens: 1396
Registrado em: Sex, 01 Fev 2008 2:06 pm
Localização: Rio de Janeiro - RJ
Contato:
:D

Demo Programs
Note: The demo programs will create and use four tables named DEPT, EMP, PAY1, and PAY2. Be careful if any table in your database happens to have the same name!

Several demo programs are available in /afs/ir/class/cs145/code/proc on the leland system. They are named sample*.pc (for C users) and cppdemo*.pc (for C++ users). ".pc" is the extension for Pro*C code. Do not copy these files manually, since there are a couple of customizations to do. To download and customize the demo programs, follow the instructions below:

1. Make sure that you have run source /afs/ir/class/cs145/all.env
2. In your home directory, run load_samples <db_username> <db_passwd> <sample_dir>, where <sample_dir> is the name of the directory where you wish to put demo programs (e.g., load_samples sally etaoinshrdlu cs145_samples)
3. cd <sample_dir>
4. Run make samples (or make cppsamples for C++) to compile all demo programs

Step (2) will set up the sample database, create a new directory as specified in <sample_dir>, and copy the demo files into that directory. It will also change the user name and password in the sample programs to be yours, so that you do not have to type in your username and password every time when running a sample program. However, sample1 and cppdemo1 do provide an interface for the user to input the username and password, in case you would like to learn how to do it.

If you happen to make any mistake when entering username or password in Step (2), just run clean_samples <db_username> <db_passwd> <sample_dir> in your home directory, and then repeat Steps (2) to (4).

For Step (4), you can also compile each sample program separately. For example, make sample1 compiles sample1.pc alone. The compilation process actually has two phases:

1. proc iname=sample1.pc

2. converts the embedded SQL code to corresponding library calls and outputs sample1.c cc <a_number_of_flags_here> sample1.c

generates the executable sample1

To compile your own code, say, foo.pc, just change a few variables in Makefile: Add the program name foo to variable SAMPLES and the source file name foo.pc to variable SAMPLE_SRC. Then, do make foo after foo.pc is ready. foo.pc will be precompiled to foo.c and then compiled to foo, the executable. C++ users will need to add their program name to CPPSAMPLES instead of SAMPLES, and source file name to CPPSAMPLE_SRC instead of SAMPLE_SRC.
fonte
edmilton
Rank: Estagiário Pleno
Rank: Estagiário Pleno
Mensagens: 5
Registrado em: Qui, 05 Ago 2010 5:26 pm
Localização: Campinas - SP
EDI

Thanks, Hugo!

I'll take advantage of the tips you have sent to me.

******************************************

Valeu, Hugo!

Vou aproveitar estas dicas que você me enviou.
Responder
  • Informação
  • Quem está online

    Usuários navegando neste fórum: Nenhum usuário registrado e 3 visitantes