![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Compilation problem on HP-UX | varuntayur | High Level Programming | 1 | 02-19-2008 11:07 AM |
| Compilation problem with semtimedop | rimon | High Level Programming | 3 | 11-01-2007 02:54 AM |
| compilation problem | mansoorulhaq | SUN Solaris | 0 | 10-19-2007 05:18 AM |
| fread64 fwrite64 compilation problem (undefined symbol) | Isax50 | High Level Programming | 3 | 08-16-2005 12:26 AM |
| gcc compilation | collins | High Level Programming | 3 | 01-19-2005 09:51 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
compilation problem
i have a class name 1.c in tht i am using function n wich has his body in 2.c and declaration in 2.h
now how can i compile 1.c. ex; 1.c int main() { //some data n(10); //somedata } ***** 2.c int n(int k) { //some data } int main() { some data } ***** 2.h int n(int k); i complied the progam using command as : cc 1.c -o 1 -lm i got the error as; 1.c.text+0xd5): undefined reference to `n'. thank u, sree |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
You could do: cc 1.c 2.c -o 1 -lm, but you'll run into trouble as the two source file have both main() which should be unique in your executable 1 ...
|
|
#3
|
|||
|
|||
|
Don't get in the habit of using C++ comments in C code.
|
|||
| Google The UNIX and Linux Forums |