473,396 Members | 1,892 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Baffling unresolved token error

I'm trying to get FFTW (fftw.org) to work in such a way that it can be
called from a managed C++ module. The approach I've found to generate
the fewest linker errors is a mixed managed/unmanaged project.
However, that still produces the following from the linker:

FFTW2 error LNK2020: unresolved token (0A0000C6) fftw_execute

Running ildasm on the resulting dll shows:

..method public static unmanagedexp void
modopt([mscorlib]System.Runtime.CompilerServices.CallConvCdecl)
fftw_execute(valuetype fftw_plan_s*
modopt([Microsoft.VisualC]Microsoft.VisualC.IsConstModifier) p) cil
managed

Other calls to FFTW with similar disassemblies link without complaint.
Commenting my call to fftw_execute causes the program to link. What
might be causing the link failure in this case?

Any ideas would be helpful. I've been working on this for a week and
am totally stumped. Thanks!

--
Brian

Nov 17 '05 #1
3 2220
Replying to myself with more info, I tried once again to compile FFTW
as an non-CLR .lib rather than a CLR .dll. This causes it to link but
fail at runtime with the following:

An unhandled exception of type 'System.TypeLoadException' occurred in
mymodule.dll

Additional information: Could not load type fftw_plan_s from assembly
MyModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null.

fftw_plan_s is an internal structure in FFTW. It is not exposed as
part of the public interface, except as a pointer typedef to fftw_plan
which I am using. Do I need to do something to expose this struct to
the unmanaged CLR C++ code?

--
Brian

Nov 17 '05 #2
Brian Victor wrote:
Replying to myself with more info, I tried once again to compile FFTW
as an non-CLR .lib rather than a CLR .dll. This causes it to link but
fail at runtime with the following:

An unhandled exception of type 'System.TypeLoadException' occurred in
mymodule.dll

Additional information: Could not load type fftw_plan_s from assembly
MyModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null.

fftw_plan_s is an internal structure in FFTW. It is not exposed as
part of the public interface, except as a pointer typedef to fftw_plan
which I am using. Do I need to do something to expose this struct to
the unmanaged CLR C++ code?


What version of the compiler are you using? If it is the 2003 / 7.1
version you need to add an empty definition for fftw_plan_s. If you are
using the 2005 / 8.0 version the linker will add that for you (and
generate a warning telling you it did).

The CLR needs to have a definition of a type available even to create a
pointer to it.

Ronald Laeremans
Visual C++ team

Nov 17 '05 #3
Ronald Laeremans [MSFT] wrote:
Brian Victor wrote:
Additional information: Could not load type fftw_plan_s from assembly
MyModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null.

fftw_plan_s is an internal structure in FFTW. It is not exposed as
part of the public interface, except as a pointer typedef to fftw_plan
which I am using. Do I need to do something to expose this struct to
the unmanaged CLR C++ code?

What version of the compiler are you using? If it is the 2003 / 7.1
version you need to add an empty definition for fftw_plan_s. If you are
using the 2005 / 8.0 version the linker will add that for you (and
generate a warning telling you it did).


Thanks for replying, Ronald. I am using 2003/7.1. I've become pretty
comfortable in my workaround at this point, but if I come across the
problem again I'll give that a shot.

--
Brian

Nov 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: David Kantowitz | last post by:
I am trying to wrap a native-C++ DLL in managed C++, to use in a .NET project. The native code is compiled into a DLL, and I have created a .def file that exports the mangled names of the...
0
by: Raja | last post by:
Hi, I use windows 2000 professional and have a code written in Microsoft Visual C++ .Net. Everytime i build the program I get an unresolved token error, something like LINK : error LNK2020:...
1
by: Tony Baker | last post by:
Hi, If I 1) create a brand new Visual C++ Project -> Class Library (.Net) 2) in the stdafx.h file add #include <atlbase.h> I get the following errors: ------ Build started: Project: testATL,...
1
by: Joel Rondeau | last post by:
I am building a mixed-mode DLL with VS.NET 2003 and have run across some link errors. (I have looked at the MS Help articles about LNK2020 errors with mixed-mode C++ and that has not helped)...
10
by: Ian Lazarus | last post by:
Hello. How do "unresolved token" link errors occur. How do I fix them? Linking... LINK : error LNK2020: unresolved token (0A000015) ??_7type_info@@6B@ LINK : error LNK2020: unresolved token...
2
by: DEFENDER | last post by:
Hi .I have problem. I have project width 2 libs When i link my project i have errors some like this : msvcrt.lib(MSVCR71.dll) : error LNK2005: _memmove already defined i LIBCMT.lib(memmove.obj)...
0
by: Roland | last post by:
Hi, ultimately I want to call some unmanaged C++ class that contains some DirectShow code of mine from my C# classes, but for the time being I'd be happy if I could get this to build! I have...
2
by: tllee | last post by:
I wrote a simple stack program using class template on VC++ 2003 but am unable to resolve the following link errors: LINK : error LNK2020: unresolved token (0A000046) Stack.__dtor LINK : error...
2
by: jazihak | last post by:
Can any one tell me how to resolve this issue; I have the following function //hello.cpp #include "stdafx.h" #include <stdlib.h> #include <vcclr.h> #include <string> namespace Wrapper
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.