eisbaer / v2x-lte

24 stars 8 forks source link

Building error #1

Open nadad18 opened 5 years ago

nadad18 commented 5 years ago

When I run the following command: ./build.py --enable-examples --enable-test

The vtx-lte model returns the following errors:

../src/v2x-lte/model/v2x-client.cc:326:3: error: identifier ‘nullptr’ is a keyword in C++11 [-Werror=c++0x-compat] NS_ASSERT(out_void != nullptr); ^ In file included from ./ns3/ptr.h:26:0, from ./ns3/object.h:27, from ./ns3/node.h:26, from ../src/v2x-lte/model/v2x-client.cc:4: ../src/v2x-lte/model/v2x-client.cc: In function ‘int ns3::write_buffer(const void, std::size_t, void)’: ../src/v2x-lte/model/v2x-client.cc:326:25: error: ‘nullptr’ was not declared in this scope NS_ASSERT(out_void != nullptr); ^ ./ns3/assert.h:70:13: note: in definition of macro ‘NS_ASSERT’ if (!(condition)) \ ^ ../src/v2x-lte/model/v2x-client.cc:328:3: error: ‘copy_n’ is not a member of ‘std’ std::copy_n(static_cast<const uint8_t>(in), size, std::back_inserter(out)); ^ ../src/v2x-lte/model/v2x-client.cc: In member function ‘void ns3::V2xClient::Receive(ns3::Ptr)’: ../src/v2x-lte/model/v2x-client.cc:583:58: error: ‘nullptr’ was not declared in this scope if (message->cam.camParameters.lowFrequencyContainer != nullptr) ^ ../src/v2x-lte/model/v2x-client.cc:588:60: error: ‘nullptr’ was not declared in this scope if (message->cam.camParameters.specialVehicleContainer != nullptr) ^ cc1plus: all warnings being treated as errors

great1319 commented 4 years ago

Hello Have you fixed the problem? I meet the same problem, too.

Thanks!

maliksaad84 commented 3 years ago

Same issue...anyone who have resolved ?

maliksaad84 commented 3 years ago

The problem is resolved. using sudo CXXFLAGS="-std=c++11" ./waf configure ./waf

ghost commented 2 years ago

After ./waf I got this error: /usr/bin/ld: src/v2x-lte/model/gen/AccelerationConfidence.c.1.o: relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC src/v2x-lte/model/gen/AccelerationConfidence.c.1.o: error adding symbols: Bad value collect2: error: ld returned 1 exit status any hint?

ghost commented 2 years ago

The problem solved by: Adding module.env.append_value('CFLAGS', ['-fPIC']) to ns3 folder/src/v2x-lte/wscript $ CXXFLAGS="-std=c++11" ./waf configure --enable-examples --enable-tests $ ./waf build $ ./test.py