strrange LNK2022 problem with C++/CLR project, but only for 64bit

  • Thread starter Thread starter h_schmieder
  • Start date Start date
H

h_schmieder

Guest
Hello,

I have a strange linker problemn with my /clr, but onyl in 64bit build.

The C++/Clr project consists of one cpp file which is a wrapper for a
native project with C++ interface.

Both are compiled with VS 2017 15.9.16

With this

public ref class AxisSubsetDef {
public:
String^ SubsetHandle;
array<array<String^>^>^ Excepts;
String^ Parent;
String^ Calculation;
unsigned int ZeroSup;
bool Hidden;
};

public enum class AxisType {
Page = 0,
Row = 1,
Column = 2
};


public ref class Connection {
// ....
}


void ViewDefineAxisCore(Server* server, String^ database, AxisType axisId, array<AxisSubsetDef^>^ axisdefs, size_t start, size_t limit, array<String^>^ properties, std::string* handle) {
// do the actual work
}

String^ Connection::ViewDefineAxisProxy(msclr::gcroot<String^> database, msclr::gcroot<AxisType> axisId, msclr::gcroot<array<AxisSubsetDef^>^> axisdefs, size_t start, size_t limit, msclr::gcroot<array<String^>^> properties) {
pin_ptr<struct sock_obj> pso = so;
auto ft1 = std::bind(&ViewDefineAxisCore, pso->myServer, database, axisId, axisdefs, start, limit, properties, std::placeholders::_1);
return nullptr;
}

// ---

void ViewDefineAreaCore(Server* server, String^ database, String^ cube, array<String^>^ axes, array<String^>^ properties, bool ignorehidden, std::string* handle) {
// do the actual work
}

String^ Connection::ViewDefineAreaProxy(msclr::gcroot<String^> database, msclr::gcroot<String^> cube, msclr::gcroot<array<String^>^> axes, msclr::gcroot<array<String^>^> properties, bool ignorehidden) {
pin_ptr<struct sock_obj> pso = so;
auto ft2 = std::bind(&ViewDefineAreaCore, pso->myServer, database, cube, axes, properties, ignorehidden, std::placeholders::_1);
return nullptr;
}


I get in 64bit and only 64bit the following linker erros

error LNK2022:
metadata operation failed (8013118D) :
Inconsistent layout information in duplicated types
(std._Binder<std::_Unforced,void ,std::D::ar_traits,std::allocator<char> >):
(0x02000414).

error LNK2022:
metadata operation failed (8013118D) :
Inconsistent layout information in duplicated types
(std._Compressed_pair<void ,std::D::ar_traits,palo::allocator<char> >):
(0x02000415).

error LNK2022:
metadata operation failed (8013118D) :
Inconsistent layout information in duplicated types
(std._Func_impl_no_alloc<>):
(0x020005b6).

I use in my code several std:bind, but for the test I have remarked out all others,
except this two above.

Ehat I see, that this two proxy methods are the only proxy methods which have two
msclr::gcroot<array<...>^> arguments.

What can I do the get rid of this obscure link errors ?

tia

Hendrik Schmieder

Continue reading...
 
Back
Top