Re: IDL make_dll and unresolved externals [message #69686] |
Wed, 03 February 2010 02:50 |
Wout De Nolf
Messages: 194 Registered: October 2008
|
Senior Member |
|
|
On Tue, 2 Feb 2010 18:13:34 -0800 (PST), james
<james5452003@yahoo.com> wrote:
> I think my problem currently is with make_dll, and not with
> call_external. After make_dll is called, I have an unresolved
> external error at compile time.
> I do set the header directories and .lib file locations parameters for
> the make_dll command, though. As for finding the opencv dll's, I'm
> not sure how to direct its location using the make_dll command. Is
> there somewhere I can set this on the IDL workbench?
>
> I am unfamiliar with dependency walker and idl_opserver. I will look
> into these. (I am relatively new to IDL)
Ah, sorry. Or to quote Kenneth: RTFQ :-).
So make_dll can't make the dll and gives a very helpful "unresolved
external error" message.
The next obvious question: can you compile and build the C-code
without make_dll (i.e. C compiler and linker)? Btw, this is C code and
not C++ right?
As for the location of the dll. This is only needed when calling your
dll, not when building it. You don't need it at all if you statically
link to opencv.
Dependency walker checks export functions (and decoration) as well as
external dependencies. This helps you in finding out what's wrong when
call_external throughs an error. Since you can't even build the dll,
this will not help you at this stage :-).
idl_opserver is running when you start IDL. If you have a debugger
than you could attach that debugger to idl_opserver, set a breakpoint
in your C code and call "call_external" in IDL. It will break and you
can trace through your C-code to find out what's wrong. Here again:
this only helps in debugging the dll when you call its functions.
|
|
|
Re: IDL make_dll and unresolved externals [message #69690 is a reply to message #69686] |
Tue, 02 February 2010 18:13  |
james
Messages: 9 Registered: March 1992
|
Junior Member |
|
|
I think my problem currently is with make_dll, and not with
call_external. After make_dll is called, I have an unresolved
external error at compile time.
I do set the header directories and .lib file locations parameters for
the make_dll command, though. As for finding the opencv dll's, I'm
not sure how to direct its location using the make_dll command. Is
there somewhere I can set this on the IDL workbench?
I am unfamiliar with dependency walker and idl_opserver. I will look
into these. (I am relatively new to IDL)
Wox wrote:
> On Sat, 30 Jan 2010 19:03:59 -0800 (PST), james
> <james5452003@yahoo.com> wrote:
>
>> Hi,
>> I am trying to use the call_external for C code and am using make_dll
>> to compile the dll. The problem I am having is with the make_dll. I
>> am including another library (opencv) in the c code and it seems to
>> compile okay when I just declare a (opencv type) variable from that
>> library. But when I include a call of any one of the functions from
>> the (opencv) library in the code, there is unresolved external
>> compiler error on it.
>>
>> Any suggestions on what I am doing incorrectly? Can other libraries
>> like opencv be used for IDL?
>
> Ok, just to make sure I understand: you make a dll with export
> functions in portable calling convention. In one of these functions
> you call a function from the opencv library. Using call_external gives
> some kind of error which you expect comes from calling the opencv
> function.
>
> Did you link opencv statically or dynamically (check with depency
> walker). If it's dynamic linking, make sure your dll is finding the
> opencv dll.
>
> Did you try calling your dll from C? Did is work?
>
> You can also attach a debugger to idl_opserver and set a breakpoint
> just before the error occurs. Easy in visual studio express (free),
> not sure what you have...
|
|
|
Re: IDL make_dll and unresolved externals [message #69703 is a reply to message #69690] |
Mon, 01 February 2010 03:00  |
Wout De Nolf
Messages: 194 Registered: October 2008
|
Senior Member |
|
|
On Sat, 30 Jan 2010 19:03:59 -0800 (PST), james
<james5452003@yahoo.com> wrote:
> Hi,
> I am trying to use the call_external for C code and am using make_dll
> to compile the dll. The problem I am having is with the make_dll. I
> am including another library (opencv) in the c code and it seems to
> compile okay when I just declare a (opencv type) variable from that
> library. But when I include a call of any one of the functions from
> the (opencv) library in the code, there is unresolved external
> compiler error on it.
>
> Any suggestions on what I am doing incorrectly? Can other libraries
> like opencv be used for IDL?
Ok, just to make sure I understand: you make a dll with export
functions in portable calling convention. In one of these functions
you call a function from the opencv library. Using call_external gives
some kind of error which you expect comes from calling the opencv
function.
Did you link opencv statically or dynamically (check with depency
walker). If it's dynamic linking, make sure your dll is finding the
opencv dll.
Did you try calling your dll from C? Did is work?
You can also attach a debugger to idl_opserver and set a breakpoint
just before the error occurs. Easy in visual studio express (free),
not sure what you have...
|
|
|