PDA

Click to See Complete Forum and Search --> : Damn Linker Error


Technocrat
Feb 20th, 2001, 03:27 PM
My program compiles ok but then it starts to link and it goes downhill. Here is my problem I have 3 cpp and 3 .h files that all have to be linked together, but one .h file appears to be messing me up.

Here is my main.h

#ifndef MAIN_H
#define MAIN_H

#include <windows.h>
#include <io.h>
#include <stdio.h>
#include <commctrl.h>
#include <initguid.h>

#include "graphicscontroller.h"
#include "gwmail.h"

function delceration
etc.

#endif



graphicscontroller.h

#ifndef GRAPHICSCONTROLLER.H
#define GRAPHICSCONTROLLER.H

#include "main.h"

functions
etc.

#endif


gwmail.h

#ifdef GWMAIL.H
#define

//Here is the troubled .h, it is a custome object for Novell GoupWise created by Novell
#include <gwoapi.h>

#include "main.h"

Functions
etc.

#endif


When I go to compile it I get
Main.Obj : Error Lnk2005: _CLSID_SHAREDNotification Already Defined In GraphicsControl.obj
and on and on for all the objects in gwoapi.h then it will go through the entire set of Groupwise Objects for the gwmail.obj. So I get a total of 681 error.

This is making me insane. If I have everything in one cpp and .h it works fine, but my functions are getting numerous and it would be cleaner if I could have many .cpp and .h

Any ideas?

Thanks

parksie
Feb 20th, 2001, 03:48 PM
#ifdef GWMAIL.H
#define

//Here is the troubled .h, it is a custome object for Novell GoupWise created by Novell
#include <gwoapi.h>

#include "main.h"

Functions
etc.

#endif

Try changing the first lines to:

#ifndef __GWMAIL_H__
#define __GWMAIL_H__

Technocrat
Feb 20th, 2001, 03:59 PM
That didnt work
Any other ideas?