compiler error C2872 ambiguous symbol.

Asked 2 years ago, Updated 2 years ago, 56 views

The compilation error cannot be resolved.
Please let me know.

■ Compilation error content
error C2872: 'MarketplaceWebServiceProducts': ambiguous symbol

■What you want to do
Amazon API Marketplace Web Service API (MWS) Hello world


Available from the "Download" button in the upper right-hand corner of the page below. Using "MWSProducts_2011-10-01_v2017-03-22.dll"
https://developer.amazonservices.jp/doc/products/products/v20111001/cSharp.html

■Using DLLs
From the properties of the target project in Visual Studio, click
Added above DLL reference

■ Coding

using namespace MarketplaceWebServiceProducts;//←Compile OK here
using namespace MarketplaceWebServiceProducts::Mock;// ←★ Compilation error above here

■Question
The top
MarketplaceWebServiceProducts
are normal. Why is the lower Mock an ambiguous symbol?
Please tell me the solution.(Please provide implementation if possible)

■Environment
Visual Studio .Net 4.0
C++/Cli

c++ visual-studio .net c++-cli

2022-09-30 13:47

1 Answers

The C++ language refers to the header file at compile time and combines it with the library at link time.However, the .NET assembly is a DLL file and the header file does not exist.
Therefore, Visual C++ provides the #using directive.

#using "MWSProducts_2011-10-01_v2017-03-22.dll"

The C++ compiler reads the .NET assembly, converts it into a corresponding header file, and treats it as if it were #include.Compilation options/FU also provide equivalent results.

From the properties of the target project in Visual Studio, click
Added above DLL reference

As mentioned above, unfortunately the reference method is incorrect.


2022-09-30 13:47

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.