stdlib.h error?

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Mar 2008
Posts: 40
Reputation: midimatt is an unknown quantity at this point 
Solved Threads: 2
midimatt's Avatar
midimatt midimatt is offline Offline
Light Poster

stdlib.h error?

 
0
  #1
Dec 31st, 2008
Hello everyone,

got a really strange and annoying error. When i compile my program i get 2 errors and 2 warnings all 4 to do with stdlib.h

error C2381: 'exit' : redefinition; __declspec(noreturn) differs c:\program files\microsoft visual studio 9.0\vc\include\stdlib.h 371

i did a little research on the problem and found it was something to do with a conflict between glut and stdlib so i did what they asked me to do add GLUT_BUILDING_LIB to the preprocessors.

compiled again this time with 72 errors and 11 warnings

all 72 of the errors are linking errors

Error 61 error LNK2019: unresolved external symbol _glutIdleFunc@4 referenced in function "private: void __thiscall Viewer::GLInit(void)" (?GLInit@Viewer@@AAEXXZ)

i'm really stumped as to what needs to be done

-midi
Reply With Quote Quick reply to this message  
Join Date: Apr 2008
Posts: 670
Reputation: Freaky_Chris is a jewel in the rough Freaky_Chris is a jewel in the rough Freaky_Chris is a jewel in the rough 
Solved Threads: 113
Freaky_Chris's Avatar
Freaky_Chris Freaky_Chris is offline Offline
Practically a Master Poster

Re: stdlib.h error?

 
0
  #2
Dec 31st, 2008
Sounds to me like you need to link the required libraries into your project ready for linking

Chris
Knowledge is power -- But experience is everything
Reply With Quote Quick reply to this message  
Join Date: Mar 2008
Posts: 40
Reputation: midimatt is an unknown quantity at this point 
Solved Threads: 2
midimatt's Avatar
midimatt midimatt is offline Offline
Light Poster

Re: stdlib.h error?

 
0
  #3
Dec 31st, 2008
would you care to explain that in a little more detail?

my program was working fine no linker errors untill i added GLUT into the processors list.

but if i dont have that in there then i get errors with the exit function in stblib. Even though i'm not using exit.

-matt
Reply With Quote Quick reply to this message  
Join Date: Apr 2008
Posts: 670
Reputation: Freaky_Chris is a jewel in the rough Freaky_Chris is a jewel in the rough Freaky_Chris is a jewel in the rough 
Solved Threads: 113
Freaky_Chris's Avatar
Freaky_Chris Freaky_Chris is offline Offline
Practically a Master Poster

Re: stdlib.h error?

 
0
  #4
Dec 31st, 2008
From what i am understanding adding this
GLUT_BUILDING_LIB
Fixed the original problem. Now you are trying to compile glut code. To do this not only do you need to include the header files but also the library files....you need to tell the linker which library files it will need.

Chris
Knowledge is power -- But experience is everything
Reply With Quote Quick reply to this message  
Join Date: Mar 2008
Posts: 40
Reputation: midimatt is an unknown quantity at this point 
Solved Threads: 2
midimatt's Avatar
midimatt midimatt is offline Offline
Light Poster

Re: stdlib.h error?

 
0
  #5
Dec 31st, 2008
Originally Posted by Freaky_Chris View Post
From what i am understanding adding this
GLUT_BUILDING_LIB
Fixed the original problem. Now you are trying to compile glut code. To do this not only do you need to include the header files but also the library files....you need to tell the linker which library files it will need.

Chris
thanks Chris, i understand what your saying i just never had to do it until now

oh well gotta learn sometime.

thanks again
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