hey guys,
i have this weird problem. i have a native dll i did. i create a struct in it, and declare a pointer and use it in a function member in a class. i compile this native dll with absolutely no problem at all.
i come to wrap this native dll in a managed dll. i include the header file of the native and the lib file, and compile without using the code from native dll. and i get a "error C2061: syntax error : identifier 'NMaterial'" in the native dll.
why is that
here is my native dll code
[code]
// the structure
#ifndef NMATERIAL_DEFINED
typedef struct NMaterial: public D3DMATERIAL9
{
public:
NMaterial()
{}
}NMaterial, *LPNMaterial;
#define NMATERIAL_DEFINED
#endif
// the class
class NDeviceMaterial
{
public:
NDeviceMaterial();
~NDeviceMaterial(void);
void SetMaterial( NMaterial );
};
[/code]
and in my managed dll i wrote this in the stdafx.h file:
[code]
#pragma once
#include <nrenderd3d.h>
#include "windows.h"
#pragma comment(lib, "nrenderd3d.lib")
[/code]
note: nrenderd3d.h is the header file where i have all of my headers so i can use in other dlls.
the nrenderd3d.h has the following:
[code]
#pragma
once#include
"NStructs.h" #include "NDeviceMaterial.h" [/code]
error C2061 when compilling
Gerald.Wright
my problem was in the header file in the native dll that i did. that header file contained all of the headers in my native dll so i can accessin the managed dll.
i listed all of the headers in my native dll in that file. it seems that was wrong. i removed them, and it compiled correctly and everything worked just gr8.
Dinesh Bhat
Please post fix to futher edify the group :)
Thnks!
Dan
Yunizar
problem is solved, i fixed my problem.
thxx
Bernhard Roos
forgot to say, the "struct NMaterial" is available in the #include "NStructs.h".
NDeviceMaterial is available in the NDeviceMaterial.h file in the native dll.