8 Replies Latest reply: May 25, 2005 9:28 AM by Ronald Rood RSS

    proc and xcode 2

    Ronald Rood
      Hi, at the moment I try to make fun in xcode. Fun is a little proc commandline program that dumps tables to sqlloader data and control files. I could use a bit of help with xcode for this. The code already compiles by creating an aggregate target for fun.c that gets generated from fun.pc but I fail to configure the link phase for it.
      This is what I get
      ZeroLink: unknown symbol '_iaprval'

      I know it has to do with not having linked sqllib.
      1) how can I verify this ?
      2) how can I solve this ?

      thanks,
      Ronald
      http://homepage.mac.com/ik_zelf/oracle
        • 1. Re: proc and xcode 2
          386814
          Hi Ronald

          I have successfully compiled and executed Pro*C programs like the one you describe on OS X. I have not encountered any problems or bugs so far.

          However, I created the source files in a text editor and used a make file. (I can email you the make file if you want).

          The line in the make file that links in the Oracle libraries adds the following to the compiler command cc:
          -L$(ORACLE_HOME)/lib -Lusr/lib -lclntsh

          I suspect the -lclntsh is what you have missing. The critical thing there is that in $ORACLE_HOME/lib there is a file called libclntsh.dylib which is a symbolic link to the file $ORACLE_HOME/lib/libclntsh.dylib.10.1 you need to be certain this set up and readable.

          In addition I have the header files "sqlca.h" and "sqlda.h" #include in my source file and present in my local directory.

          I assume you just need to make sure that Xcode is including these libraries in it's link command.

          I hope this helps

          Paul
          • 2. Re: proc and xcode 2
            Ronald Rood
            Hi, thanks for your reaction Paul,
            I assume you just need to make sure that Xcode is including these libraries > in it's link command.
            I think this is the problem. How do I make xcode to use those libs ? This should be easy ...

            best regards,
            Ronald
            http://ronr.nl/unix-dba
            • 3. Re: proc and xcode 2
              386814
              Ronald

              sorry I have not been able to respond before now. I have not used Xcode yet for development. I may have a stab at it over the weekend.

              What have you tried in Xcode so far. Please tell me so I don't re-invent the wheel or waste time with stuff you have established does not work.

              How did yuou tell Xcode about a ProC source file and how to structure/colour it etc - presumably you told it to treat it same as a C source file? I was expecting to look for option/preferences or anywhere that I can tell it about libraries and try entering Oracle libraries that I am familiar with and that I know ProC linking will need.

              Paul
              • 4. Re: proc and xcode 2
                Ronald Rood
                Hi Paul,
                I also opened a thread in the xcode-users list see http://lists.apple.com/archives/xcode-users/2005/May/msg00608.html
                and got a few tips I have yet to try out. Hopefully somewhere in the weekend.
                drop me a mail and I return you my project file. My current problem is the link phase. For the precompilation I created an aggregate target, dependent on the proc code with a rule that just runs a script, in this case one that kicks proc.

                thanks,
                Ronald
                http://homepage.mac.com/ik_zelf/oracle
                • 5. Re: proc and xcode 2
                  Ronald Rood
                  Paul,
                  I just uploaded FUN.zip in the oracle directory in
                  http://homepage.mac.com/ik_zelf/oracle/FileSharing10.html

                  the code is not very pretty but it works, if the loader problem is solved.
                  Still have the unknown symbol in it.

                  [Session started at 2005-05-20 22:18:17 +0200.]
                  Usage FUN uid/pwd table_name[s]
                  Userid=[ronr]
                  ZeroLink: unknown symbol '_iaprval'

                  You also need a little script in $HOME/bin/run_proc containing
                  =========================================
                  #!/bin/ksh
                  . ${HOME}/.bash_profile
                  ${ORACLE_HOME}/bin/proc include=${ORACLE_HOME}/rdbms/public iname=${INPUT_FILE_NAME}
                  =========================================
                  There are some hard coded userid/pwd in the source to make debugging a little easier.

                  Ronald.
                  http://ronr.nl/unix-dba
                  • 6. Re: proc and xcode 2
                    Ronald Rood
                    I still have no luck linking the program. The _iaprval is defined in libsql.a. which is in my project, together with libclntsh.dylib. Still I get:

                    [Session started at 2005-05-24 21:12:57 +0200.]
                    Usage FUN uid/pwd table_name[s]
                    Userid=[ronr]
                    ZeroLink: unknown symbol '_iaprval'

                    fun has exited due to signal 6 (SIGABRT).

                    What does 'ZeroLink' mean ?

                    Ronald.
                    http://homepage.mac.com/ik_zelf/oracle
                    • 7. Re: proc and xcode 2 - got it !
                      Ronald Rood
                      Disable ZEROLINK
                      Disable PREBIND
                      Drag $ORACLE_HOME/lib into the project and make it relative to SOURCE_TREE - ORACLE_HOME

                      add ${ORACLE_HOME}/lib /usr/lib to Library Search Paths
                      compile & go !.

                      Thanks for help,
                      Ronald
                      http://homepage.mac.com/ik_zelf/oracle
                      • 8. Re: proc and xcode 2 - got it !
                        Ronald Rood
                        Forgot about removing *.zip, *.jar *.o references from lib/