Help About import external Lib

supporse there is a lib called “extlib.lib” and the lib’s header file called “extlib.h”,i created a dummy header called “dummy.h”

The Contents of extlib.h:

#include "libstruct.h"
int _DLLEXPORT funcA(vector<NodeInfo> &test,_int64 type);

The contents of dummy.h

#ifndef __MAKECINT__
	#include "extlib.h"
#else
             #include "libstruct.h"
             int funcA(vector<NodeInfo> &test,long long type);
             //#pragma link C++ function funcA;
#endif  

The contents of “libstruct.h”:

//Here include some windows header
#include <PshPack8.h>
 typedef struct NodeInfoTag
{
   _int64 varA;//here use the _int64
   ............
}NodeInfo;
#include <PopPack.h>

then i typed

makecint -mk Makefile -dl libext.dll -H dummy.h -l extlib.lib
make

while the response says:

Question:

Hi,

It looks like you are simply missing the #include

Cheers,
Philippe.

where should i add the "#include "?

i tried to add the above statement.but it seems not functional;
i don’t now y.

the contents of dummy.h

#ifndef DUMMY_H
#define DUMMY_H
             //111111111111111111111111111   place1
#ifndef __MAKECINT__ 
             //222222222222222222222222222   place2
             #include "extlib.h" 
#else 
             //333333333333333333333333333   place3
             #include "libstruct.h" 
             int funcA(vector<NodeInfo> &test,long long type); 
             //#pragma link C++ function funcA; 
#endif

#endif  

i place the include statement at the place1(//11111111),but there seems no function.y?

btw, what the difference of place1,place2,place3?

am i right that the place 1 is processed by both cint.exe and cl.exe?
am i right that the place 2 is peocessed only by cl.exe?
am i right that the place 3 is only processed by cint.exe?

do i need to add “using namespace std;” follow the "#include " statements?
when i added the “using namespace std”,there has lots of errors about the vector.

really confusing…

Hi,

It should alreday be included in extlib.h because you say that it’s used in there. It should also read int _DLLEXPORT funcA(std::vector<NodeInfo> &test,_int64 type);in extlib.h.

I would add #include at what you call “place 3” - i.e. just #include it where it’s needed or used.

[quote=“luckyzhangwei”]btw, what the difference of place1,place2,place3?

am i right that the place 1 is processed by both cint.exe and cl.exe?
am i right that the place 2 is peocessed only by cl.exe?
am i right that the place 3 is only processed by cint.exe?
[/quote]
Correct.

No.

You did pretty well for that :slight_smile:

Cheers, Axel.