Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#12387 closed Bugs (wontfix)

automatic lib link

Reported by: boaz.barnea@… Owned by: Andrey Semashev
Milestone: To Be Determined Component: log
Version: Boost 1.61.0 Severity: Problem
Keywords: log, lib, linckage, X Cc:

Description

Hi, When I include a header of a class which uses boost::log library after the line "#define X 0" the compilation of this module freezes! (never ending)

I use Visual Studio 2015 c++ (ansi-c++ and boost).

the lines I included were: #include <boost/log/trivial.hpp> #include <boost/log/sources/severity_logger.hpp> #include <boost/log/sources/record_ostream.hpp>

Thanks, Boaz.

Change History (7)

comment:1 by Andrey Semashev, 6 years ago

I can't reproduce this with the latest develop branch. My MSVC version is 19.00.24210 and the test code compiles and links fine:

#include <boost/log/trivial.hpp>
#include <boost/log/sources/severity_logger.hpp>
#include <boost/log/sources/record_ostream.hpp>

#define X 0

int main()
{
    return 0;
}

The command line is:

cl -I. /EHsc /MD -D_DEBUG test_vc14_hang.cpp /link /LIBPATH:stage/lib

If you can reproduce this with the develop branch from git then please provide the source code and compiler command line to reproduce. Also please provide the full compiler version.

Lastly, I suggest you report this to Microsoft as hanging compiler is certainly a compiler bug.

comment:2 by anonymous, 6 years ago

Pls. put the define before the includes...

comment:3 by Andrey Semashev, 6 years ago

That makes compilation to fail because X is used as a template parameter in boost::shared_ptr implementation. No compiler hang.

comment:4 by anonymous, 6 years ago

You are right... defining X just gave a rightful error, the hang happened when I have put before the includes: #define X 0 #define Y 1

this happened even in the compilation before the link

comment:5 by anonymous, 6 years ago

I work with Visual Studio 2015 with the default toolset v140

comment:6 by Andrey Semashev, 6 years ago

Resolution: wontfix
Status: newclosed

With two defines the compiler outputs errors and then hangs.

I'm sorry, but I don't think I will be able to work around it in the library, especially given that the test code is not supposed to compile in the first place. I suggest you report this to Microsoft so that they fix the compiler hang.

comment:7 by boaz.barnea@…, 6 years ago

Thanks for looking into it. BTW I checked on my mac as well and the compiler doesn't hang, so I agree it's probably MS issue.

Note: See TracTickets for help on using tickets.