|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
Compiler cannot read header files
Hi, to whom ever is concerned. I have recently downloaded crystal space and would like to compile some of its demos to see how well it works. However, when I compiled one of them, I get the following error:
Insert header file here: No such file or directory exists. What I do not get is that, when I downloaded Crystalspace, I saved it under the Dev-Cpp folder, the place where the compiler checks for header files, program files, etc. Can you help me? |
|
#2
|
||||
|
||||
|
Not quite enough information.
The place the compiler checks for header files is not always the same place that the compiler checks for program files. Note that there are two means of including header files: #include <whatever> #include "whenever" Many (maybe most) libraries will expect the headers to be put into the standard include directory. Others will expect you to add a directory to the list of directories the compiler searches. On another note, I would suggest that you move on from Dev-Cpp. It's stagnant and the debugger is horrible. You might have a look at Code:Blocks or VC++ 2008, depending upon your personal preferences. The latter has a great debugger.
__________________
C/C++ pointers (Original in the "Commonly Asked Questions" thread). |
|
#3
|
||||
|
||||
|
If you were to post the full Compile Log text (cut & paste it directly and completely) rather than giving a vague, ruthlessly edited, and paraphrased description, we would have half a chance of diagnosing your problem.
Note that Dev-C++ has its own user forum on Sourceforge. Clifford |
|
#4
|
|||
|
|||
|
Here is the compile log:
Compiler: Default compiler Executing g++.exe... g++.exe "C:\Dev-Cpp\C++ programs\crystalspace-src-1.2\crystalspace-src-1.2\apps\demo\demoop.cpp" -o "C:\Dev-Cpp\C++ programs\crystalspace-src-1.2\crystalspace-src-1.2\apps\demo\demoop.exe" -I"C:\Dev-Cpp\lib\gcc\mingw32\3.4.2\include" -I"C:\Dev-Cpp\include\c++\3.4.2\backward" -I"C:\Dev-Cpp\include\c++\3.4.2\mingw32" -I"C:\Dev-Cpp\include\c++\3.4.2" -I"C:\Dev-Cpp\include" -L"C:\Dev-Cpp\lib" C:\Dev-Cpp\C++ programs\crystalspace-src-1.2\crystalspace-src-1.2\apps\demo\demoop.cpp:19:22: cssysdef.h: No such file or directory C:\Dev-Cpp\C++ programs\crystalspace-src-1.2\crystalspace-src-1.2\apps\demo\demoop.cpp:21:25: csgeom/path.h: No such file or directory C:\Dev-Cpp\C++ programs\crystalspace-src-1.2\crystalspace-src-1.2\apps\demo\demoop.cpp:22:28: cstool/csfxscr.h: No such file or directory C:\Dev-Cpp\C++ programs\crystalspace-src-1.2\crystalspace-src-1.2\apps\demo\demoop.cpp:23:28: csutil/cscolor.h: No such file or directory C:\Dev-Cpp\C++ programs\crystalspace-src-1.2\crystalspace-src-1.2\apps\demo\demoop.cpp:24:26: csutil/flags.h: No such file or directory C:\Dev-Cpp\C++ programs\crystalspace-src-1.2\crystalspace-src-1.2\apps\demo\demoop.cpp:26:28: iengine/camera.h: No such file or directory C:\Dev-Cpp\C++ programs\crystalspace-src-1.2\crystalspace-src-1.2\apps\demo\demoop.cpp:27:28: iengine/engine.h: No such file or directory C:\Dev-Cpp\C++ programs\crystalspace-src-1.2\crystalspace-src-1.2\apps\demo\demoop.cpp:28:27: iengine/light.h: No such file or directory C:\Dev-Cpp\C++ programs\crystalspace-src-1.2\crystalspace-src-1.2\apps\demo\demoop.cpp:29:26: iengine/mesh.h: No such file or directory C:\Dev-Cpp\C++ programs\crystalspace-src-1.2\crystalspace-src-1.2\apps\demo\demoop.cpp:30:29: iengine/movable.h: No such file or directory C:\Dev-Cpp\C++ programs\crystalspace-src-1.2\crystalspace-src-1.2\apps\demo\demoop.cpp:31:28: iengine/sector.h: No such file or directory C:\Dev-Cpp\C++ programs\crystalspace-src-1.2\crystalspace-src-1.2\apps\demo\demoop.cpp:32:26: imesh/object.h: No such file or directory C:\Dev-Cpp\C++ programs\crystalspace-src-1.2\crystalspace-src-1.2\apps\demo\demoop.cpp:33:25: imesh/thing.h: No such file or directory C:\Dev-Cpp\C++ programs\crystalspace-src-1.2\crystalspace-src-1.2\apps\demo\demoop.cpp:34:27: ivaria/conout.h: No such file or directory C:\Dev-Cpp\C++ programs\crystalspace-src-1.2\crystalspace-src-1.2\apps\demo\demoop.cpp:35:29: ivaria/reporter.h: No such file or directory C:\Dev-Cpp\C++ programs\crystalspace-src-1.2\crystalspace-src-1.2\apps\demo\demoop.cpp:36:25: ivaria/view.h: No such file or directory C:\Dev-Cpp\C++ programs\crystalspace-src-1.2\crystalspace-src-1.2\apps\demo\demoop.cpp:37:28: ivideo/graph3d.h: No such file or directory C:\Dev-Cpp\C++ programs\crystalspace-src-1.2\crystalspace-src-1.2\apps\demo\demoop.cpp:38:27: ivideo/txtmgr.h: No such file or directory In file included from C:\Dev-Cpp\C++ programs\crystalspace-src-1.2\crystalspace-src-1.2\apps\demo\demoop.cpp:40: C:\Dev-Cpp\C++ programs\crystalspace-src-1.2\crystalspace-src-1.2\apps\demo\/demo.h:23:27: csgeom/math2d.h: No such file or directory C:\Dev-Cpp\C++ programs\crystalspace-src-1.2\crystalspace-src-1.2\apps\demo\/demo.h:24:27: csgeom/math3d.h: No such file or directory After these errors, there are a huge list of syntax errors that are too large to fit this post |
|
#5
|
|||
|
|||
|
Here is the program:
/* Copyright (C) 2001 by Jorrit Tyberghein This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "cssysdef.h" #include "csgeom/path.h" #include "cstool/csfxscr.h" #include "csutil/cscolor.h" #include "csutil/flags.h" #include "iengine/camera.h" #include "iengine/engine.h" #include "iengine/light.h" #include "iengine/mesh.h" #include "iengine/movable.h" #include "iengine/sector.h" #include "imesh/object.h" #include "imesh/thing.h" #include "ivaria/conout.h" #include "ivaria/reporter.h" #include "ivaria/view.h" #include "ivideo/graph3d.h" #include "ivideo/txtmgr.h" #include "demo.h" #include "demoseq.h" #include "demoop.h" void FadeOp: o (csTicks dt, iBase*){ DemoSequenceManager::demoseq->SetupFade (start_fade, end_fade, total_fade_time, dt); } RotatePartOp::RotatePartOp (const char* meshName, csTicks total, float aspeed) : total_rotate_time (total), angle_speed (aspeed) { mesh = DemoSequenceManager::demo->engine->GetMeshes ()->FindByName (meshName); if (!mesh) { DemoSequenceManager::demo->Report (CS_REPORTER_SEVERITY_ERROR, "Can't find mesh '%s'", meshName); exit (0); } } void RotatePartOp: o (csTicks dt, iBase*){ DemoSequenceManager::demoseq->SetupRotatePart (mesh, angle_speed, total_rotate_time, dt); } AttachOp::AttachOp (const char* meshName, const char* pathName) { if (meshName) { mesh = DemoSequenceManager::demo->engine->GetMeshes () ->FindByName (meshName); if (!mesh) { DemoSequenceManager::demo->Report (CS_REPORTER_SEVERITY_ERROR, "Can't find mesh '%s'", meshName); exit (0); } } else mesh = 0; path = DemoSequenceManager::demoseq->FindPath (pathName); if (!path) { DemoSequenceManager::demo->Report (CS_REPORTER_SEVERITY_ERROR, "Can't find path '%s'", pathName); exit (0); } } void AttachOp: o (csTicks /*dt*/, iBase*){ DemoSequenceManager::demoseq->ReplacePathObject (path, mesh); } PathOp::PathOp (csTicks t, const char* meshName, const char* pathName) { total_path_time = t; if (meshName) { mesh = DemoSequenceManager::demo->engine->GetMeshes () ->FindByName (meshName); if (!mesh) { DemoSequenceManager::demo->Report (CS_REPORTER_SEVERITY_ERROR, "Can't find mesh '%s'", meshName); exit (0); } } else mesh = 0; path = DemoSequenceManager::demoseq->FindPath (pathName); if (!path) { DemoSequenceManager::demo->Report (CS_REPORTER_SEVERITY_ERROR, "Can't find path '%s'", pathName); exit (0); } } void PathOp: o (csTicks dt, iBase*){ DemoSequenceManager::demoseq->SetupPath (path, mesh, total_path_time, dt); } SetupMeshOp::SetupMeshOp (const char* meshName, const char* sectName, const csVector3& p) { pos = p; mesh = DemoSequenceManager::demo->engine->GetMeshes () ->FindByName (meshName); if (!mesh) { DemoSequenceManager::demo->Report (CS_REPORTER_SEVERITY_ERROR, "Can't find mesh '%s'", meshName); exit (0); } sector = DemoSequenceManager::demo->engine->GetSectors () ->FindByName (sectName); if (!sector) { DemoSequenceManager::demo->Report (CS_REPORTER_SEVERITY_ERROR, "Can't find sector '%s'", sectName); exit (0); } } void SetupMeshOp: o (csTicks /*dt*/, iBase*){ if (mesh) { iMovable* movable = mesh->GetMovable (); movable->SetSector (sector); movable->SetPosition (pos); movable->UpdateMove (); } } ShowMeshOp::ShowMeshOp (const char* meshName) { mesh = DemoSequenceManager::demo->engine->GetMeshes () ->FindByName (meshName); if (!mesh) { DemoSequenceManager::demo->Report (CS_REPORTER_SEVERITY_ERROR, "Can't find mesh '%s'", meshName); exit (0); } } void ShowMeshOp: o (csTicks /*dt*/, iBase*){ if (mesh) { mesh->SetFlagsRecursive (CS_ENTITY_INVISIBLE, 0); } } HideMeshOp::HideMeshOp (const char* meshName) { mesh = DemoSequenceManager::demo->engine->GetMeshes () ->FindByName (meshName); if (!mesh) { DemoSequenceManager::demo->Report (CS_REPORTER_SEVERITY_ERROR, "Can't find mesh '%s'", meshName); exit (0); } } void HideMeshOp: o (csTicks /*dt*/, iBase*){ if (mesh) { mesh->SetFlagsRecursive (CS_ENTITY_INVISIBLE, CS_ENTITY_INVISIBLE); } } void TestOp: o (csTicks dt, iBase*){ csPrintf ("dt=%ld fps=%g\n", (long)dt, DemoSequenceManager::demoseq->GetFPS ()); fflush (stdout); } RecurseOp::RecurseOp (iSequence* sequence, csRef<iSequenceManager> manager) { seq = sequence; seqmgr = manager; } void RecurseOp: o (csTicks /*dt*/, iBase*){ seqmgr->RunSequence (0, seq); } //----------------------------------------------------------------------------- |
|
#6
|
||||
|
||||
|
There's a thread at the top of the forum called "New users - HOW TO POST A QUESTION - READ THIS FIRST".
One would think that the meaning was fairly obvious, not obscure at all. One would apparently be wrong. Try reading and comprehending it. Pay particular attention to the part about "code tags." Also, find out what directory those header files are actually in. |
|
#7
|
||||
|
||||
|
Quote:
In addition to added code tags, lose those stinkin' smilies! All those stupid things are good for is to mung up C++ code. Check the "Disable smilies in text" check box in the Miscellaneous Options section. |
|
#8
|
||||
|
||||
|
Quote:
OK, here's a couple stupid questions: 1. Does this directory exist?: C:\Dev-Cpp\C++ programs\crystalspace-src-1.2\crystalspace-src-1.2\apps\demo\csgeom 2. If the answer to #1 is "yes", then does this file exist in that directory?: path.h PS If the answer to Question #1 is "no" (as I very strong suspect to be the case), then you need to add a -I option that gives the compiler the directory path to those header files. If you're using the Dev-C++ IDE, then I have no clue where you would go to set that. I gave up on that PoS years ago and only run the compiler from the command line. Last edited by dwise1_aol : May 9th, 2008 at 06:28 PM. |
|
#9
|
||||
|
||||
|
The way you have the project set up, the listed missing files must be in one of:
"C:\Dev-Cpp\C++ programs\crystalspace-src-1.2\crystalspace-src-1.2\apps\demo\" "C:\Dev-Cpp\lib\gcc\mingw32\3.4.2\include" "C:\Dev-Cpp\include\c++\3.4.2\backward" "C:\Dev-Cpp\include\c++\3.4.2\mingw32" "C:\Dev-Cpp\include\c++\3.4.2" "C:\Dev-Cpp\include" or (in the case of those listed with a directory prefix such as csgeom/path.h) the named subfolder of either of the above. "C:\Dev-Cpp\include\csgeom" for example. Only you can tell us where these files actually exist! I recommend that you actually add a new path (outside of the Dev-C++ installation), and place the third-party library files there. Make sure you use the 'project' feature in Dev-C++, and set up the include paths in the Project->options->directories dialog. You will also have to add a library path I suspect. A few other things you should know about Dev-C++, and may have discovered had you addressed the specialist forum (or read their 'read first' thread first ). 1) There are a number of circumstances where it will fail simply because a project path contains a space (such as "\C++ programs") 2) There is a bug in the IDE that sometimes causes builds to fail when the project is a subdirectory of the dev-cpp installation folder (c:\dev-cpp). It is a bad idea to 'pollute' the installation in any case, but you should move your project out or c:\dev-cpp. Clifford Last edited by clifford : May 10th, 2008 at 02:27 AM. |
|
#10
|
|||
|
|||
|
Try to compile it manually, the Dev-CPP has a lot of bugs.
A "good" IDE is code::blocks try it instead of Dev, but it is still in development |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > C Programming > Compiler cannot read header files |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|