Cant clean and build project

Page: < 12 Showing page 2 of 2
Author
Ian.M
Super Member
  • Total Posts : 13209
  • Reward points : 0
  • Joined: 2009/07/23 07:02:40
  • Location: UK
  • Status: online
Re: Cant clean and build project 2014/11/07 02:54:14 (permalink)
+2 (2)
MPASM is borked (by design) and has no concept of an include path.
See the MPASM manual DS33014L section 4.42.  
The search path for includes is:
  1. current directory
  2. source file directory (if different from 1.)
  3. MPASM program directory.
As such, the cleanest option is probably to symlink to your library headers directory from each project directory so you can simply #include <MyLib/any_lib_header.inc>
 
 
N.B. relative paths only work from the current directory so symlinking your headers from the MPASM directory unfortunately wont work.

--
NEW USERS: Posting images, links and code - workaround for restrictions.
I also support http://picforum.ric323.com because this forum is sometimes too broken to use!
#21
DaveDave
Starting Member
  • Total Posts : 38
  • Reward points : 0
  • Joined: 2014/10/12 15:09:25
  • Location: AUS
  • Status: offline
Re: Cant clean and build project 2014/11/07 02:58:57 (permalink)
0
Thanks
but i cant find the the difference between <...> and "..." in the help file.
 
i thought ".." was if there was spaces in the file name.

Cheers Dave
 
My current set up
PIC P16F887
MPLAB X IDE v2.25
MPASM v5.59
MPLINK v5.05
#22
Ian.M
Super Member
  • Total Posts : 13209
  • Reward points : 0
  • Joined: 2009/07/23 07:02:40
  • Location: UK
  • Status: online
Re: Cant clean and build project 2014/11/07 03:07:18 (permalink)
+1 (1)
There is *NO* difference under MPASM. 
 
For a C preprocessor, by convention, <filename> searches only the standard include path and "filename" searches the project directory followed by the standard include path.
 
It is therefore good style to use the quoted form for all includes that are project specific and the angle bracket form for library includes.   If Microchip *EVER* sort out the include path issue, you will then be ready for it.

--
NEW USERS: Posting images, links and code - workaround for restrictions.
I also support http://picforum.ric323.com because this forum is sometimes too broken to use!
#23
DaveDave
Starting Member
  • Total Posts : 38
  • Reward points : 0
  • Joined: 2014/10/12 15:09:25
  • Location: AUS
  • Status: offline
Re: Cant clean and build project 2014/11/07 03:07:45 (permalink)
+1 (1)
OMG
it has worked.  
 
Forget the linker. it worked by hard wiring it.
 
#include <p16F887.inc>
#include C:\SSS\pic\projects\Incs\LCDCLKv1.inc
 
Thanks alot ric, Ian and Viloki

Cheers Dave
 
My current set up
PIC P16F887
MPLAB X IDE v2.25
MPASM v5.59
MPLINK v5.05
#24
ric
Super Member
  • Total Posts : 22101
  • Reward points : 0
  • Joined: 2003/11/07 12:41:26
  • Location: Australia, Melbourne
  • Status: offline
Re: Cant clean and build project 2014/11/07 03:10:06 (permalink)
+1 (1)
Don't thank me, I think I contributed as much misinformation as information.
I was under the impression that MPASM used the same rules as C, but plainly not.
 

I also post at: PicForum
Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
NEW USERS: Posting images, links and code - workaround for restrictions.
To get a useful answer, always state which PIC you are using!
#25
DaveDave
Starting Member
  • Total Posts : 38
  • Reward points : 0
  • Joined: 2014/10/12 15:09:25
  • Location: AUS
  • Status: offline
Re: Cant clean and build project 2014/11/07 03:10:18 (permalink)
+1 (1)
Thanks everyone, im turning off the computer and having a beer.

Cheers Dave
 
My current set up
PIC P16F887
MPLAB X IDE v2.25
MPASM v5.59
MPLINK v5.05
#26
vloki
Jo, alla!
  • Total Posts : 6792
  • Reward points : 0
  • Joined: 2007/10/15 00:51:49
  • Location: Germany
  • Status: offline
Re: Cant clean and build project 2014/11/07 03:12:02 (permalink)
+1 (1)
What about:
2. specify a relative path like #include "..\lncs\LCDCLKv1.inc" (assumed the project has its own subdirectory)

If it works, you could move your "...\projects" folder around without being fixed to the absolute path !
post edited by vloki - 2014/11/07 03:14:10

Uffbasse !
#27
Ian.M
Super Member
  • Total Posts : 13209
  • Reward points : 0
  • Joined: 2009/07/23 07:02:40
  • Location: UK
  • Status: online
Re: Cant clean and build project 2014/11/07 03:28:52 (permalink)
+1 (1)
I think we should campaign for a fixed MPASMX.
 
Adding the command line option:
/i[+|-|list_of_paths]
would do it. 
/i- would be the default i.e. current behaviour. 
/i+ would make #include distinguish between <> and "" in a C-line manner as would specifying a list of paths.  
 
The semicolon separated list of paths could simply be appended to the search path after the MPASM directory, or some means of  specifying where the MPASM directory should be in the list could be provided.
 

--
NEW USERS: Posting images, links and code - workaround for restrictions.
I also support http://picforum.ric323.com because this forum is sometimes too broken to use!
#28
DaveDave
Starting Member
  • Total Posts : 38
  • Reward points : 0
  • Joined: 2014/10/12 15:09:25
  • Location: AUS
  • Status: offline
Re: Cant clean and build project 2014/11/07 16:53:34 (permalink)
0
Hi All
yep "..\Incs\LCDCLKv1.inc" worked, but i agree with Ian.  
 
For someone who is coming at this pretty raw (i did a lot in the 90s, but that was a long time ago) from what i read in the documentation and help files i thought that the linker would / should take care of these issues.  As long as they were included in a project. I've learnt a lesson, don't take MPLAB for granted.
 
Could i get feedback on these quick questions.
 
1, Generally is better break each routine into separate object files or have one larger file that contains like routines.
ie all math functions in math.o or each function on its own like 16Div16.o etc?
 
2, Its better to define global constants in a header file than in source files?
 
3, Ultimately i'm looking to implement a zigbee mesh network, im better to go to 16bit or 32bit MCU?
 
Cheers and thank for your help

Cheers Dave
 
My current set up
PIC P16F887
MPLAB X IDE v2.25
MPASM v5.59
MPLINK v5.05
#29
vloki
Jo, alla!
  • Total Posts : 6792
  • Reward points : 0
  • Joined: 2007/10/15 00:51:49
  • Location: Germany
  • Status: offline
Re: Cant clean and build project 2014/11/08 02:57:09 (permalink)
0 (2)
Dave Davidson
For someone who is coming at this pretty raw (i did a lot in the 90s, but that was a long time ago) from what i read in the documentation and help files i thought that the linker would / should take care of these issues.

The linker has gotten nothing to do with it at this stage.
There is the assemblers preprocessor that replaces the directive with the text of the file it points to.
-> So it is all to the assembler
Dave Davidson
1, Generally is better break each routine into separate object files or have one larger file that contains like routines. ie all math functions in math.o or each function on its own like 16Div16.o etc?

Personally I prefer several files that contain a group of routines about the same subject.
(i.e one file for different 16bit math functions)
Dave Davidson 
2, Its better to define global constants in a header file than in source files?

I would define it in a header
Dave Davidson
3, Ultimately i'm looking to implement a zigbee mesh network, im better to go to 16bit or 32bit MCU?
I use 8bit MCUs only so I can not suggest something here



Uffbasse !
#30
Page: < 12 Showing page 2 of 2
Jump to:
© 2019 APG vNext Commercial Version 4.5