Re: header file
From: Chris Mantoulidis (cmad_x_at_yahoo.com)
Date: 12/24/03
- Next message: Gianni Mariani: "Re: [OT] Can anyone recommend a good game library?"
- Previous message: Jeff Schwab: "Re: Abstract Data Types - Separating Interface from Implementation"
- In reply to: mescaline: "header file"
- Next in thread: Rolf Magnus: "Re: header file"
- Reply: Rolf Magnus: "Re: header file"
- Reply: mescaline: "Re: header file"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 23 Dec 2003 23:23:00 -0800
apt2003@columbia.edu (mescaline) wrote in message news:<e54f0744.0312231752.1c1bf04c@posting.google.com>...
> Hi I have the following doubt about header files --
> I have the foll. 3 files in a folder.
>
> File 1: one.cpp
> #include <hel.h>
#include "hel.h"
> #include <iostream>
> using namespace std;
>
> int main(){
> hello();
> return 0;
> }
>
>
> File 2: hel.h
> #ifndef HEL_H
> #define
it should be #define HEL_H
> void hello();
> #endif
>
> File 3: hel.cpp
> #include <hel.h>
#include "hel.h"
> void hello(){
> cout << "Hello" << endl;
> }
>
> --------------
> I just need the output Hello using this header file formatting. I have
> these three files in a folder. How should I compile these three files
> using g++? WHen I just try g++ one.cpp, I get the output: hel.h: No
> such file or directory
>
> Thanks
> m
Wrong way to compile them... Do:
g++ -c hel.cpp
g++ -c one.cpp
g++ -o one one.cpp
;) I suppose you are on Linux, that's why I add no extension to the
executable. You can change it if you want
- Next message: Gianni Mariani: "Re: [OT] Can anyone recommend a good game library?"
- Previous message: Jeff Schwab: "Re: Abstract Data Types - Separating Interface from Implementation"
- In reply to: mescaline: "header file"
- Next in thread: Rolf Magnus: "Re: header file"
- Reply: Rolf Magnus: "Re: header file"
- Reply: mescaline: "Re: header file"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|