Welcome Guest! To enable all features please Login or Register.



Link issue when solution contains C++ projects
#1 Posted : Friday, November 8, 2019 2:01:55 PM(UTC)
Rank: Member

Groups: Registered
Joined: 12/15/2016(UTC)
Posts: 17
Location: United Kingdom

Thanks: 8 times
Was thanked: 5 time(s) in 5 post(s)
I have a multi-project solution which includes a C++ DLL that is called by some C# unit tests.

I notice that Ncrunch tends to get confused if I edit the C++ source. This is quite easy to reproduce when editing header files that contain structure definitions. For example, adding a field to this C++ structure...


typedef struct
uint32_t number_of_initialisable_profiles; //add this field while Ncrunch is running
uint32_t active_profile;
uint32_t last_successful_profile;
uint32_t roam_threshold;
} cell_profile_selection_info_t;

causes this error....

NCrunch: This project was built on server '(local)'
CellProfileWrapper.obj (0, 0): metadata operation failed (8013118D) : Inconsistent layout information in duplicated types (cell_profile_selection_info_t): (0x02000157).
LINK (0, 0): link failed because of metadata errors

(In case it's relevant, CellProfileWrapper.cpp contains a managed 'ref' class which is used to provide a shim to the C# unit tests and the structure is being consumed by both managed C++ and 'normal' C++.)

I accept this is a bit of a corner case for Ncrunch but it would nice if there was an easier way to work around it. At the moment it seems that:

* "reload and rebuild the project" doesn't fix it
* Disabling then re-enabling Ncrunch usually fixes it
* It's sometimes necessary to shut down and restart VS completely.

#2 Posted : Friday, November 8, 2019 10:48:27 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 5,830

Thanks: 754 times
Was thanked: 973 time(s) in 927 post(s)
Hi, thanks for sharing this issue.

C++ isn't a supported language for NCrunch. We've done no real testing on usage of NCrunch with C++ based assemblies and cannot warrant that the product will work correctly with it. Any success with you have with it is entirely incidental.

Does compatibility mode make any difference here?
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAF | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.030 seconds.