Jump to content
Sign in to follow this  
SnakeByte

Mplab Ide + Boostc Include Path Question...

Recommended Posts

I've followed the instructions detailed in C:\Program Files\SourceBoost\boostc.html as far as boostc integration with mplab and am attempting to compile the sample code picdem2plusdemo.c file but am still having difficulties. When I try to build the source, I'm getting a ton of "error: failed to generate expression" errors, and I'm guessing this is because the compiler doesn't know where to find the needed include files. Even after adding the include and library paths to the "Default search paths and Directories" for the project, and making sure that the lib and the source file is added to the project, those errors remain. What step am I missing? Does the compiler use environment variables to find the include and lib dirs? Will the compiler complain if it cannot find a header or source file?

Share this post


Link to post
Share on other sites
I've followed the instructions detailed in C:\Program Files\SourceBoost\boostc.html as far as boostc integration with mplab and am attempting to compile the sample code picdem2plusdemo.c file but am still having difficulties.  When I try to build the source, I'm getting a ton of "error: failed to generate expression" errors, and I'm guessing this is because the compiler doesn't know where to find the needed include files.  Even after adding the include and library paths to the "Default search paths and Directories" for the project, and making sure that the lib and the source file is added to the project, those errors remain.  What step am I missing?  Does the compiler use environment variables to find the include and lib dirs?  Will the compiler complain if it cannot find a header or source file?

 

Ah, looks like this is related to the lcd_driver.h file problems.

Share this post


Link to post
Share on other sites

SnakeByte,

 

So you were using outdated lcd_drive.h file ?

 

Does the compiler use environment variables to find the include and lib dirs?

 

The finds the default include folder by looking at the path to boostc.exe and adding "\include" to that path. Enviroment variables are not used.

 

 

Regards

Dave

Share this post


Link to post
Share on other sites
SnakeByte,

 

So you were using outdated lcd_drive.h file ?

 

Does the compiler use environment variables to find the include and lib dirs?

 

The finds the default include folder by looking at the path to boostc.exe and adding "\include" to that path. Enviroment variables are not used.

 

 

Regards

Dave

 

Dave,

 

When I posted the original message, I was using the original, but then after reading that other thread, I gave your 1.10 a try. While it still doesn't compile, the error messages are a bit more vebose:

 

picdem2plusDemo.c(93,59): error: no template identifier 'LCD_Setup' matches the number of arguments in the call

picdem2plusDemo.c(93,2): error: failed to generate expression

 

What's odd is that LCD_Setup doesn't have any arguments both as declared in your header file, and when called from the source file.

 

I get these errors for each of the lcd functions that are being called.

 

Is there any way to increase verbosity further, or run the compiler enough for it to output the source file after macro/template substitution but before actual compilation?

Share this post


Link to post
Share on other sites

SnakeByte,

 

Is there any way to increase verbosity further, or run the compiler enough for it to output the source file after macro/template substitution but before actual compilation?

Yes, specify -v in the compiler extra command line options.

 

 

If you zip up the project and send it to me I'll take a quick look (support@picant.com)

 

Regards

Dave

Share this post


Link to post
Share on other sites
SnakeByte,

 

Is there any way to increase verbosity further, or run the compiler enough for it to output the source file after macro/template substitution but before actual compilation?

Yes, specify -v in the compiler extra command line options.

 

 

If you zip up the project and send it to me I'll take a quick look (support@picant.com)

 

Regards

Dave

 

Dave,

 

I Figured it out. I uninstalled SourceBoost 5.9.5, manually removed the directory, re-installed sourceboost, installed the 2.2.3 update, and everything compiled fine afterwards.

 

I kept a copy of the original sourceboost dir before doing all of this, and will do a file compare to see what's going on... Perhaps the sourceboost 5.9.5 installer isn't overwriting all of the files and is leaving some stale files behind.

Share this post


Link to post
Share on other sites

SnakeByte,

 

I'm glad you have got it sorted.

I'm very interested in knowing what the problem was, so please let us known.

 

Regards

Dave

Share this post


Link to post
Share on other sites
SnakeByte,

 

I'm glad you have got it sorted.

I'm very interested in knowing what the problem was, so please let us known.

 

Regards

Dave

 

Dave,

One of the things I forgot to do after re-installing sourceboost was to use your v1.10 version of the lcd_driver.h file... Surprisingly things compiled fine... It's only when I use that newer version that things break as reported before.

 

It looks like the problem with my original post was because I wasn't using the 16F877 as my target (I had the 16F876 set instead), and the problem with my 3rd post was due to that newer header file.

Share this post


Link to post
Share on other sites

SnakeByte,

 

The lcd_driver.h file included in the installation is the latest.

BTW the version information in the lcd_driver currently has version history top down, ie later version details appear further down the file.

 

Please mail both header files to which you refer to support@picant.com for examination.

 

Regards

Dave

Share this post


Link to post
Share on other sites
SnakeByte,

 

The lcd_driver.h file included in the installation is the latest.

BTW the version information in the lcd_driver currently has version history top down, ie later version details appear further down the file.

 

Please mail both header files to which you refer to support@picant.com for examination.

 

Regards

Dave

 

Dave,

 

I got the "bad" header from this thread:

http://sourceboost.ipbhost.com/index.php?showtopic=956

 

You provide a temporary link to the file at post #6:

http://www.hob68.f2s.com/lcd/lcd13-03-05.zip

 

When I originally checked the two files to see which was newer, all I saw was the date 15'th of november 2004 from the installation version without any versions while the header file located in that zip file showed the 1.10 revision... I see now that you moved the revision information from its' original location down a page and that the version that comes with the installer is version 1.11. D'oh!

 

Now that this is all finally figured out, I just have one more question... the 16F876 should be functionally equal to the 16f877 except for the extra two ports D and E right? Is the 876 not able to drive an lcd display or is the lcd_driver stuff still a work in progress?

Share this post


Link to post
Share on other sites

SnakeByte,

 

Now that this is all finally figured out, I just have one more question... the 16F876 should be functionally equal to the 16f877 except for the extra two ports D and E right? Is the 876 not able to drive an lcd display or is the lcd_driver stuff still a work in progress?

 

I'm not sure about the functionality equivalen of PIC16F877 and PICF876 (I would have to spend some time studying the data sheets to confirm that).

 

The lcd_driver code should be universal, its not aimed at any particular target.

There is no work in progress here.

But it has only been fully tested with a limited number of targets. There is no reason why it should not work, normally the problems are configuration ones (like configuring ports to digital mode when the default is analog).

 

Regards

Dave

Share this post


Link to post
Share on other sites

Dave,

 

The lcd_driver code should be universal, its not aimed at any particular target.

There is no work in progress here.

But it has only been fully tested with a limited number of targets. There is no reason why it should not work, normally the problems are configuration ones (like configuring ports to digital mode when the default is analog).

 

Regards

Dave

 

If you still have that project I e-mailed you, attempt to change the target from a 16F877 to a 16F876. While everything compiles fine with the 877, once I change the target in mplab I get this output:

 

Clean: Deleting intermediary and output files.

Clean: Deleted file "Picdem2PlusDemo.OBJ".

Clean: Deleted file "C:\\microchip\demo2board\demo2board.HEX".

Clean: Done.

Executing: "C:\Program Files\SourceBoost\boostc.pic16.exe" Picdem2PlusDemo.c -O1 -W1 -v -t 16F876

BoostC Optimizing C Compiler Version 2.2.2 Beta (for PIC16 architecture)

http://www.picant.com/c2c/c.html

Copyright© 2004-2005 Pavel Baranov

Copyright© 2004-2005 David Hobday

 

 

Picdem2PlusDemo.c success

Picdem2PlusDemo.c(93:2): error: failed to generate expression

Picdem2PlusDemo.c(102:2): error: failed to generate expression

Picdem2PlusDemo.c(103:2): error: failed to generate expression

Picdem2PlusDemo.c(114:2): error: failed to generate expression

Picdem2PlusDemo.c(115:2): error: failed to generate expression

Picdem2PlusDemo.c(116:2): error: failed to generate expression

Picdem2PlusDemo.c(127:2): error: failed to generate expression

Picdem2PlusDemo.c(132:2): error: failed to generate expression

Picdem2PlusDemo.c(133:2): error: failed to generate expression

Picdem2PlusDemo.c(134:2): error: failed to generate expression

Picdem2PlusDemo.c(143:2): error: failed to generate expression

Picdem2PlusDemo.c(148:2): error: failed to generate expression

Picdem2PlusDemo.c(149:2): error: failed to generate expression

Picdem2PlusDemo.c(150:2): error: failed to generate expression

Picdem2PlusDemo.c(159:2): error: failed to generate expression

Picdem2PlusDemo.c(164:2): error: failed to generate expression

Picdem2PlusDemo.c(165:2): error: failed to generate expression

Picdem2PlusDemo.c(166:2): error: failed to generate expression

Picdem2PlusDemo.c(175:2): error: failed to generate expression

Picdem2PlusDemo.c(180:2): error: failed to generate expression

Picdem2PlusDemo.c(181:2): error: failed to generate expression

Picdem2PlusDemo.c(182:2): error: failed to generate expression

Picdem2PlusDemo.c(191:2): error: failed to generate expression

Picdem2PlusDemo.c(210:2): error: failed to generate expression

Picdem2PlusDemo.c(277:2): error: failed to generate expression

Picdem2PlusDemo.c(291:2): error: failed to generate expression

Picdem2PlusDemo.c(291:2): error: Error in the body of 'while' expression

Picdem2PlusDemo.c(299:2): error: failed to generate expression

Picdem2PlusDemo.c(300:2): error: failed to generate expression

Picdem2PlusDemo.c(302:2): error: failed to generate expression

Picdem2PlusDemo.c(303:2): error: failed to generate expression

Picdem2PlusDemo.c(304:2): error: failed to generate expression

Picdem2PlusDemo.c(305:2): error: failed to generate expression

Picdem2PlusDemo.c(319:2): error: failed to generate expression

Picdem2PlusDemo.c(320:2): error: failed to generate expression

Picdem2PlusDemo.c(321:2): error: failed to generate expression

Picdem2PlusDemo.c(350:2): error: failed to generate expression

Picdem2PlusDemo.c(351:2): error: failed to generate expression

Picdem2PlusDemo.c(353:2): error: failed to generate expression

Picdem2PlusDemo.c(397:2): error: failed to generate expression

Picdem2PlusDemo.c(398:2): error: failed to generate expression

Picdem2PlusDemo.c(403:2): error: failed to generate expression

Picdem2PlusDemo.c(404:2): error: failed to generate expression

Picdem2PlusDemo.c(416:2): error: failed to generate expression

Picdem2PlusDemo.c(417:2): error: failed to generate expression

Picdem2PlusDemo.c(460:2): error: failed to generate expression

Picdem2PlusDemo.c(536:2): error: failed to generate expression

Picdem2PlusDemo.c(537:2): error: failed to generate expression

Picdem2PlusDemo.c(553:2): error: failed to generate expression

Picdem2PlusDemo.c(554:2): error: failed to generate expression

Picdem2PlusDemo.c(574:2): error: failed to generate expression

Picdem2PlusDemo.c(579:2): error: failed to generate expression

Picdem2PlusDemo.c(580:2): error: failed to generate expression

Picdem2PlusDemo.c(588:2): error: failed to generate expression

Picdem2PlusDemo.c(589:2): error: failed to generate expression

failure

BUILD FAILED: Tue Apr 26 23:18:22 2005

Share this post


Link to post
Share on other sites
...attempt to change the target from a 16F877 to a 16F876.  While everything compiles fine with the 877, once I change the target in mplab I get this output:

 

<skipped a bunch of error messages>

 

Of course it won't compile if you just change the target. The code is configured to use TRISD/PORTD registers and 16F876 doesn't have them. You need to reconfigure the project to use different ports to make it compile for 16F876.

 

Regards,

Pavel

Share this post


Link to post
Share on other sites
...attempt to change the target from a 16F877 to a 16F876.  While everything compiles fine with the 877, once I change the target in mplab I get this output:

 

<skipped a bunch of error messages>

 

Of course it won't compile if you just change the target. The code is configured to use TRISD/PORTD registers and 16F876 doesn't have them. You need to reconfigure the project to use different ports to make it compile for 16F876.

 

Regards,

Pavel

 

Duh! Thanks Pavel... For some reason I thought it was only using ports A and B... I see that in the code it does show that it's using D... I guess that got changed back when I was having trouble with the v1.10 version of lcd_driver.h

 

#define LCD_ARGS  1, /* Interface type: mode 0 = 8bit, 1 = 4bit(low nibble), 2 = 4bit(upper nibble) */ \
   1,               /* Use busy signal: 1 = use busy, 0 = use time delays */                          \
   PORTD, TRISD,    /* Data port and data port tris register */                                       \
   PORTA, TRISA,    /* Control port and control port tris register */                                 \
   3,               /* Bit number of control port is connected to RS */                               \
   2,               /* Bit number of control port is connected to RW */                               \
   1                /* Bit number of control port is connected to Enable */

 

Is there any way to ask the compiler to tell when defines like PORTD and TRISD aren't defined? That would have made this simple to figure out.

Share this post


Link to post
Share on other sites

Just downloaded version 2.2.5 of sourceboost...

 

Noticed a change in the PicDem2plusDemo.c file:

 

	#ifndef _PIC16F877
	#warning "This code is configured for PIC16F877 or PIC18F452. If you use other targets you may need to reconfigure the project."
#endif

 

:)

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...
Sign in to follow this  

×
×
  • Create New...