C (167/254)

From:Joris Kempen
Date:13 Apr 00 at 23:00:05
Subject:StormC and headers...

Hi ppl,

I am driving myself completely crazy using StormC... Btw i got back to
Storm2 becuase i think that version 3 is completely rubbish for me. But the
following problem did i have with both versions.
It's al about headers files and stuff..

I don't know how to work with those damn header files, even my ansi-c book
doesn't tell me really how it works..

Let's say i have:

main.c

#include "test.h"

int main(){
p1();
}

test.h

#ifndef TEST
#define TEST
extern void p1();
//#include "test.c" or maybe i need to include "test.c" again? my damn
C
book never does this, i really confused!!!!!
#endif

test.c

// #include "test.h" i really don't know if this is nessacary again ?
plz
explain to include what and how this works
#include <stdio.h
void p1()
{
printf("p1");
}

is i try this StormC gives Linker error symbol "_p1" not defined (hint
"_main"). I really hates this error because i really don't see what i am
doing wrong. This is my big reason that i didn't work with more then 1 file
in my projects last months.. My ansi-c book doesn't help

Plz what is the solution and someone can give a basic explaination about
how
to work with includes and mutliply files...

I'm really confused!!!!!

BTW i found out that when i add #include "test.c" in the test.h it works,
but i never saw this in any other .h files... i searched the whole DevCD2.1
but never found.

Aaah i wish i was a better programmer :) It's just the preprocessor and i
still don't get it... Sometis i thaught that if you do #include blah.h it
also includes blah.c but if the preproc only does copy/paste this can't be
true, so i probably also need to include test.c in test.h Aaah again
Joris Kempen

------------------------------------------------------------------------
Free E-Cards, Screensavers, and Digital Pictures!
Corbis.com:
http://click.egroups.com/1/3358/1/_/451227/_/955663397/
------------------------------------------------------------------------