- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: cannot execute c-program
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
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
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-28-2006 12:24 AM
11-28-2006 12:24 AM
i want to execute my c-program:
/* time.c */
#include
#include
int main() {
time_t gmt;
(void) time (&gmt);
printf("%d\n", gmt);
}
to print the system time in seconds since 1970-01-01, but it doesn't work. i still become the error message "cannont execute"! can someone help me, please?
thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2006 12:28 AM
11-28-2006 12:28 AM
Re: cannot execute c-program
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2006 12:33 AM
11-28-2006 12:33 AM
Re: cannot execute c-program
yes the permissions set on 777 (-rwxrwxrwx)
martin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2006 12:34 AM
11-28-2006 12:34 AM
Re: cannot execute c-program
if the executable is called timer
ll timer
chmod 755 timer
To run:
./timer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2006 12:36 AM
11-28-2006 12:36 AM
Re: cannot execute c-program
#include
and I omitted include
Mark Syder (like the drink but spelt different)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2006 12:39 AM
11-28-2006 12:39 AM
Re: cannot execute c-program
the executable called time.out an i changed the permissons on 755 but it doesent work!
Error:
/sbin/sh: ./time.out: cannot execute
thanks
martin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2006 12:39 AM
11-28-2006 12:39 AM
Re: cannot execute c-program
By default, the execute bit should be set for the object created by the compilation.
What are you running? Did you name the object or let it default to 'a.out' ?
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2006 12:44 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2006 12:45 AM
11-28-2006 12:45 AM
Re: cannot execute c-program
gcc -g time.c -o time.out
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2006 12:56 AM
11-28-2006 12:56 AM
Re: cannot execute c-program
although for Linux, please step through:
http://linuxhelp.blogspot.com/2006/04/steps-to-compile-c-c-programs-using.html
On my machine:
$ gcc -g time.c -o time.out
$ ./time.out
1164722127
$ ll time.out
-rwxr-xr-x 1 godronpw users 38912 Nov 28 13:55 time.out
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2006 01:08 AM
11-28-2006 01:08 AM
Re: cannot execute c-program
file ./time.out
and
ls -l ./time.out.
and post the results.
That should indicate what is wrong.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2006 01:14 AM
11-28-2006 01:14 AM
Re: cannot execute c-program
the result is:
./time.out: ELF-32
thanks
martin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2006 01:43 AM
11-28-2006 01:43 AM
Re: cannot execute c-program
i thank you for your help. i found the problem and no it work!!
thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2006 01:46 AM
11-28-2006 01:46 AM