- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- C compiler error
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
тАО11-20-2005 08:09 PM
тАО11-20-2005 08:09 PM
#include
main(int argc, char **argv)
{
printf("Hello World\n");
}
HP[/c]#
HP[/c]# cc -o test test.cc
/usr/ccs/bin/ld: Can't open test.cc
/usr/ccs/bin/ld: Not found Directory and file
HP[/c]# ll
Total 80 Block
-rwxrwxrwx 1 root sys 20480 11 21 15:06 a.out
-rwxrwxrwx 1 root sys 85 11 21 12:39 test.c
HP[/c]# cc test.c
/usr/ccs/bin/ld: (Warning) At least one PA 2.0 object file (test.o) was detected. The linked output may not run on a PA
1.x system.
HP[/c]#
HP[/c]# cc -Wl,+vnocompatwarnings test.c
HP[/c]# ll
Total 80 Block.
-rwxrwxrwx 1 root sys 20480 11 21 15:08 a.out
-rwxrwxrwx 1 root sys 85 11 21 12:39 test.c
HP[/c]#
Solved! Go to Solution.
- Tags:
- cc
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-20-2005 08:22 PM
тАО11-20-2005 08:22 PM
Re: C compiler error
May be you need +PORTABLE or some similar option.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-20-2005 08:26 PM
тАО11-20-2005 08:26 PM
Re: C compiler error
aC++ installed.
no create object file. why???
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-20-2005 08:32 PM
тАО11-20-2005 08:32 PM
Re: C compiler error
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-20-2005 08:32 PM
тАО11-20-2005 08:32 PM
Re: C compiler error
I've never used cc so I don't know if it differs from gcc, but what I do is this:
gcc test.c -o test.cc
where test.c is the existing file and test.cc is the output (compiled) file.
Mark Syder (like the drink but spelt different)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-20-2005 09:02 PM
тАО11-20-2005 09:02 PM
Re: C compiler error
this command will help U
#cc -o test test.c
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-21-2005 05:31 AM
тАО11-21-2005 05:31 AM
SolutionInitially the name of the source file supplied was incorrect "test.cc" instead of "test.c" and hence the reason why cc couldn't find it. Afterwards a correct source file was supplied and the C compiler did create an executable "a.out" which is the name of the default executable created when no output file is supplied explicitly with the "-o" switch as:
# cc -o test test.cc
The compiler warned about the PA-RISC architecture version since the created executable wouldn't run on anything less than a PA-RISC2.0 machine, however you need not concern yourself with it. IMHO...your command for generating the executable should be...
HP[/c]# cc -Wl,+vnocompatwarnings test.c -o test
...or run the default executable in your working directory "a.out" as follows:
HP[/c]# ./a.out
hope it helps!!!