 |
 |
.C .H #include path madness
|
 |
|
 |
|
Dedicated MacNNer
Join Date: May 2002
Location: Brooklyn, NY
Status:
Offline
|
|
Hi,
I'm writing a C++ program, with .H and .C files. In the .C file (called BezierEdge.C) I have:
Code:
#include<BezierEdge.H>
and then, BezierEdge.H is in the same folder. No matter what I do, it will not find the header file unless I do:
Code:
#include</Users/gtaubman/Desktop/VSim/BezierEdge.H>
I feel like that's ridiculous, and I've never had to do that on other platforms, and I remember not having to do that in other programs I've written in OS X. Help! What am I doing that's so stupid!
Incase it matters, I'm using Makefile builds, and the output of a successful compile looks like this:
Code:
g++ -g -DCG_ENABLED -Wimplicit -Wreturn-type -Wformat -Wparentheses -Wpointer-arith -Woverloaded-virtual -c BezierEdge.C
g++ -g -DCG_ENABLED -Wimplicit -Wreturn-type -Wformat -Wparentheses -Wpointer-arith -Woverloaded-virtual -c ViolaSimMain.C
g++ -o ViolaSim -g -DCG_ENABLED -Wimplicit -Wreturn-type -Wformat -Wparentheses -Wpointer-arith -Woverloaded-virtual BezierEdge.o ViolaSimMain.o -framework OpenGL -framework GLUT -lobjc
gabe
|
|
|
| |
|
|
|
 |
|
 |
|
Junior Member
Join Date: Dec 2003
Location: New Jersey
Status:
Offline
|
|
Originally posted by Zimwy:
Hi,
I'm writing a C++ program, with .H and .C files. In the .C file (called BezierEdge.C) I have:
Gabe,
I just started on C++ myself, but one of the first mistakes I made was naming my files .c and .h. For some reason I had thought that you could keep those extensions, but I guess the compiler often gets confused interpreting C++ code unless you're using .hpp and .cpp (or .cc).
Ben
|
|
MacBook 2.4 GHz
Mac OS X 10.5.8
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Sep 2000
Location: Tempe, AZ
Status:
Offline
|
|
Use quotes instead of angle brackets.
Code:
#include "BezierEdge.H"
|
Geekspiff - generating spiffdiddlee software since before you began paying attention.
|
| |
|
|
|
 |
|
 |
|
Senior User
Join Date: Feb 2001
Location: Deer Crossing, CT
Status:
Offline
|
|
Originally posted by smeger:
Use quotes instead of angle brackets.
Code:
#include "BezierEdge.H"
To expand on this, only use the <> symbols for standard libraries. You can find these libraries in /usr/include
For example, #include <sys/time.h> would be found in the /usr/include/sys/ directory.
Use the "" symbols for non-standard libraries (which are usually in the same dir as the source you are compiling.
|
|
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |