#include <pj/types.h>No Such File or Directory
Hello to all, i need access the external header file from third party in Visual Studio.
I have settings the additional include directory but the files still cannot be found.
I sure that file located at the directory pj and the types.h is exist in the directory.
Any hints ?
The types.h locates at thisC:\Program Files\VOIP\pjproject-1.4\pjproject-1.4\pjlib\include\pj
I often encounter this kind of error when using third party source library.
to the list of directories to be searched for included header files.
I follow your advise add this
to the Additional Include Directory but Visual Studio 2005
Thanks for your help.
The problem now become worse than before.
This library is VOIP PJLib.
Error 1 error C3861: 'strlen': identifier not found c:\program files\voip\pjproject-1.4\pjproject-1.4\pjlib\include\pj\string.h 93
Error 2 error C3861: 'strlen': identifier not found c:\program files\voip\pjproject-1.4\pjproject-1.4\pjlib\include\pj\string.h 125
Error 3 error C3861: 'memchr': identifier not found c:\program files\voip\pjproject-1.4\pjproject-1.4\pjlib\include\pj\string.h 472
Error 4 error C3861: 'memset': identifier not found c:\program files\voip\pjproject-1.4\pjproject-1.4\pjlib\include\pj\string.h 604
Error 5 error C3861: 'memset': identifier not found c:\program files\voip\pjproject-1.4\pjproject-1.4\pjlib\include\pj\string.h 620
Error 6 error C3861: 'memcpy': identifier not found c:\program files\voip\pjproject-1.4\pjproject-1.4\pjlib\include\pj\string.h 634
Error 7 error C3861: 'memmove': identifier not found c:\program files\voip\pjproject-1.4\pjproject-1.4\pjlib\include\pj\string.h 648
Error 8 error C3861: 'memcmp': identifier not found c:\program files\voip\pjproject-1.4\pjproject-1.4\pjlib\include\pj\string.h 662
Error 9 error C3861: 'memchr': identifier not found c:\program files\voip\pjproject-1.4\pjproject-1.4\pjlib\include\pj\string.h 677
Warning 10 warning C4244: '=' : conversion from '__w64 unsigned int' to 'unsigned int', possible loss of data c:\program files\voip\pjproject-1.4\pjproject-1.4\pjmedia\include\pjmedia\types.h 515
Warning 11 warning C4244: '=' : conversion from '__w64 int' to 'unsigned int', possible loss of data c:\program files\voip\pjproject-1.4\pjproject-1.4\pjmedia\include\pjmedia\circbuf.h 218
Warning 12 warning C4244: '=' : conversion from '__w64 int' to 'unsigned int', possible loss of data c:\program files\voip\pjproject-1.4\pjproject-1.4\pjmedia\include\pjmedia\circbuf.h 254
Warning 13 warning C4244: '=' : conversion from '__w64 int' to 'unsigned int', possible loss of data c:\program files\voip\pjproject-1.4\pjproject-1.4\pjmedia\include\pjmedia\circbuf.h 256
Error 14 error C3861: 'assert': identifier not found c:\program files\voip\pjproject-1.4\pjproject-1.4\pjmedia\include\pjmedia\stereo.h 82
Error 15 error C3861: 'assert': identifier not found c:\program files\voip\pjproject-1.4\pjproject-1.4\pjmedia\include\pjmedia\stereo.h 131
Error 16 error C3861: 'assert': identifier not found c:\program files\voip\pjproject-1.4\pjproject-1.4\pjmedia\include\pjmedia\stereo.h 132
Error 17 fatal error C1083: Cannot open include file: 'pjnath/ice_strans.h': No such file or directory c:\program files\voip\pjproject-1.4\pjproject-1.4\pjmedia\include\pjmedia\transport_ice.h 30
You need to #include <cstdlib> and <cstring>.
I guess the string.h is custom written by the author of pjlib and i try to included those header you suggest in main.cpp and string.h but still cannot solve it.
I solve it by remove all the Additional Include directory and include necessary directory only.
You can simply include unnecessar directory.
When the compile complain a directory, then i include the directory only.
Now my problem is i cannot find the definition of the pjsua_core.c in all directory.
Does anyone know it ?
Last edited by Peter_APIIT; 09-30-2009 at 09:58 AM.
Add the .c files to the project directly. Add the .h files to the project directly. Add the folder to the project * as you have done. It should all clear up, with any luck.
I dislike ever adding a folder to the project and prefer that everything is expressed only in code. When you start using the compiler/makefile/other to contain information required to compile, the entire project collapses (requires months to unravel and fix) if you get a new compiler or a new operating system, etc.
So I typically use explicit includes of the entire path (something like ../../lib/libname/*.file). I happily modify the library's files to use the explicit path too, often this is several hundred changes you have to make to their darn header files (most library vendors insist on making a mess here) but once you are done (and, the changes are pretty easy to make, paste the same thing in front of each problem the compiler finds the issues) you have a nice setup that will work no matter where you copy it. It will work if you swap compilers and OS. It will work if the binary soup that compilers make goes bad, and it will work without a platform specific makefile that could fail when you move to a new machine. Note that you have to maintain a relative folder structure for your project to remain intact, and you should document that structure and be consistent across projects.
Why do all that? Nothing is worse that punching build on a project to find that it won't compile because "fatal error: cannot find <something.h> " included in "library.cpp". <something.h> could be *anywhere* on any machine in your network, on a mapped drive, or on a machine that is turned off in some kids basement in eastern mongolia. "../lib/library/something.h" is clearly expected to be a folder up in the lib directory.
The folder and project tools are very nice, dont get me wrong, but they are only nice until they stop working, and then it can be a major nightmare to fix it.
You saying that include a folder into whole project mess up when moving from one pc to another pc.
Therefore, you only explicit include the library path into your source code.
Please correct me if i was wrong.
The problem now is there is no .c file and .lib file from the library after i build it using visual studio 2005.
You can try to download the pjlib from here .
I totally agree with you that compiler error are very annoying because of the library problem.
If there is no .lib file, something is wrong.
Originally Posted by Peter_APIIT
Usually all you have to do is find and add a .lib file to your project, and include the headers, and its done. You may or may not also need to drop a dll in the final setup but thats not needed during compile.
For now use the visual folder path and do things normally. You can decide later if you want to bypass it. Lets get the project working normally before we tamper....
I will take a quick look at the project, but I have a pretty simple approach to such things: the tool compiles out of the box and works right away, or I delete it and find another way if at all possible.
It does not compile, the library is broken. You probably need to interact with their support at this point, I am not going to have time to fix someone else's broken project to make a library that I am not even going to use.
You might try making it under GCC with cygwin or something. From the looks of it, visual studio support is an afterthought and it started as a unix library, so one of the 60 make files might work, if you use the scripts they provided somehow with it.
By larryy@indiana. in forum ASP.NET
Last Post: 03-20-2009, 01:29 PM
By jsgasking in forum C++
Last Post: 08-28-2008, 05:42 PM
By maxChin in forum ASP.NET
Last Post: 04-04-2005, 08:59 AM
Last Post: 05-29-2003, 10:37 AM
By Tomer Cagan in forum ASP.NET
Last Post: 07-24-2001, 09:01 AM
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center