Jump to content
RJS

Error: Unresolved External Function:'rand(Void)'

Recommended Posts

Ok I am sure I am missing something but I have the rand.h header file included and both the libc.pic18.lib and rand.pic18.lib file set in the library files but I continue to get the following errors:

 

Error: Unresolved external function:'rand(void)'

Error: Unresolved external symbol, function:rand

Share this post


Link to post
Share on other sites

Hi Randy,

 

I have no problems using using the rand() function with pic18.

 

Don't include the libc library as the linker will pick it up by itself if you use SourceBoost IDE. Maybe needed for MPLAB.

 

Do you have the full path in the project file to the rand.pic18.lib library. Looks like the linker can't find it.

 

Cheers

 

Reynard

Share this post


Link to post
Share on other sites

Hey Reynard,

Well I found the problem but I am not sure how to fix it. I am using the -idx 2 option for 2 byte indexing which I need in this program. if I take out the code that requires this and trun off the option if links fine.

Randy

Share this post


Link to post
Share on other sites

Hi Randy,

 

You will be using the large model then.

 

Have you tried getting the library from the Lib\Large directory.

 

Cheers

 

Reynard

Share this post


Link to post
Share on other sites

Hi Reynard,

 

Nope hadn't tried that but that was the solution - Thanks!!!

 

I went back to the documentation but didn't see anything about the large libs.

 

Randy

Share this post


Link to post
Share on other sites

Hi Randy,

 

Documentation is rather spars.

 

In the IDE I saw the small and large model buttons in the Settings/Options window and got curious to what they did.

 

Good you got things going.

 

Cheers

 

Reynard

Share this post


Link to post
Share on other sites

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...