4

I have compiled the boost binaries correctly and followed all of the instructions, but I am getting a lot of errors, and I don't know why!

Here is my 'include' setup: enter image description here

This is the code I used to test boost:

#include <boost/asio.hpp> // include boost
#include <iostream>
using namespace std;
using namespace boost::asio;  // save tons of typing

// These are the values our port needs to connect
#ifdef _WIN32
// windows uses com ports, this depends on what com port your cable is plugged in to.
const char *PORT = "COM4";
#else
// *nix com ports
const char *PORT = "dev/ttyS3";
#endif
// Note: all the following except BAUD are the exact same as the default values

// what baud rate do we communicate at
serial_port_base::baud_rate BAUD(9600);
// how big is each "packet" of data (default is 8 bits)
serial_port_base::character_size CSIZE(8);
// what flow control is used (default is none)
serial_port_base::flow_control FLOW(serial_port_base::flow_control::none);
// what parity is used (default is none)
serial_port_base::parity PARITY(serial_port_base::parity::none);
// how many stop bits are used (default is one)
serial_port_base::stop_bits STOP(serial_port_base::stop_bits::one);

int main()
{
    // create the I/O service that talks to the serial device
    io_service io;
    // create the serial device, note it takes the io service and the port name
    serial_port port(io, PORT);

    // go through and set all the options as we need them
    // all of them are listed, but the default values work for most cases
    port.set_option(BAUD);
    port.set_option(CSIZE);
    port.set_option(FLOW);
    port.set_option(PARITY);
    port.set_option(STOP);

    // buffer to store commands
    // this device reads 8 bits, meaning an unsigned char, as instructions
    // varies with the device, check the manual first
    unsigned char command[1] = { 0 };

    // read in user value to be sent to device
    int input;
    cin >> input;

    // Simple loop, since the only good values are [0,255]
    //  break when a negative number is entered.
    // The cast will convert too big numbers into range.
    while (input >= 0)
    {
        // convert our read in number into the target data type
        command[0] = static_cast<unsigned char>(input);

        // this is the command that sends the actual bits over the wire
        // note it takes a stream and a asio::buffer
        // the stream is our serial_port
        // the buffer is constructed using our command buffer and
        //  the number of instructions to send
        write(port, buffer(command, 1));

        // read in the next input value
        cin >> input;
    }

    // all done sending commands
    return 0;
}

My errors (I can't give any info because I don't know what the mean or what causes them):

1   IntelliSense: identifier "WSA13" is undefined   c:\libs\boost\boost_1_55_0\boost\asio\error.hpp 70  19  Test3
2   IntelliSense: identifier "WSA102" is undefined  c:\libs\boost\boost_1_55_0\boost\asio\error.hpp 73  34  Test3
3   IntelliSense: identifier "WSA100" is undefined  c:\libs\boost\boost_1_55_0\boost\asio\error.hpp 76  20  Test3
4   IntelliSense: identifier "WSA113" is undefined  c:\libs\boost\boost_1_55_0\boost\asio\error.hpp 79  23  Test3
5   IntelliSense: identifier "WSA103" is undefined  c:\libs\boost\boost_1_55_0\boost\asio\error.hpp 82  21  Test3
6   IntelliSense: identifier "WSA106" is undefined  c:\libs\boost\boost_1_55_0\boost\asio\error.hpp 90  24  Test3
7   IntelliSense: identifier "WSA107" is undefined  c:\libs\boost\boost_1_55_0\boost\asio\error.hpp 93  24  Test3
8   IntelliSense: identifier "WSA108" is undefined  c:\libs\boost\boost_1_55_0\boost\asio\error.hpp 96  22  Test3
9   IntelliSense: identifier "WSA9" is undefined    c:\libs\boost\boost_1_55_0\boost\asio\error.hpp 99  20  Test3
10  IntelliSense: identifier "WSA14" is undefined   c:\libs\boost\boost_1_55_0\boost\asio\error.hpp 102 11  Test3
11  IntelliSense: identifier "WSA110" is undefined  c:\libs\boost\boost_1_55_0\boost\asio\error.hpp 105 22  Test3
12  IntelliSense: identifier "WSA112" is undefined  c:\libs\boost\boost_1_55_0\boost\asio\error.hpp 108 17  Test3
13  IntelliSense: identifier "WSA4" is undefined    c:\libs\boost\boost_1_55_0\boost\asio\error.hpp 111 17  Test3
14  IntelliSense: identifier "WSA22" is undefined   c:\libs\boost\boost_1_55_0\boost\asio\error.hpp 114 22  Test3
15  IntelliSense: identifier "WSA115" is undefined  c:\libs\boost\boost_1_55_0\boost\asio\error.hpp 117 18  Test3
16  IntelliSense: identifier "WSA38" is undefined   c:\libs\boost\boost_1_55_0\boost\asio\error.hpp 120 19  Test3
17  IntelliSense: identifier "WSA116" is undefined  c:\libs\boost\boost_1_55_0\boost\asio\error.hpp 123 18  Test3
18  IntelliSense: identifier "WSA117" is undefined  c:\libs\boost\boost_1_55_0\boost\asio\error.hpp 126 19  Test3
19  IntelliSense: identifier "WSA118" is undefined  c:\libs\boost\boost_1_55_0\boost\asio\error.hpp 129 25  Test3
20  IntelliSense: identifier "WSA24" is undefined   c:\libs\boost\boost_1_55_0\boost\asio\error.hpp 132 20  Test3
21  IntelliSense: identifier "WSA119" is undefined  c:\libs\boost\boost_1_55_0\boost\asio\error.hpp 135 21  Test3
22  IntelliSense: identifier "WSA123" is undefined  c:\libs\boost\boost_1_55_0\boost\asio\error.hpp 148 24  Test3
23  IntelliSense: identifier "WSA126" is undefined  c:\libs\boost\boost_1_55_0\boost\asio\error.hpp 151 19  Test3
24  IntelliSense: identifier "WSA128" is undefined  c:\libs\boost\boost_1_55_0\boost\asio\error.hpp 154 16  Test3
25  IntelliSense: identifier "WSA130" is undefined  c:\libs\boost\boost_1_55_0\boost\asio\error.hpp 162 29  Test3
26  IntelliSense: identifier "WSA138" is undefined  c:\libs\boost\boost_1_55_0\boost\asio\error.hpp 168 15  Test3
27  IntelliSense: identifier "WSA140" is undefined  c:\libs\boost\boost_1_55_0\boost\asio\error.hpp 176 17  Test3
28  IntelliSense: identifier "WSA11001L" is undefined   c:\libs\boost\boost_1_55_0\boost\asio\error.hpp 182 20  Test3
29  IntelliSense: identifier "WSA11002L" is undefined   c:\libs\boost\boost_1_55_0\boost\asio\error.hpp 185 30  Test3
30  IntelliSense: identifier "WSA11004L" is undefined   c:\libs\boost\boost_1_55_0\boost\asio\error.hpp 188 13  Test3
31  IntelliSense: identifier "WSA11003L" is undefined   c:\libs\boost\boost_1_55_0\boost\asio\error.hpp 191 17  Test3
32  IntelliSense: identifier "BOOST_ASIO_OS_DEF_0x00000002" is undefined    c:\libs\boost\boost_1_55_0\boost\asio\ip\resolver_query_base.hpp    66  22  Test3
33  IntelliSense: identifier "BOOST_ASIO_OS_DEF_0x00000001" is undefined    c:\libs\boost\boost_1_55_0\boost\asio\ip\resolver_query_base.hpp    67  15  Test3
34  IntelliSense: identifier "BOOST_ASIO_OS_DEF_0x00000004" is undefined    c:\libs\boost\boost_1_55_0\boost\asio\ip\resolver_query_base.hpp    68  20  Test3
35  IntelliSense: identifier "BOOST_ASIO_OS_DEF_0x00000008" is undefined    c:\libs\boost\boost_1_55_0\boost\asio\ip\resolver_query_base.hpp    69  23  Test3
36  IntelliSense: identifier "BOOST_ASIO_OS_DEF_0x00000800" is undefined    c:\libs\boost\boost_1_55_0\boost\asio\ip\resolver_query_base.hpp    70  17  Test3
37  IntelliSense: identifier "BOOST_ASIO_OS_DEF_0x00000100" is undefined    c:\libs\boost\boost_1_55_0\boost\asio\ip\resolver_query_base.hpp    71  20  Test3
38  IntelliSense: identifier "BOOST_ASIO_OS_DEF_0x00000400" is undefined    c:\libs\boost\boost_1_55_0\boost\asio\ip\resolver_query_base.hpp    72  26  Test3
39  IntelliSense: identifier "BOOST_ASIO_OS_DEF_0" is undefined c:\libs\boost\boost_1_55_0\boost\asio\ip\multicast.hpp  51  3   Test3
40  IntelliSense: identifier "BOOST_ASIO_OS_DEF_12" is undefined    c:\libs\boost\boost_1_55_0\boost\asio\ip\multicast.hpp  52  3   Test3
41  IntelliSense: identifier "BOOST_ASIO_OS_DEF_13" is undefined    c:\libs\boost\boost_1_55_0\boost\asio\ip\multicast.hpp  80  3   Test3
42  IntelliSense: identifier "BOOST_ASIO_OS_DEF_9" is undefined c:\libs\boost\boost_1_55_0\boost\asio\ip\multicast.hpp  108 3   Test3
43  IntelliSense: identifier "BOOST_ASIO_OS_DEF_10" is undefined    c:\libs\boost\boost_1_55_0\boost\asio\ip\multicast.hpp  144 3   Test3
44  IntelliSense: identifier "BOOST_ASIO_OS_DEF_11" is undefined    c:\libs\boost\boost_1_55_0\boost\asio\ip\multicast.hpp  181 3   Test3
45  IntelliSense: identifier "BOOST_ASIO_OS_DEF_0x0001" is undefined    c:\libs\boost\boost_1_55_0\boost\asio\ip\tcp.hpp    126 37  Test3
46  IntelliSense: identifier "BOOST_ASIO_OS_DEF_0" is undefined c:\libs\boost\boost_1_55_0\boost\asio\ip\unicast.hpp    59  3   Test3
47  IntelliSense: identifier "BOOST_ASIO_OS_DEF_4" is undefined c:\libs\boost\boost_1_55_0\boost\asio\ip\unicast.hpp    60  3   Test3
Praetorian
  • 106,671
  • 19
  • 240
  • 328
user2705775
  • 461
  • 1
  • 7
  • 14
  • Text is much preferred over pictures. Text works for include paths, code and errors. – chris Dec 12 '13 at 03:47
  • 1
    Do you get a compiler/linker error? The errors above look like it's just Intellisense complaining about stuff, which will create red squiggles in the editor, but otherwise shouldn't stop you from compiling successfully. – Praetorian Dec 12 '13 at 03:52
  • I get "Build failed". – user2705775 Dec 12 '13 at 04:13
  • Please add the compiler or linker errors. There is nothing in this question that shows how boost 1.55 doesn't work with Visual Studio 2013. – free_coffee Dec 12 '13 at 21:53
  • I posted the errors in the question. (identifier "WSA13" is undefined, etc) – user2705775 Dec 12 '13 at 22:20
  • As Praetorian said, those are just Intellisense messages and have nothing to do with whether your build succeeded or failed. You need to find the errors from the compiler or linker. – free_coffee Dec 12 '13 at 22:33

2 Answers2

6

From the Boost 1.55 release notes:

Known Bugs with Visual Studio 2013/Visual C++ 12

Visual Studio 2013 was released quite late in the release process, so there exist several unresolved issues. These include:

- Serialization can't compile because of a missing include.

- Using has_member_function_callable_with from Boost.Container's allocator_traits causes a compile error (#9332).

- In libraries such as Unordered and MultiIndex, calling overloaded functions with initializer lists can result in a compile error, with Visual C++ claiming that the overloads are ambiguous. This is a Visual C++ bug and it isn't clear if there's a good workaround. This won't affect code that doesn't use initializer lists, or uses an initializer list that doesn't require an implicit conversion (i.e. an initializer list of the container's exact value type).

- Thread: ex_scoped_thread compile fails (#9333).

Note that VC++ 12 isn't fully supported, and even if Boost does compile doesn't necessarily mean that it won't have runtime bugs (which means, sadly, you'll have to make work-arounds for them). If you ever find more bugs in Boost, be sure to report it to them.

Community
  • 1
  • 1
Mark Garcia
  • 17,424
  • 4
  • 58
  • 94
  • When should I expect a new release to fix these issues? Or do you think I should just use VS2012? – user2705775 Dec 12 '13 at 04:15
  • @user2705775 Either you use VS2012, make work-arounds (and submit bug reports/patches), or wait until [Boost 1.56 is released](https://www.google.com/calendar/render?eid=ZGQ5MXE1ajhsZ2wzbTEzczdqYzVidG8zbm8gNXJvcmZtNDJudm1wdDc3YWMwdnVsdDlpaWdAZw&ctz=America/Chicago&pli=1&t=AKUaPmbb7ZsmfBBczHVKEK6PofzWC_PgbWOEa9PB8KXkz6pT9OoOBaPPGBEsWnkWQvj2OQqlQrUL&sf=true&output=xml) (or at least, its beta release) (here is the [Boost release schedule](http://www.boost.org/development/index.html)). – Mark Garcia Dec 12 '13 at 04:21
  • @user2705775 Personally, what I've made is continue using VS2013 and stayed away from those libraries which have issues (I still need to check runtime bugs for those who doesn't). – Mark Garcia Dec 12 '13 at 04:22
  • I guess I'll have to use VS2012, then. I have never modified a library before and I have to get this done pretty quickly. – user2705775 Dec 12 '13 at 04:25
  • Could you point me to a working tutorial for setting boost up for VS2012? I tried but it wouldn't let be change the toolset and the default seems to be vc12. – user2705775 Dec 12 '13 at 04:26
  • @user2705775 It's all in the [documentation](http://www.boost.org/doc/libs/1_55_0/more/getting_started/windows.html) :-). – Mark Garcia Dec 12 '13 at 04:27
  • Still the same problem with Boost_1_56_0. I bypass the problem with the Simon Brangwin's suggestion. – Old newbie Aug 13 '14 at 18:05
4

Just ran into this myself when upgrading to VC++ 2013. FYI, they aren't build errors, they are IntelliSense errors. It seems that IntelliSense isn't as smart as the compiler is in resolving some macros. I'm not too worried about it given how great the new VC++ 2013 IntelliSense is compared to 2010.

In any case you can suppress them by right clicking on the list and unticking "Show IntelliSense Errors"

enter image description here

Simon Brangwin
  • 858
  • 1
  • 7
  • 15