473,395 Members | 1,348 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

undefine sysbol comm_init(int)

4
i use borland c programing for adam-4500. My code:
#include"adam4500.h"
void main(void)
{
if (!comm_init (1000))
{
printf(" initialization failed!");
delay(1000);
exit();
}
}
i took all files into example1 directory : inc and lib directories of turbo c, and adam4500.h header file . when i compile it not error and not warring, but when i build all it has one error :
linker error: undefined symbol comm_init(int) in module TIEP.CPP
can you help me repair this error!
Nov 11 '10 #1
7 2139
mac11
256 100+
The linker can't find the code to link for the comm_init function. Where's the code for it? Is it supposed to come from adam4500? If so, maybe you need to make sure it's being compiled and linked in (and not just #included).

Otherwise, if the function is in a different file you need to #include and compile/link it.
Nov 11 '10 #2
dubes
4
yes, adam4500.h isn't a header file of borland c. I have linked to the directory containing the header files . but this error msg still appear.
Nov 12 '10 #3
Banfa
9,065 Expert Mod 8TB
The header files only tell the compiler that the functions exist, the contain declarations of the function. The linker will need the definition (the actual code) of the function.

If you have a header file (adam4500.h) containing the function declaration then you should also have a library (.lib or .a) or possibly an object (.o or .obj) containing the definition of the function that needs to be supplied to the linker.
Nov 12 '10 #4
dubes
4
thank you.i added all .lib files of adam into directory and linked to that directory. but error message still appear. i don't know how i should do.
Nov 12 '10 #5
Banfa
9,065 Expert Mod 8TB
Look up the documentation of that function and see which library it says you need to use.
Nov 12 '10 #6
dubes
4
yes, i looked up and added library that i need to use into directory. but still not right. so i added all file in library of adam. and the result remain the same.
Nov 12 '10 #7
Banfa
9,065 Expert Mod 8TB
You do not need to add the libraries to your source directory, you should leave them where they were installed.

You need to add the libraries (and possibly a library path) to your linker command.
Nov 12 '10 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

30
by: john | last post by:
I have a similar code to the following, here is the simplified version. I didn't compile and run the following code, so don't worry about the syntax. My question is I memcpy a larger data (10Byte)...
18
by: Bryan Parkoff | last post by:
"#define" can only be inside the global scope before main() function. "#if" can be tested after "#define" is executed. The problem is that "#define" can't be inside main() function. I do not wish...
9
by: xuatla | last post by:
compile error: test1.cpp:21: error: ISO C++ says that `T mtd::CDiffOperator::getdp(const mtd::mVector&, long int, mtd::mBCTYPE) const' and `void mtd::CDiffOperator::getdp(mtd::mVector&, const...
17
by: sounak | last post by:
How could we get a macro name from a macro value such that in a header file #define a 100 #define b 200 now the source file will be such that the user gives 100 then the value is outputted as...
34
by: Zahid Faizal | last post by:
Kindly suggest a good opensource package (in C or C++) that can compute the checksum of a file. SHA2 would be preferable, but SHA1/SHA0/MD5 would be acceptable as well. We have cards with...
7
by: Alden Pierre | last post by:
Hello, I'm trying to create my own user define container, but I'm having a little hard time figuring out why is my class considered undefined by my compiler. Here is the following code. //...
1
by: angelcd | last post by:
hi guys, i have this program but it wont compile on DEV C++, it compiles on Borland actually, my compiler say: undefine reference hms (long, long*,long*,long) ld return 1 exit status can...
2
by: =?Utf-8?B?bWFyaw==?= | last post by:
I am contemplating converting a huge collection of functions from C++ to VB.NET. I am concerned with a style used in the original code where a variable is set to a constant value with the # define...
6
by: Pietro Cerutti | last post by:
Hi Group, is there a mean to undefine a function, in a similar way as you can undefine macros? For example, let's say that I need a few declarations from stdio.h but want to define my own...
3
by: rorybr | last post by:
hi, i'm trying to import an unmanaged dll into a c# application. The dll is given to me but i'm new with dll import thing and having some troubles importing it. Dll comes with a pdf file which...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.