{"id":112512,"date":"2026-07-09T07:00:00","date_gmt":"2026-07-09T14:00:00","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/oldnewthing\/?p=112512"},"modified":"2026-07-04T07:14:00","modified_gmt":"2026-07-04T14:14:00","slug":"20260709-00","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/oldnewthing\/20260709-00\/?p=112512","title":{"rendered":"I&#8217;ve decoded a <CODE>#pragma detect_mismatch<\/CODE> error and fixed the mismatch, but I still get the error"},"content":{"rendered":"<p>Some time ago, I showed <a title=\"How do I decode a #pragma detect_mismatch error?\" href=\"https:\/\/devblogs.microsoft.com\/oldnewthing\/20220427-00\/?p=106537\"> how to decode a <code>#pragma detect_mismatch<\/code> error<\/a>. A colleague ran into this error because they sync&#8217;d a change that modified the configuration of a common header file. &#8220;No problem, I&#8217;ll just rebuild after sync&#8217;ing.&#8221; But when they rebuilt their project, the error persisted. What went wrong?<\/p>\n<p>The error message tells you the two pieces that are conflicting. In my colleague&#8217;s case, one of the pieces was an object file inside a library, and the other piece was an object file in their project. The catch was that the library was not part of their project. Therefore, rebuilding their project doesn&#8217;t rebuild the library.<\/p>\n<p>After you fix a <code>#pragma detect_mismatch<\/code> mismatch, you need to recompile all of the object files that were dependent upon the header file that contained the mismatch. This rule isn&#8217;t special to <code>#pragma detect_mismatch<\/code>; it applies to any ODR error. If a structure changed definitions in a common header file, you need to recompile all of the object files that were dependent on the header file so they all agree on the new structure definition.<\/p>\n<p>The fix was to rebuild the library that had been compiled against the old version of the header file. Safer would be to do a clean rebuild of the entire repo, to make sure no stale contents from the old header file still linger.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>You need to rebuild everything that was dependent on the change.<\/p>\n","protected":false},"author":1069,"featured_media":111744,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[25],"class_list":["post-112512","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-oldnewthing","tag-code"],"acf":[],"blog_post_summary":"<p>You need to rebuild everything that was dependent on the change.<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/112512","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/users\/1069"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/comments?post=112512"}],"version-history":[{"count":1,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/112512\/revisions"}],"predecessor-version":[{"id":112513,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/112512\/revisions\/112513"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/media\/111744"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/media?parent=112512"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/categories?post=112512"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/tags?post=112512"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}