POV-Ray : Newsgroups : moray.win : Plugin linking problem Server Time
29 Jul 2024 02:21:54 EDT (-0400)
  Plugin linking problem (Message 1 to 4 of 4)  
From: Marcin Tustin
Subject: Plugin linking problem
Date: 10 Oct 1999 08:52:36
Message: <MPG.126a9c4ed9983e1e989680@news.stmuc.com>
The text that follows was sent to comp.programming.C++

	Hello all! I'm new to C++, and I'm writing a dll 
plugin for Moray. I have two translation units, and I need 
to communicate between them. Here are the headers.
Once they compile, I get errors like "GetDLLInfo already 
defined in Blob.obj" when linking Blobinterface.obj. 
Incidentally, I'm using VC++ 6.

// Blob.h : main header file for the BLOB DLL
//

#if 
!defined(AFX_BLOB_H__908F9E32_5567_11D3_BD31_AFFA61F8C72B__I
NCLUDED_)
#define 
AFX_BLOB_H__908F9E32_5567_11D3_BD31_AFFA61F8C72B__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#ifndef __AFXWIN_H__
	#error include 'stdafx.h' before including this file 
for PCH
#endif

#ifndef _MFCPA_H_
#include "..\MFCPluginApp.h"
#define _MFCPA_H_
#endif

#ifndef _MFCPACPP_
#include "..\MFCPluginApp.cpp"
#define _MFCIHPP_
#define _MFCPACPP_
#endif



#include "..\plugin.h"
#include "resource.h"		// main symbols

#include <afxcoll.h>
#include <afxtempl.h>


//#include "map.h"


////////////////////////////////////////////////////////////
/////////////////
// CBlobApp
// See Blob.cpp for the implementation of this class
//

//typedef CMap<DWORD,DWORD,CMyStruct*,CMyStruct*&> BLOBMAP;

class CBlobApp : public CMFCPluginApp
{
public:
	void RegisterBlob(long hHandle, MRY_OBJ_ATTRIBUTES 
BlobStruct);
	CBlobApp();

	virtual LRESULT GetDLLInfo(LPMRY_DLLINFO pDataBlock);
	virtual BOOL InitInstance();

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CBlobApp)
	//}}AFX_VIRTUAL

	//{{AFX_MSG(CBlobApp)
		// NOTE - the ClassWizard will add and remove 
member functions here.
		//    DO NOT EDIT what you see in these blocks 

of generated code !
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
private:
	CMap<LONG,LONG,MRY_OBJ_ATTRIBUTES,MRY_OBJ_ATTRIBUTES 
gBlobMap;

	
}
//Blob.cpp declares CBlobApp theApp, but does not initialize 

it.

//////////
//Blobinterface.h
#ifndef _BLOB_INTERFACES_HPP_
#define _BLOB_INTERFACES_HPP_

#pragma once

#ifndef _MFCIHPP_
#define _MFCIHPP_
#include "..\MFCInterface.hpp"
#endif

#ifndef _MFCICPP_
#define _MFCICPP_
//#include "..\MFCInterface.cpp"
#endif

//#include "..\MFCPluginApp.h"


#include "blob.cpp"
//#include "map.h"
// Forward-declare the Scene Interface class
class CScene;



////////////////////////////////////////////////////////////
/////
// CScene Scene Interface
// This interface is used to communicate with Moray and to 
receive
// event messages from Moray.
////////////////////////////////////////////////////////////
/////
class CScene : public CSceneInterface {
	DECLARE_SCENE_STATIC(CScene);
	// NO objects defined by 
blobCLensFlareInterface*	m_pLensInterface;
public:
//	void AddApp(CBlobApp* panApp);

	virtual void Init();
	virtual long OnEvent(long hObjID,int nFlags);
//	CBlobApp *ptheApp;
	
	
	//No new objects void 
SetLensFlareInterface(CLensFlareInterface*	pLensInterfa
ce) {	m_pLensInterface=pLensInterface; };
}

extern CBlobApp theApp;



#endif

-- 
Humanity will not be happy until the day when the 
last bureaucrat has been hanged with the guts of
the last capitalist.

Marcin Tustin
Mar### [at] mindlessREMOVEGOATS&OATS.com
Marcint@^^refreshmagazine.com.nomail


Post a reply to this message

From: axiom
Subject: Re: Plugin linking problem
Date: 10 Oct 1999 08:57:25
Message: <38008D63.2233B19E@mninter.net>
I can't help with your problem, but personally, I wouldn't send anything
this specific to comp.programming.c++....you'll get flamed from here to
sunday and back. But heck, you'll have figured that out by now<G>.

Marcin Tustin wrote:

> The text that follows was sent to comp.programming.C++
>
>         Hello all! I'm new to C++, and I'm writing a dll
> plugin for Moray. I have two translation units, and I need
> to communicate between them. Here are the headers.
> Once they compile, I get errors like "GetDLLInfo already
> defined in Blob.obj" when linking Blobinterface.obj.
> Incidentally, I'm using VC++ 6.
>
> // Blob.h : main header file for the BLOB DLL
> //
>
> #if
> !defined(AFX_BLOB_H__908F9E32_5567_11D3_BD31_AFFA61F8C72B__I
> NCLUDED_)
> #define
> AFX_BLOB_H__908F9E32_5567_11D3_BD31_AFFA61F8C72B__INCLUDED_
>
> #if _MSC_VER > 1000
> #pragma once
> #endif // _MSC_VER > 1000
>
> #ifndef __AFXWIN_H__
>         #error include 'stdafx.h' before including this file
> for PCH
> #endif
>
> #ifndef _MFCPA_H_
> #include "..\MFCPluginApp.h"
> #define _MFCPA_H_
> #endif
>
> #ifndef _MFCPACPP_
> #include "..\MFCPluginApp.cpp"
> #define _MFCIHPP_
> #define _MFCPACPP_
> #endif
>
> #include "..\plugin.h"
> #include "resource.h"           // main symbols
>
> #include <afxcoll.h>
> #include <afxtempl.h>
>
> //#include "map.h"
>
> ////////////////////////////////////////////////////////////
> /////////////////
> // CBlobApp
> // See Blob.cpp for the implementation of this class
> //
>
> //typedef CMap<DWORD,DWORD,CMyStruct*,CMyStruct*&> BLOBMAP;
>
> class CBlobApp : public CMFCPluginApp
> {
> public:
>         void RegisterBlob(long hHandle, MRY_OBJ_ATTRIBUTES
> BlobStruct);
>         CBlobApp();
>
>         virtual LRESULT GetDLLInfo(LPMRY_DLLINFO pDataBlock);
>         virtual BOOL InitInstance();
>
> // Overrides
>         // ClassWizard generated virtual function overrides
>         //{{AFX_VIRTUAL(CBlobApp)
>         //}}AFX_VIRTUAL
>
>         //{{AFX_MSG(CBlobApp)
>                 // NOTE - the ClassWizard will add and remove
> member functions here.
>                 //    DO NOT EDIT what you see in these blocks
>
> of generated code !
>         //}}AFX_MSG
>         DECLARE_MESSAGE_MAP()
> private:
>         CMap<LONG,LONG,MRY_OBJ_ATTRIBUTES,MRY_OBJ_ATTRIBUTES
> gBlobMap;
>
>
> }
> //Blob.cpp declares CBlobApp theApp, but does not initialize
>
> it.
>
> //////////
> //Blobinterface.h
> #ifndef _BLOB_INTERFACES_HPP_
> #define _BLOB_INTERFACES_HPP_
>
> #pragma once
>
> #ifndef _MFCIHPP_
> #define _MFCIHPP_
> #include "..\MFCInterface.hpp"
> #endif
>
> #ifndef _MFCICPP_
> #define _MFCICPP_
> //#include "..\MFCInterface.cpp"
> #endif
>
> //#include "..\MFCPluginApp.h"
>
> #include "blob.cpp"
> //#include "map.h"
> // Forward-declare the Scene Interface class
> class CScene;
>
> ////////////////////////////////////////////////////////////
> /////
> // CScene Scene Interface
> // This interface is used to communicate with Moray and to
> receive
> // event messages from Moray.
> ////////////////////////////////////////////////////////////
> /////
> class CScene : public CSceneInterface {
>         DECLARE_SCENE_STATIC(CScene);
>         // NO objects defined by
> blobCLensFlareInterface*        m_pLensInterface;
> public:
> //      void AddApp(CBlobApp* panApp);
>
>         virtual void Init();
>         virtual long OnEvent(long hObjID,int nFlags);
> //      CBlobApp *ptheApp;
>
>
>         //No new objects void
> SetLensFlareInterface(CLensFlareInterface*      pLensInterfa
> ce) {   m_pLensInterface=pLensInterface; };
> }
>
> extern CBlobApp theApp;
>
> #endif
>
> --
> Humanity will not be happy until the day when the
> last bureaucrat has been hanged with the guts of
> the last capitalist.
>
> Marcin Tustin
> Mar### [at] mindlessREMOVEGOATS&OATS.com
> Marcint@^^refreshmagazine.com.nomail



--
Semper ubi sub ubi
- Teresa Roguski


Post a reply to this message

From: Marcin Tustin
Subject: Re: Plugin linking problem
Date: 10 Oct 1999 08:58:24
Message: <MPG.126a9daf8d0e26bd989681@news.stmuc.com>
In article <MPG### [at] newsstmuccom>, 
Mar### [at] joojooflopmindlesscom says...
>
>The text that follows was sent to comp.programming.C++
That should read comp.lang.c++. Sorry. 

-- 
Humanity will not be happy until the day when the 
last bureaucrat has been hanged with the guts of
the last capitalist.

Marcin Tustin
Mar### [at] mindlessREMOVEGOATS&OATS.com
Marcint@^^refreshmagazine.com.nomail


Post a reply to this message

From: Lutz Kretzschmar
Subject: Re: Plugin linking problem
Date: 10 Oct 1999 11:37:11
Message: <3802b203.3394360@194.174.214.110>
I can't quite follow the file. Was that one file you posted called
blob.h? If not where does the next file start. The error you mention
can be a result of including a CPP file in an H (or two other CPP)
files. 
Also, are those lines in your post that are commented out, really
commented out in the project?

Feel free to mail me the whole project and I'll take a quick look.
- Lutz
  email : lut### [at] stmuccom
  Web   : http://www.stmuc.com/moray


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.