When i run my program in MPLAB. ( Project wizard -> PIC16F877A -> Hi Tech Ansi C Compiler -> RUN )
Error [141] C:\Users\WhyWhy\Desktop\test.c; 1.22 can't open include file "16F877A.h": No such file or directory
Where can i find the header file for the 16F877A?
Chip-specific header files should not be explicitly included in HITECH-C, the documentation clearly states that. Instead, you include the compiler header, which will take care of including the chip-specific file for you:
#include <htc.h>
All you need for this to work is to configure correct chip in the project settings. The 16F877A.h file exists in the compiler directory, but including it directly will throw a warning.
C:\Program Files\HI-TECH Software\PICC\9.70\include
In my case , I have installed HITech Compiler In C:\ Program Files.
You have to know, where have you installed the files of the compiler.
This file is from the compiler, so in your case the Hi Tech you can find here:
C:\Program Files\HIāTECH Software\PICC\\include\
Before you have found the file you have to add in the Header Files folder in the Project window on MPLAB.
And in your code you have to include it
#include <16F877A.h>
Related
I have a standard (?) project (vcxproj) with multiple .asm files in Visual Studio 2019 Community 16.6.
In Configuration properties->MASM I have not set anything
Still the .lst file is created for the project. So, there must be some "hidden" defaults somewhere. However, even if I set them explicitly - there is no setting as to for which .asm file the listing file should be created.
I could not find anything as to the default implicit behavior / explicit behavior of choice of one .asm file over another. Logically, it would be the file containing the entry point in x86-32bit "end main", but that's not the case. Also, is there a way to generate .lst next to the .obj file for all .asm files in a given project.
right for me:
Open Project ,
Create a file (*).asm AND write code
Go to Property of Project: ( note platform for correct in first line - for me: WIN32 )
Go to Microsoft Macro Assembler - Listing file - set Yes(/Sg) Enable Assembly Generated Code Listing
and set $(ProjectName).lst in Assembled Code Listing File
Go to property of file (*).asm do the same thing as above...
Thanks for watch
I am trying to compile and build the first basic example from the OSG 3.0 Beginner's Guide (Rui Wang, Xuelei Qian) run on Windows 10 (Build 18363) with Visual Studio Community 19 (16.7.3).
The code looks like this:
#include <osgDBd/ReadFile>
#include <osgViewerd/Viewer> //the "d" is supposed to be there when in Debug solution configuration
int main(int argc, char** argv)
{
osgViewer::Viewer viewer;
viewer.setSceneData(osgDB::readNodeFile("cessna.osg"));
return viewer.run();
}
But the error messages are:
Error (active) E1696 cannot open source file "osgDBd/ReadFile"
Error (active) E1696 cannot open source file "osgViewerd/Viewer"
Error C1083 Cannot open include file: 'osgDBd/ReadFile': No such file or directory
So I rechecked my solution properties, which I had set up following OSG's online documentation "compiling with visual studio" (Linker, C++ properties, ...), as well as my environment variables in Windows OS.
The recommended cmd commands, should something be out of order, didn't help either.
(I deemed it less cluttered leaving out all those screenshots, but I can of course upload them if wished)
I also compared my settings to this answer: How to add additional libraries to Visual Studio project? , which I thought same.
I should add, that I built OSG on a separate drive than Visual Studio or Windows, but I believed setting the environment variables properly should be ok.
Help would be greatly appreciated.
Thank you.
Have you set %OSG_ROOT% ?
I'm not sure what is in the guide, but my typical installation is to set Windows environment variable OSG_ROOT to the main OpenSceneGraph folder in my Program Files (x86), then to add $(OSG_ROOT)\include to my additional include folders and $(OSG_ROOT)\lib to my additional library folders.
Also, it looks like the example you are using has a "d" added to the folder names - should just be osgDB/ReadFile and osgViewer/Viewer for the Release versions - maybe they wanted you to build the debug libraries and add such folders for your includes? I get having a separate lib and bin but I don't know why they would want a separate include folder for Debug vs. Release, so my suggestion would be to remove the d from the include statements, e.g. osgDBd --> osgDB, osgViewerd --> osgViewer, etc.
Unfortunately, the Example applications in the OSG Solution reference the local build folders, not the installed folders, so will not serve as an example of how to reference OSG from its installed location. However, if you are ok building from the local build folder, you could just use the project settings from one of the Examples.
I have just bjamed boost and it seems like its still gonna refuse to work (I alread have tried and given up to make this library). What I did was, that I launched bjam.exe and I linked:
include directories: C:\ ... \boost_1_53_0
Library directories: C:\ ... \boost_1_53_0\bin.v2\libs
But I still get the error. So I decided to look in the folders, and this showed up to be path to the desired library:
C:\ ... \boost_1_53_0\bin.v2\libs\date_time\build\msvc-10.0\debug\link-static\threading-multi\
If I explicitly add this folder to the Library directories, the library is found but in VCC another error pops up, asking me for another library.
So how do I ask bjam to make a folder system that VCC can understand?
Adding the C:...\boost_1_55_0\stage\lib directory worked for me. Added to:
Project properties -> Configuration Properties -> VC++ Directories -> Library Directories.
Adding the following link to 'Configuration properties -> Linker -> General -> Additional Library Directories ' helped me as well.
'C:\Program Files\boost\boost_1_55_0\stage\lib'
I have a folder with some .h and .c files and I want to use header files in my projects.
I have included them in "Header Files" folder of my project using "Add Existing Item" but when i try to "#include" them compiler(mplabc18\v3.41) say "unable to locate file xyz.h"
So, what should i do to use these files without copying them into the project folder?
Just add the header to the project using the "add" dialog and select "this file is for this project, use relative path" dont remember if it is exac this text but its something like.
After that just do the normal declaration in your file:
#include "your_header.h"
This should work fine.
--UPDATE
To work with the new MPLAB X
Do the follow:
Click on the File-> Project Properties
Select the Conf -> C18 (Global Options) -> mcc18
For XC8, this is under Conf > XC8 compiler
Click on the "..." button of the propertie "Include directories"
Click on "Browse Button"
Locate you project directory
Click on Open, then Ok and Apply
Build your app !
Now it should work.
I know this is an old question, but wanted to add another tip since I just stumbled across it myself. If you go back and forth between Windows and Linux systems, be sure to pay attention to the capitalization in the filename. On Windows, it doesn't matter. However, on Linux, you need to be sure your #include reference has the same capitalization as the actual file.
If the file is saved on disk as 'UARTIO.INC', your include needs to be:
#INCLUDE "UARTIO.INC" **EXACTLY**
If you put it as:
#INCLUDE "UARTIO.inc", or #INCLUDE "uartio.inc"
It will work fine on Windows, but will fail with "Could Not Find Include File" errors on Linux.
Note that setting MPLAB to ignore case sensitivity doesn't matter for this.
I am going to port the C project that was for unix into windows. So far, I could make it compile but not build . The problem I am getting is , some of the functions which are declared in the header files are defined in the yacc files.so I am getting the following errors:
error LNK2001: unresolved external symbol function_name
I am adding .y and .l files in the source directory of the project.I think I could not port yacc files into windows version or am I doing something stupid.I search it on web but could not get proper tutorial for it.Could you please let me know
How could I add .y or .l files in the project.
How would I make those file compatible to the windows?
How can I link them with other object files.
EDIT
I tried with changing the the .l files into the .yy.c files using the flex.exe.Following is the command for it
c:\> flex.exe name.l
Supposing that both the flex.exe and name.l are in C;>.And I loaded those all those files .l .y(previously present for parsing in unix system) .yy.c(corrsonding yacc file for windows) in the solution of previously exisiting project. Once I compile,I get the following
Can't read the header file parserheaderfile.h
This is the header file which needs to be generated by the bison in the unix
system. So I think I am not able to make the bison compatible for windows .So please him me how can I solve this problem?
Thanks in advance.
You need to add custom build rules for your .y and .l files. To do this, you need to
create one dummy .c file for the .l file and the .y file
add the .l, .y and both .c files to the project
right click on the .l file and select properties
Configuration->All Configurations
General->Item Type->Custom Build Tool
Apply
Custom Build Tool->General->Command Line->flex -olexer.c lexer.l
Custom Build Tool->General->Outputs->lexer.c
Custom Build Tool->General->Additional Dependencies->parser.y parser.c
Apply
select the .y file in the solution explorer
Configuration->All Configurations
General->Item Type->Custom Build Tool
Apply
Custom Build Tool->General->Command Line->bison -oparser.c parser.y
Custom Build Tool->General->Outputs->parser.c parser.h
Also you need to have flex.exe, bison.exe and m4.exe in the system search path. Another drawback is that VS does not get the dependencies right, so when you change something in the parser or lexer files, you need to manually rebuild the project.