Vcpkg: Warnings in bootstrap on Ubuntu 18.04

Created on 8 Apr 2020  路  7Comments  路  Source: microsoft/vcpkg

Describe the bug
When I run 'bootstrap-vcpkg.sh' I get several warnings like this:

In file included from ../src/vcpkg/export.prefab.cpp:11:0:
../include/vcpkg/export.prefab.h:31:13: warning: In the GNU C Library, "minor" is defined
 by <sys/sysmacros.h>. For historical compatibility, it is
 currently defined by <sys/types.h> as well, but we plan to
 remove this soon. To use "minor", include <sys/sysmacros.h>
 directly. If you did not intend to use a system-defined macro
 "minor", you should undefine it after including <sys/types.h>.
         int minor()  { return this->m_minor; }

Environment

  • OS: Ubuntu 18.04 (docker image based on mcr.microsoft.com/dotnet/core/sdk:3.1.201-bionic)
  • Compiler: g++ (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0

To Reproduce
Steps to reproduce the behavior:

  1. Clone repo (commit a3a6e703448b58b0d86ff4b6b5f658b8d26cd76d)
  2. ./bootstrap-vcpkg.sh
  3. See warnings

Expected behavior
Bootstrap without warnings

Failure logs
A full session log
bootstrap.log

Additional context
If you need any more info, let me know. These are just warnings, so this is low priority. Just thought you should know and a quick search through your issues didn't reveal any existing ticket.

vcpkg-bug

Most helpful comment

@teqdruid @timautry @NancyLi1013 I current do not have an ubuntu vm to test on. What happens when you apply the following patch

diff --git a/toolsrc/include/vcpkg/export.prefab.h b/toolsrc/include/vcpkg/export.prefab.h
index 56a5ba371..84df036b5 100644
--- a/toolsrc/include/vcpkg/export.prefab.h
+++ b/toolsrc/include/vcpkg/export.prefab.h
@@ -7,6 +7,15 @@

 #include <vector>

+
+#ifdef minor
+#undef minor
+#endif
+
+#ifdef major
+#undef major
+#endif
+
 namespace vcpkg::Export::Prefab
 {
     constexpr int kFragmentSize = 3;

All 7 comments

I get something similar on OpenSuseLeap 15.1 latest updates - see attached OpenSuseLeap.txt

  • vcpkg compiles (latest git pull update)
  • but it complains about the headers being used by:

    • ../include/vcpkg/export.prefab.h

    • ../src/vcpkg/export.cpp

      It seems "major" and "minor" in library "" is being deprecated and to use "" in the future

      OpenSuseLeap.txt

Hi @teqdruid and @timautry
Thanks for posting this issue.
It should be introduced by this #10271.
@atkawa7
Could you please help look into this?

Thanks @NancyLi1013 @teqdruid @timautry . Let me look at this

@teqdruid @timautry @NancyLi1013 I current do not have an ubuntu vm to test on. What happens when you apply the following patch

diff --git a/toolsrc/include/vcpkg/export.prefab.h b/toolsrc/include/vcpkg/export.prefab.h
index 56a5ba371..84df036b5 100644
--- a/toolsrc/include/vcpkg/export.prefab.h
+++ b/toolsrc/include/vcpkg/export.prefab.h
@@ -7,6 +7,15 @@

 #include <vector>

+
+#ifdef minor
+#undef minor
+#endif
+
+#ifdef major
+#undef major
+#endif
+
 namespace vcpkg::Export::Prefab
 {
     constexpr int kFragmentSize = 3;

@atkawa7
Thanks for your so quick response and fix.
There are no these warning messages on my machine after adding the patch you provided above.

Thanks again for your help.

Hi @teqdruid
This has been fixed on latest version.
Could you please try to update vcpkg and rebuild this?

This should be fixed now. Pleas update vcpkg to the latest version and try to build it agian.
Please reopen this if it is still a problem for you.

Was this page helpful?
0 / 5 - 0 ratings