10-07-2003
why the code cant work?
I'am new in C programming in UNIX.
the code is as following:
---------------------------------
#include<stdio.h>
#include<unistd.h>
int main()
{
printf("pid=%d\n",getpid());
return 0;
}
----------------------------------
when I compile it(gcc) it output errors:
Undefined first referenced
symbol in file
__gxx_personality_v0 /var/tmp//ccLAMPgc.o
ld: fatal: Symbol referencing errors. No output written to a.out
collect2: ld returned 1 exit status
I dont know why,please help me. thanks.
8 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Ok I have just started using UNIX and am trying to write a script that will ping a list that I have created in a file called ipaddesses
I need to get it to find the ip address that is not in use and do nothing however if it finds that all ip addresses have been taken to send me an e-mail!
the... (13 Replies)
Discussion started by: jono
13 Replies
2. UNIX for Dummies Questions & Answers
Howdie everyone...
I have a shell script RemoveFiles.sh
Inside this file, it only has two commands as below:
rm -f ../../reportToday/temp/*
rm -f ../../report/*
My problem is that when i execute this script, nothing happened. Files remained unremoved. I don't see any error message as it... (2 Replies)
Discussion started by: cheongww
2 Replies
3. IP Networking
I have a client machine that was built and loaded with SCO UNIX 2.1.3, (yes it is old). The machine worked fine on the closed network that I tested on in my shop. I then had to change it to the network that it would be connected to. Below is the host file, router and subnet mask file that I usually... (0 Replies)
Discussion started by: NC user
0 Replies
4. UNIX for Dummies Questions & Answers
Hi there
can anyone help me why my code is saying Badly placed ()'s.
#!/bin/csh
if ($#argv != 1) then
echo "One file is required"
exit 1
else
set lines=(`grep '404' $1 | cut -d" " -f5`)
foreach line ($lines)
printf ("Abnormal sites: %s\n", $line)
endif
thanks in advance! :) (7 Replies)
Discussion started by: FUTURE_EINSTEIN
7 Replies
5. Shell Programming and Scripting
My script work on Linux but not work in sun os.
my script.
logFiles="sentLog1.log sentLog2.log"
intial_time="0 0"
logLocation="/usr/local/tomcat/logs/"
sleepTime=600
failMessage=":: $(tput bold)Log not update$(tput rmso) = "
successMessage="OK"
arr=($logFiles)... (7 Replies)
Discussion started by: ooilinlove
7 Replies
6. Programming
Hey so I've written a program and it crashes every time I run it. I tried placing breakpoints to see what was going but to my surprise they do not work! I've placed them anywhere and they do not stop the execution of the program.
In fact if I add code and hit rebuild it doesn't even build that... (1 Reply)
Discussion started by: Cambria
1 Replies
7. Shell Programming and Scripting
I guess Mac has default bash. Then I copy my code to another comp and run it...And it gives me an error like "bad substitution"....
How I can change my code??? Never had before this kind of situation. Help please.
if
then
n=$(sort /Users/Natalie/lastserial | tail -1)
... (6 Replies)
Discussion started by: Natalie
6 Replies
8. IP Networking
hi all. and sorry for the random question, but this sparkled a raging flame-war at work and i want more points of view
situation
a router, with linux of some sort,
dhcp client requesting for ip in wan1 (as usual with wan ports)
dhcp server listening in lan1, and assigning ip (as usual... (9 Replies)
Discussion started by: broli
9 Replies
LEARN ABOUT REDHAT
annotate-output
ANNOTATE-OUTPUT(1) General Commands Manual ANNOTATE-OUTPUT(1)
NAME
annotate-output - annotate program output with time and stream
SYNOPSIS
annotate-output [options] program [args ...]
DESCRIPTION
annotate-output will execute the specified program, while prepending every line with the current time and O for stdout and E for stderr.
OPTIONS
+FORMAT
Controls the timestamp format, as per date(1). Defaults to "%H:%M:%S".
-h, --help
Display a help message and exit successfully.
EXAMPLE
$ annotate-output make
21:41:21 I: Started make
21:41:21 O: gcc -Wall program.c
21:43:18 E: program.c: Couldn't compile, and took me ages to find out
21:43:19 E: collect2: ld returned 1 exit status
21:43:19 E: make: *** [all] Error 1
21:43:19 I: Finished with exitcode 2
BUGS
Since stdout and stderr are processed in parallel, it can happen that some lines received on stdout will show up before later-printed
stderr lines (and vice-versa).
This is unfortunately very hard to fix with the current annotation strategy. A fix would involve switching to PTRACE'ing the process.
Giving nice a (much) higher priority over the executed program could however cause this behaviour to show up less frequently.
The program does not work as well when the output is not linewise. In particular, when an interactive program asks for input, the question
might not be shown until after you have answered it. This will give the impression that the annotated program has hung, while it has not.
SEE ALSO
date(1)
SUPPORT
This program is community-supported (meaning: you'll need to fix it yourself). Patches are however appreciated, as is any feedback (posi-
tive or negative).
AUTHOR
annotate-output was written by Jeroen van Wolffelaar <jeroen@wolffelaar.nl> This manpage comes under the same copyright as annotate-output
itself, read /usr/bin/annotate-output (or wherever you install it) for the details.
DEBIAN
Debian Utilities ANNOTATE-OUTPUT(1)