Error compiling tests on Windows

20 views
Skip to first unread message

Matthew Woehlke

unread,
Oct 13, 2016, 4:28:40 PM10/13/16
to lcm...@googlegroups.com
When building LCM (with tests enabled) on Windows, I see this:

c:\...\lcm\test\types\lcmtest_exampleconst_t.h(35):
error C2016: C requires that a struct or union has at least one member

Presumably the fix is to add a dummy member to the LCM type. However, I
wonder why I seem to be the first one to run into this? Am I doing
something wrong? (Did I break something porting to CMake?) Or have the
unit tests just never been tested on Windows?

--
Matthew

Tim Perkins

unread,
Oct 14, 2016, 3:03:00 PM10/14/16
to lcm...@googlegroups.com
Could be wrong, but I thought that the LCM core needed to be compiled as C++ on Windows (even though it's C).

--
You received this message because you are subscribed to the Google Groups "lcm-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lcm-dev+u...@googlegroups.com.
To post to this group, send email to lcm...@googlegroups.com.
Visit this group at https://groups.google.com/group/lcm-dev.
For more options, visit https://groups.google.com/d/optout.

Matthew Woehlke

unread,
Oct 14, 2016, 3:26:02 PM10/14/16
to lcm...@googlegroups.com
On 2016-10-14 15:02, Tim Perkins wrote:
> Could be wrong, but I thought that the LCM core needed to be compiled as
> C++ on Windows (even though it's C).

IIRC that used to be the case, but I fixed the problems in the library
code. Note that this isn't about the main library, however, but LCM type
bindings. I think there are three options:

- We don't support LCM types with no NSDM's (at least on Windows). This
implies that test needs to have a NSDM added.

- We support such types, but users must override the compile language
themselves, either per object, or per binding library.

- We force C binding libraries to always be built as C++ on Windows.

I have no problem with the first option. The second is ugly. The third
would make me nervous, as I'm not sure what all is the impact of doing
so. (Same for the second option, actually.)

--
Matthew

Albert Huang

unread,
Oct 30, 2016, 2:24:09 AM10/30/16
to lcm...@googlegroups.com
First option is tricky, as that particular pattern (an LCM type consisting of only const definitions) can be useful. Third option (force C binding libraries to be built as C++ on windows) sounds reasonable to me. Since liblcm has always been built in C++ in Windows, AFAIK we don't have any C-only Windows users.

Albert


--
Matthew

--
You received this message because you are subscribed to the Google Groups "lcm-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lcm-dev+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages