schwehr / libais

C++ decoder for Automatic Identification System for tracking ships and decoding maritime information
Other
218 stars 97 forks source link

cstddef, -fPIC, #120

Open schwehr opened 8 years ago

schwehr commented 8 years ago

I got this 2nd-hand report of trouble:

I got a bug report regarding the version of libais I have been using (I will synch it to 
your current version in not too long). A fellow was having trouble compiling under 
Linux. He noted that adding #include <cstddef> to ais.h fixed the problem.

Also, he had issues with the makefile. he needed to modify Makefile-custion to replace
CXXFLAGS :=
with
CXXFLAGS := -fPIC

You’ll probably want to make the same changes. It seems that flag only matters 
on certain types of computers.

Adding the suggested include to ais.h gets rid of the error (ais6.cpp:16:9: 
error: ‘ptrdiff_t’ does not name a type) on some systems. This is what I was told.

I'm seeing those are in gmock and gtest:

./third_party/gmock/test/gmock-matchers_test.cc:                                         ptrdiff_t,
./third_party/gtest/include/gtest/internal/gtest-param-util.h:  typedef ptrdiff_t difference_type;
./third_party/gtest/include/gtest/internal/gtest-port.h:#include <stddef.h>  // for ptrdiff_t