- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- How to compile and link the PRO*C source file in H...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-22-2005 09:59 PM
тАО05-22-2005 09:59 PM
How to compile and link the PRO*C source file in HP-UX?
Please give me some command line samples:
proc iname=test1.pc
cc -o test1.c myobj.o -IXXX -LYYY -lZZZ
I don't know which options should be used.
How to set XXX, YYY and ZZZ?
Thank you!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-22-2005 10:19 PM
тАО05-22-2005 10:19 PM
Re: How to compile and link the PRO*C source file in HP-UX?
-IXXX is a (repeated) list of include folders
cc -I/usr/local/include -I. -I/why/do/we/need/oracle/version_11/include ...
these specify the locations of where the header/include files can be found when a source file doe
#include
-LYYY indicates where the linker (ld) can find the (shared) libraries when turning the objects into executables. These will not be handled by cc, but passed to ld
cc -o test1 test1.o -L/usr/lib -L/usr/local/lib -L/still/using/oracle\?/lib ...
-lZZZ is a (repeated) list of libraries the object needs to be able to run. These (shared) libraries will be found in the locations you just specified with -L
cc -o test1 test1.o -L/usr/local/lib -lc -lm -lmysql ...
Since Oracle is a product that complies to no standards whatsoever, I cannot tell you where it is installed, nor what your flags could be. A good indication might be your environment flag $ORACLE_HOME.
All this is explained in
# man cc
and
# man ld
Sorry for the sceptic tone, but I realy realy realy don't like Oracle. It's super for end-users, but it's like hell for developers
Enjoy, Have FUN! H.Merijn
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-22-2005 10:36 PM
тАО05-22-2005 10:36 PM
Re: How to compile and link the PRO*C source file in HP-UX?
Regards.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-22-2005 10:43 PM
тАО05-22-2005 10:43 PM
Re: How to compile and link the PRO*C source file in HP-UX?
if your test1.c looks like
--8<---
int main (int argc, char *argv[])
{
return 0);
} /* main */
-->8---
You don't have to link *any* oracle libs at all. What you have to link completely depends on what functionality your C program has.
I also depends on which version of Oracle you are running, and if it is 32bit or 64bit.
It also depends on what C compiler you use
It probably also depends on the phase of the moon when I think back of all the problems I had with Oracle and migrations between all the versions of it.
A typical application at our site for HP-UX 11i in 64bit mode for Oracle-9.2 looks like
cc +DA2.0w -o /applic/bin/applic -g -L/applic/local/lib -L/junk/oracle/v920/lib here.a version.o \
-lpthread -lcl \
-lfoo -lbar -lbaz -lurk -lsys -lcurses -lclntsh -lcl -lm -lmc -lssl -lcrypto -lc -lmb -lpcre \
-lcl -lm -l:libcl.a
Does that help?
Enjoy, Have FUN! H.Merijn
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-22-2005 11:41 PM
тАО05-22-2005 11:41 PM
Re: How to compile and link the PRO*C source file in HP-UX?
I'm not sure if I understood the question but you can use the INCLUDE to tell Pro*C what directory my header files are in:
proc iname=inputfile.pc include=directory1 include=directory2...
Best Regards,
Eric Antunes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-23-2005 12:46 AM
тАО05-23-2005 12:46 AM
Re: How to compile and link the PRO*C source file in HP-UX?
-l specifies the name of the library to include.
-L (before -l option) tells the linker to search for the library in this path 1st before searching in default location
-lx is for library name libx.sl or libx.a
cf. man cc
also I suggest you check these document on Metalink regarding Pro*C :
Note:9743.1 Understanding and Modifying Precompiler and OCI Makefiles
Note:170345.1 How to Create and Use Libraries in Pro*C
Note:100741.1 Linking in User-Supplied Libraries Using Pro*C
Note:68164.1 Pro*C Makefiles in 8.0 Explained
Regards
Jean-Luc