Author Topic: Error  (Read 1030 times)

0 Members and 1 Guest are viewing this topic.

Offline yiwen89Topic starter

  • Beginner
  • *
  • Posts: 6
  • Helpful? 0
Error
« on: March 03, 2012, 01:43:47 AM »
Anyone here have ideas how to solve this error??


Error - could not find definition of symbol 'FSfprintf' in file './testingtesting.o'.

i got no idea how to solve this as i include FSIO.c in my main.c, it shows tht it is unable to locate FSIO.c.
Anyone here could help??

Offline joe61

  • Supreme Robot
  • *****
  • Posts: 417
  • Helpful? 16
Re: Error
« Reply #1 on: March 03, 2012, 06:27:07 AM »
It looks like the linker is complaining about an unresolved symbol which is called in testingtesting.c, so where is FSfprintf defined? Is that file included in the link phase? Is the symbol spelled correctly (no upper/lower case mismatch etc)?

Please post the exact output from the build. Please copy and paste, don't try to type it in or summarize it. It's kind of hard to guess with this little information.

Joe

Offline yiwen89Topic starter

  • Beginner
  • *
  • Posts: 6
  • Helpful? 0
Re: Error
« Reply #2 on: March 04, 2012, 11:14:10 AM »
I am using MDD library from Microchip. The FSfprintf is defined in FSIO.c and I already included the file. At the same time, I enable the this function in FSconfig.h, but the error cant be solved. The symbol i triple confirm it, it should be right. Below is the output after i build my code.


----------------------------------------------------------------------
Debug build of project `C:\Users\owner\Desktop\fyp!\testingtesting.mcp' started.
Language tool versions: mpasmwin.exe v5.42, mplink.exe v4.40, mcc18.exe v3.40, mplib.exe v4.40
Preprocessor symbol `__DEBUG' is defined.
Mon Mar 05 01:03:02 2012
----------------------------------------------------------------------
Clean: Deleting intermediary and output files.
Clean: Deleted file "C:\Users\owner\Desktop\fyp!\testingtesting.o".
Clean: Deleted file "C:\Users\owner\Desktop\fyp!\FSIO.o".
Clean: Deleted file "C:\Users\owner\Desktop\fyp!\SD-SPI.o".
Clean: Deleted file "C:\Users\owner\Desktop\fyp!\salloc.o".
Clean: Done.
Executing: "C:\Program Files (x86)\Microchip\mplabc18\v3.40\bin\mcc18.exe" -p=18F4620 /i"C:\Microchip Solutions\MDD File System-SD Card\Pic18f" -I"C:\Microchip Solutions\Microchip\PIC18 salloc" -I"C:\Microchip Solutions\Microchip\Include\PIC18 salloc" -I"C:\Microchip Solutions\Microchip\Include\MDD File System" -I"C:\Microchip Solutions\Microchip\Include" -I"C:\Program Files (x86)\Microchip\mplabc18\v3.40\h" "testingtesting.c" -fo="testingtesting.o" -D__DEBUG
C:\Users\owner\Desktop\fyp!\testingtesting.c:41:Warning [2058] call of function without prototype
C:\Users\owner\Desktop\fyp!\testingtesting.c:47:Warning [2058] call of function without prototype
C:\Users\owner\Desktop\fyp!\testingtesting.c:195:Warning [2058] call of function without prototype
Executing: "C:\Program Files (x86)\Microchip\mplabc18\v3.40\bin\mcc18.exe" -p=18F4620 /i"C:\Microchip Solutions\MDD File System-SD Card\Pic18f" -I"C:\Microchip Solutions\Microchip\PIC18 salloc" -I"C:\Microchip Solutions\Microchip\Include\PIC18 salloc" -I"C:\Microchip Solutions\Microchip\Include\MDD File System" -I"C:\Microchip Solutions\Microchip\Include" -I"C:\Program Files (x86)\Microchip\mplabc18\v3.40\h" "Microchip Solutions\Microchip\MDD File System\FSIO.c" -fo="FSIO.o" -D__DEBUG
Executing: "C:\Program Files (x86)\Microchip\mplabc18\v3.40\bin\mcc18.exe" -p=18F4620 /i"C:\Microchip Solutions\MDD File System-SD Card\Pic18f" -I"C:\Microchip Solutions\Microchip\PIC18 salloc" -I"C:\Microchip Solutions\Microchip\Include\PIC18 salloc" -I"C:\Microchip Solutions\Microchip\Include\MDD File System" -I"C:\Microchip Solutions\Microchip\Include" -I"C:\Program Files (x86)\Microchip\mplabc18\v3.40\h" "Microchip Solutions\Microchip\MDD File System\SD-SPI.c" -fo="SD-SPI.o" -D__DEBUG
Executing: "C:\Program Files (x86)\Microchip\mplabc18\v3.40\bin\mcc18.exe" -p=18F4620 /i"C:\Microchip Solutions\MDD File System-SD Card\Pic18f" -I"C:\Microchip Solutions\Microchip\PIC18 salloc" -I"C:\Microchip Solutions\Microchip\Include\PIC18 salloc" -I"C:\Microchip Solutions\Microchip\Include\MDD File System" -I"C:\Microchip Solutions\Microchip\Include" -I"C:\Program Files (x86)\Microchip\mplabc18\v3.40\h" "Microchip Solutions\Microchip\PIC18 salloc\salloc.c" -fo="salloc.o" -D__DEBUG
Executing: "C:\Program Files (x86)\Microchip\mplabc18\v3.40\bin\mplink.exe" /p18F4620 /l"C:\Program Files (x86)\Microchip\mplabc18\v3.40\lib" "..\..\..\..\Program Files (x86)\Microchip\mplabc18\v3.40\bin\LKR\18f4620_g.lkr" "testingtesting.o" "FSIO.o" "SD-SPI.o" "salloc.o" /u_CRUNTIME /u_DEBUG /z__MPLAB_BUILD=1 /z__MPLAB_DEBUG=1 /o"testingtesting.cof" /M"testingtesting.map" /W
MPLINK 4.40, Linker
Device Database Version 1.3
Copyright (c) 1998-2011 Microchip Technology Inc.
Error - could not find definition of symbol 'FSfprintf' in file './testingtesting.o'.
Errors    : 1

Link step failed.
----------------------------------------------------------------------
Debug build of project `C:\Users\owner\Desktop\fyp!\testingtesting.mcp' failed.
Language tool versions: mpasmwin.exe v5.42, mplink.exe v4.40, mcc18.exe v3.40, mplib.exe v4.40
Preprocessor symbol `__DEBUG' is defined.
Mon Mar 05 01:03:10 2012
----------------------------------------------------------------------
BUILD FAILED


I debug it for few days but still i could not get through this. Hope to hear from you soon if you have any solutions about this. Thanks.  :)

Offline joe61

  • Supreme Robot
  • *****
  • Posts: 417
  • Helpful? 16
Re: Error
« Reply #3 on: March 04, 2012, 12:23:53 PM »
Would you post the contents of FISO.c and testingtesting.c? Again, please copy and paste with the code tags.

Also, what are the functions being complained about in the warnings?

Code: [Select]
C:\Users\owner\Desktop\fyp!\testingtesting.c:41:Warning [2058] call of function without prototype
C:\Users\owner\Desktop\fyp!\testingtesting.c:47:Warning [2058] call of function without prototype
C:\Users\owner\Desktop\fyp!\testingtesting.c:195:Warning [2058] call of function without prototype

Joe

Offline yiwen89Topic starter

  • Beginner
  • *
  • Posts: 6
  • Helpful? 0
Re: Error
« Reply #4 on: March 05, 2012, 12:02:30 AM »
I attached FSIO.c and testingtesting.c. My project still got other files, do you need me to include others too?Sorry, I am not sure about the warnings. =(

Offline joe61

  • Supreme Robot
  • *****
  • Posts: 417
  • Helpful? 16
Re: Error
« Reply #5 on: March 05, 2012, 07:37:36 AM »
The FSfprintf function is guarded by preprocessor macros which don't define it unless ALLOW_FSFPRINTF is defined.

Look at the documentation that came with the compiler to find out when this should be defined, and if all you need to do is define it. Sometimes there are side effects which you have to take into consideration.

My guess though is that it's an attempt to keep code size down by not putting more code in the executable than is needed.

Try adding -DALLOW_FSFPRINTF to the compiler command line.

Joe

Offline yiwen89Topic starter

  • Beginner
  • *
  • Posts: 6
  • Helpful? 0
Re: Error
« Reply #6 on: March 05, 2012, 08:07:58 AM »
Yeah! I already define it in FSconfig.h and i enable it but the error is still there.

"Try adding -DALLOW_FSFPRINTF to the compiler command line."

I am not sure about the "compiler command line". Can you explain to me where is it exactly?By the way, thanks for your reply. I appreciate it a lot. =)
Hope to hear from you soon.

Offline joe61

  • Supreme Robot
  • *****
  • Posts: 417
  • Helpful? 16
Re: Error
« Reply #7 on: March 05, 2012, 09:08:16 AM »
I've never used the PIC programming environment so I'm not sure how you'd do it. Does it use makefiles? If so, add it to the CFLAGS line in the makefile.

Look at the documentation that comes with the software you're using to program it. The programming environment must tell you how somewhere. Perhaps someone here who knows about PIC programming can help more than me.

Joe

Offline yiwen89Topic starter

  • Beginner
  • *
  • Posts: 6
  • Helpful? 0
Re: Error
« Reply #8 on: March 05, 2012, 09:12:18 AM »
Okay. Thanks for your reply yea. I will try to figure it out. =D

Offline joe61

  • Supreme Robot
  • *****
  • Posts: 417
  • Helpful? 16
Re: Error
« Reply #9 on: March 05, 2012, 09:51:36 AM »
I downloaded MPLAB (looks like it runs on Linux now, interesting). I opened one of the sample projects and see that under the Projects pane you can expand things out to get to the makefile. I don't see a CFLAGS macro there however.

All C compilers I've ever dealt with use CFLAGS though, try adding a line to the makefile like this

CFLAGS = -DALLOW_FSFPRINTF $(CFLAGS)

If they're using GNU make under the hood you also may be able to do

CFLAGS += -DALLOW_FSFPRINTF

but try the first one first.

EDIT: forgot the parentheses around the macro, sorry

Joe
« Last Edit: March 05, 2012, 09:54:52 AM by joe61 »

Offline bobthefirst1

  • Jr. Member
  • **
  • Posts: 43
  • Helpful? 0
Re: Error
« Reply #10 on: March 05, 2012, 10:34:33 PM »
This may just give u. An idea: I once had a similar problem but invisual studio. After contacting a pro programmer (phd in programming) we figured out I was using a 32 bit java obj linker file for 64 bit target platform. maybe u could check if it is targeting the right pic?

Offline yiwen89Topic starter

  • Beginner
  • *
  • Posts: 6
  • Helpful? 0
Re: Error
« Reply #11 on: March 06, 2012, 01:03:26 AM »
Hi Joe,

I tried your method but it is not working.  =(

Hi bobthefirst1,

Can I know how to check the linker file for how many bits?

Regards,
yi wen

Offline bobthefirst1

  • Jr. Member
  • **
  • Posts: 43
  • Helpful? 0
Re: Error
« Reply #12 on: March 07, 2012, 10:40:47 PM »

Quote
Can I know how to check the linker file for how many bits?
Sorry I'm Relatively new to pics so I cant answer that :-\


 


Get Your Ad Here