undefined reference error

Please support our C advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Nov 2007
Posts: 4
Reputation: chico1st is an unknown quantity at this point 
Solved Threads: 0
chico1st chico1st is offline Offline
Newbie Poster

undefined reference error

 
0
  #1
May 21st, 2008
Hi I am getting an undefined reference error from my code
here is a snippet of my code.

  1. #include <stdio.h>
  2. #include <windows.h>
  3.  
  4. //defining functions
  5. void ErrorFunc(int error);
  6.  
  7. int error = 0;
  8.  
  9. int main(void){
  10. return 0;
  11. }
  12.  
  13. void ErrorFunc(int error)
  14. {
  15. FunctionFromALibrary(error);
  16. }
I am using DEVC++ 5 and I have included the library that I need to use in the project-project options-parameters - linker
there i have:
  1. thisLibrary.lib
  2. -lmingw32

I also added that directory in
project-project options-directory-directories-library directories

it is at least partially linked because if i hold my mouse of the
FunctionFromALibrary()
DEVC++ will show me the prototype
Last edited by chico1st; May 21st, 2008 at 4:02 pm.
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 4
Reputation: chico1st is an unknown quantity at this point 
Solved Threads: 0
chico1st chico1st is offline Offline
Newbie Poster

Re: undefined reference error

 
0
  #2
May 21st, 2008
ok well i solved this question by switching to visual c++ 2008
but i dont like it
Reply With Quote Quick reply to this message  
Join Date: Dec 2005
Posts: 5,850
Reputation: Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute 
Solved Threads: 749
Team Colleague
Salem's Avatar
Salem Salem is offline Offline
Void main'ers are DOOMed

Re: undefined reference error

 
0
  #3
May 21st, 2008
thisLibrary.lib
-lmingw32

You need to check the naming convention, and whether (or not) you need the initial -l
For example, saying mingw32 could really mean libmingw32.lib

Any libraries of your own would need to follow the same naming convention.
Reply With Quote Quick reply to this message  
Join Date: May 2008
Posts: 65
Reputation: lich has a little shameless behaviour in the past 
Solved Threads: 4
lich lich is offline Offline
Junior Poster in Training

Re: undefined reference error

 
0
  #4
May 23rd, 2008
check the names are correct.. the library names.. check it correctly
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC