Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing <arch-and-model> if using msvc #730

Open
UMU618 opened this issue Jul 10, 2021 · 3 comments
Open

Missing <arch-and-model> if using msvc #730

UMU618 opened this issue Jul 10, 2021 · 3 comments

Comments

@UMU618
Copy link
Contributor

UMU618 commented Jul 10, 2021

I use b2 to compile a simple example, and got an error with msvc/Windows:

$ b2
...patience...
...found 817 targets...
...updating 1 target...
msvc.link bin\msvc-14.2\release\cxxstd-latest-iso\threading-multi\test_boost.exe
LINK : fatal error LNK1181: cannot open input file 'boost_program_options-vc142-mt-1_76.lib'

        call "bin\standalone\msvc\msvc-14.2\msvc-setup.bat"  >nul
 link /NOLOGO /INCREMENTAL:NO "bin\msvc-14.2\release\cxxstd-latest-iso\threading-multi\main.obj"    "boost_program_options-vc142-mt-1_76.lib"  /MACHINE:X64 /MANIFEST:EMBED /subsystem:console /out:"bin\msvc-14.2\release\cxxstd-latest-iso\threading-multi\test_boost.exe" /LIBPATH:"C:\dev\lib"

...failed msvc.link bin\msvc-14.2\release\cxxstd-latest-iso\threading-multi\test_boost.exe...
...failed updating 1 target...

The file boost_program_options-vc142-mt-1_76.lib should be boost_program_options-vc142-mt-x64-1_76.lib.

return [ common.format-name <base> <toolset> <threading> <runtime>

After looking up boost.jam, I think on Windows this should be:

rule tag_versioned ( name : type ? : property-set )
{
    return [ common.format-name <base> <toolset> <threading> <runtime> <arch-and-model>
        -$(.version_tag) -$(.build_id) : $(name) : $(type) : $(property-set) ] ;
}

After adding , b2 architecture=x86 address-model=64 succeeded.

@UMU618
Copy link
Contributor Author

UMU618 commented Jul 10, 2021

Jamfile.v2

import boost ;

# no problem if using <root> to locate $(BOOST_ROOT)
#using boost : 1.76 : <root>C:/dev/boost_1_76_0 ;

# failed if use the installed one
using boost : 1.76 : <include>C:/dev/include/boost-1_76 <library>C:/dev/lib ;

boost.use-project ;

project test_boost
  : requirements
    <cxxstd>latest
      <toolset>clang:<cxxstd>17
    <optimization>speed
    <threading>multi
  : default-build release
  : build-dir ./bin
  ;

exe test_boost
  : main.cpp
  : <library>/boost//program_options
  ;

@Kojoley
Copy link
Contributor

Kojoley commented Jul 11, 2021

boostorg/boost@06c1e1e was not mirrored to src/contrib/boost.jam

@UMU618
Copy link
Contributor Author

UMU618 commented Jul 12, 2021

boostorg/boost@06c1e1e was not mirrored to src/contrib/boost.jam

Thank you! I will use stage instead of install on Windows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants