vcpkg icon indicating copy to clipboard operation
vcpkg copied to clipboard

Unable to compile vcpkg in linux (archlinux) using provided instructions

Open akayami-legacy opened this issue 6 years ago • 10 comments

Describe the bug Unable to compile vcpkg in linux (archlinux) using provided instructions

Environment

  • OS: Linux shark 5.9.8-arch1-1 #1 SMP PREEMPT Tue, 10 Nov 2020 22:44:11 +0000 x86_64 GNU/Linux
  • Compiler: -- The CXX compiler identification is GNU 6.5.0
gcc --version
gcc (GCC) 10.2.0
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

To Reproduce Steps to reproduce the behavior:

  1. Checkout source code
  2. ./vcpkg/bootstrap-vcpkg.sh

Expected behavior functional vcpkg binary

Failure logs

$ ./vcpkg/bootstrap-vcpkg.sh 
-- The CXX compiler identification is GNU 6.5.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/g++-6 - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Detecting the C++ compiler in use
-- Detecting the C++ compiler in use - gcc
-- Detecting the C++ standard library
-- Detecting the C++ standard library - libstdc++
-- Detecting how to use the C++ filesystem library
-- Detecting how to use the C++ filesystem library - <experimental/filesystem> with -lstdc++fs
-- Looking for C++ include pthread.h
-- Looking for C++ include pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Check if compiler accepts -pthread
-- Check if compiler accepts -pthread - yes
-- Found Threads: TRUE  
-- Configuring done
-- Generating done
-- Build files have been written to: /home/tomasz/dev/vcpkg/toolsrc/build.rel
[0/2] Re-checking globbed directories...
[72/83] Building CXX object CMakeFiles/vcpkglib.dir/src/vcpkg/vcpkgcmdarguments.cpp.o
FAILED: CMakeFiles/vcpkglib.dir/src/vcpkg/vcpkgcmdarguments.cpp.o 
/usr/bin/g++-6 -DVCPKG_USE_STD_FILESYSTEM=0 -I../include -O3 -DNDEBUG -include /home/tomasz/dev/vcpkg/toolsrc/include/pch.h -pthread -std=c++1z -MD -MT CMakeFiles/vcpkglib.dir/src/vcpkg/vcpkgcmdarguments.cpp.o -MF CMakeFiles/vcpkglib.dir/src/vcpkg/vcpkgcmdarguments.cpp.o.d -o CMakeFiles/vcpkglib.dir/src/vcpkg/vcpkgcmdarguments.cpp.o -c ../src/vcpkg/vcpkgcmdarguments.cpp
../src/vcpkg/vcpkgcmdarguments.cpp:925:48: error: redefinition of 'constexpr const vcpkg::StringLiteral vcpkg::VcpkgCmdArguments::OVERLAY_TRIPLETS_ENV'
     constexpr StringLiteral VcpkgCmdArguments::OVERLAY_TRIPLETS_ENV;
                                                ^~~~~~~~~~~~~~~~~~~~
In file included from ../src/vcpkg/vcpkgcmdarguments.cpp:9:0:
../include/vcpkg/vcpkgcmdarguments.h:145:40: note: 'constexpr const vcpkg::StringLiteral vcpkg::VcpkgCmdArguments::OVERLAY_TRIPLETS_ENV' previously defined here
         constexpr static StringLiteral OVERLAY_TRIPLETS_ENV = "VCPKG_OVERLAY_TRIPLETS";
                                        ^~~~~~~~~~~~~~~~~~~~
[81/83] Building CXX object CMakeFiles/vcpkglib.dir/src/vcpkg/vcpkglib.cpp.o
ninja: build stopped: subcommand failed.

Additional context Add any other context about the problem here.

akayami-legacy avatar Nov 23 '20 15:11 akayami-legacy

Could you run g++ --version? It may be different from gcc --version.

linquize avatar Nov 23 '20 16:11 linquize

Could you run g++ --version? It may be different from gcc --version.

g++ --version
g++ (GCC) 10.2.0
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

akayami-legacy avatar Nov 23 '20 16:11 akayami-legacy

How do you install g++-6?

linquize avatar Nov 23 '20 16:11 linquize

I'm using the official archlinux package manager.

https://wiki.archlinux.org/index.php/GNU_Compiler_Collection

So the command is

pacman -S gcc

akayami-legacy avatar Nov 23 '20 17:11 akayami-legacy

I also encountered this problem on mac 10.14

davidxiaozhi avatar Nov 24 '20 08:11 davidxiaozhi

@NancyLi1013 fix it on #14744 , OVERLAY_TRIPLETS_ENV is defined twice in vcpkgcmdarguments.cpp:923 and vcpkgcmdarguments.cpp:925

davidxiaozhi avatar Nov 24 '20 08:11 davidxiaozhi

Hi @akayami and @davidxiaozhi

Thanks for posting this issue.

Could you please try to rebuild this after removing constexpr StringLiteral VcpkgCmdArguments::OVERLAY_TRIPLETS_ENV in vcpkgcmdarguments.cpp:925?

NancyLi1013 avatar Nov 24 '20 08:11 NancyLi1013

Problem fixed. Thanks for quick and efficient support !

akayami-legacy avatar Nov 24 '20 15:11 akayami-legacy

Thanks for your update @akayami. I'm reopening this issue until this issue is fixed via PR #14744 merged.

NancyLi1013 avatar Nov 25 '20 02:11 NancyLi1013

Closing since it has been fixed now.

NancyLi1013 avatar Nov 26 '20 01:11 NancyLi1013