hey guys i m finding it difficult to link the different files together in c..
here is my code...

//main.c
#include <stdio.h>
#include "other.h"

int main (void)
{
    printf("%d\n", getfavorite());

    return 0;
}
//other.h
#ifndef _OTHER_H
#define _OTHER_H
int getfavorite(void);
#endif
//other.c
#include "other.h"

int getfavorite (void)
{
    return 3;
}

but it always shows me this error...
Linker Error: Undefined Symbol getfavorite() in module MAIN.C

can nyone plz help me out in this..i m using Turbo c++...

Recommended Answers

All 5 Replies

what compiler and/or IDE are you using and what operating system ? How to link two or more *.c object files will depend on the compiler and/or IDE.

i m using turbo c++ and windows xp....can u plz tell me looking at ma code that why is it showing that error....

i did the same thing...but still showing the same error....can u just tell me a step by step procedure..plzz...

>>can u just tell me a step by step procedure..plzz...
Nope -- I can't help you with that because I don't use that ancient crappy compiler. Its possible the version of the compiler you have doesn't support multiple files.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.