- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- C printf code not appearing
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
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
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
тАО10-14-2010 07:31 AM
тАО10-14-2010 07:31 AM
The program is below:
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
main()
{
char user_id[30];
char password[30];
char server_name[30] ;
strcpy(user_id, "XXX");
strcpy(password, "XXX");
strcpy(server_name, "XXX");
printf("user_id %s\n", user_id);
printf("password %s\n", password);
printf("server_name %s\n", server_name);
Return 0;
}
Solved! Go to Solution.
- Tags:
- PRM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-14-2010 07:52 AM
тАО10-14-2010 07:52 AM
Re: C printf code not appearing
Other than the typo for "Return" and the lack of int for main, the program seems fine.
What HP-UX version are you using? What architecture? What compiler version?
Still Integrity 11.31?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-14-2010 08:22 AM
тАО10-14-2010 08:22 AM
Re: C printf code not appearing
Here is the Makefile I am using:
include /u01/app/oracle/product/11.2.0/db_1/precomp/lib/env_precomp.mk
CFLAGS=-D_USE_BIG_FDS -Ae -DHPUX -DORAIA64 -DHPUX_IA64 +DD64 -DSS_64B \
-IT_SERVER -DHPPA64 -DSLS8NATIVE -DSLU8NATIVE +DD64 -DSS_64BIT_SERVER
all: test
test: test.o
$(CC) -o test test.o -L $(LIBHOME) $(PROLDLIBS)
test.o: test.c
$(CC) $(CFLAGS) $(PRECOMPPUBLIC) -c test.c
test.c: test.pc
$(PROC) $(PROCPLSFLAGS) iname=test.pc
clean:
rm -f test.o testlog.o test.c
cleanall: clean
rm -f test
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-14-2010 04:50 PM
тАО10-14-2010 04:50 PM
Re: C printf code not appearing
> [...]
That's "test.pc"?
> [...] The file is a ProC file (test.pc)
"The file" is the same as "The program"?
Some of us lack Oracle, making it tough to
see what's happening here. Care to exhibit
"test.c"? (Have _you_ looked at it?)
> [...] I do not know the compiler version,
> but I am using cc. [...]
uname -a
cc -V
> [...] $(LIBHOME) $(PROLDLIBS)
> [...] $(PRECOMPPUBLIC) [...]
Can't see those macros from here, either.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-14-2010 06:27 PM
тАО10-14-2010 06:27 PM
Re: C printf code not appearing
Reduce, try, expand, retry.
You might be building/running the wrong thing.
Try this.... just feed it into cc and execute a.out
---
#include
#include
main()
{
char user_id[30];
strcpy(user_id, "XXX");
printf("user_id %s\n", user_id);
}
That works right?
Now feed it to pro*c, then cc. ... still works?
Add some switches... still works?
Use the make file.
Check with ls -ltr test.*
Every thing in 'order' and build as expected?
Good luck!
btw... what is 'Return' ? typo?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-14-2010 07:39 PM
тАО10-14-2010 07:39 PM
Re: C printf code not appearing
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-18-2010 04:07 AM
тАО10-18-2010 04:07 AM
Solutiontype test
it will respond with (at least on my system it does) "test is a shell builtin.". So your program never gets executed. Try running it with: ./test or call it something else.
- Tags:
- Test
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-18-2010 04:20 AM
тАО10-18-2010 04:20 AM
Re: C printf code not appearing
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-18-2010 10:18 AM
тАО10-18-2010 10:18 AM
Re: C printf code not appearing
One of the advantages to showing actual
commands with their actual output is that
other people can see your actual mistakes.
If all you say is that you ran your program,
then many people will assume that you
actually did what you said that you did.
This may force you to wait for someone to
guess what you did (wrong), which is often
not the fastest path to the answer.