Go4Expert

Go4Expert (http://www.go4expert.com/)
-   C (http://www.go4expert.com/forums/c/)
-   -   Undefined Symbols (http://www.go4expert.com/forums/undefined-symbols-t6386/)

KyraiSt 17Sep2007 12:30

Undefined Symbols
 
Let me just start out by saying that I am not a total newbie to programming but I am a complete newb to C.
I'm trying to start an assignment for uni today and I'm running into a problem compiling the source code that they have provided for me. I'm getting these error messages when compiling using DMC.

my_find.obj(my_find)
Error 42: Symbol Undefined _optind
my_find.obj(my_find)
Error 42: Symbol Undefined _optarg
my_find.obj(my_find)
Error 42: Symbol Undefined _getopt_long_only

These errors are arising in trying to use code from the include file getopt.h. I am doing this work on windows XP and have remembered to download and include the getopt.h file in the include files directory of dmc.

Any assistance in solving this problem would be greatly appreciated.

DaWei 17Sep2007 18:30

Re: Undefined Symbols
 
Those look like they're probably link errors. It takes more than the header file. You have to link in the object file (library file) associated with the header. See the docs for your compiler/linker.


All times are GMT +5.5. The time now is 11:24.