Closed ghostravenstorm closed 3 years ago
I've confirmed the TinyXML2 lib is correctly referenced in the VS solution CMake generated. I tried building the solution in VS, and it spits out the same 16 linker errors on TinyXML2. Not sure why this is.
TinyXML2 NuGet package only contains the library for x64 platform. There is a line in the log you pasted that tells you are compiling in x86:
C:\ProgramData\chocolatey\lib\tinyxml2\lib\tinyxml2d.lib : warning LNK4272: library machine type 'x64' conflicts with target machine type 'X86' [H:\Vcom3D\AMM\Repos\eProsima\Fast-DDS\build\src\cpp\fastrtps.vcxproj]
You could compile your project for x64 platform
# In CMake configuration step
cmake -A x64 .
or configure Fast-DDS to compile internally TinyXML2
# In CMake configuration step
cmake -DTHIRDPARTY=ON -DTINYXML2_FROM_SOURCE=ON .
To complement @richiware 's response, starting Fast DDS v2.1.0, you could do the configuration step with only one flag:
# In CMake configuration step
cmake -DTHIRDPARTY_TinyXML2=FORCE .
More on Fast DDS CMake options here.
Please do tell us how it goes!
Using cmake -DTHIRDPARTY=ON
seems to have work.
I built using Visual Studio 2017 and 2015 and both are successful.
Installed foonathan_memory_vendor first, then ran cmake -DTHIRDPARTY=ON .. | cmake --build . --target install
When the instillation was first failing, this was on Visual Studio 2015. I started thinking maybe VS 2015 isn't comptatible. I choose that version because the FastDDS gen tool only builds up to VS 2015.
Seems using the TinyXML2 submodule is the way to go.
I ran into some problems trying to build a VS project created with Fast-DDS-Gen. I posted it over on that repo.
Due to your problem compiling FastDDS was solved, I will close this issue.
I followed the setup and build instructions to the key, and
cmake --build . --target install
ran into linker errors on TinyXML2 after I have installed it via choclately.Steps I took to build: Start a fresh Windows 10 VM Download and install CMake 3.19, VS 2015 update 3, Chocolatey, gitbash for Windows Download ASIO and TinyXML2 NuGet packages as outlined in the readme, and install them via Chocolatey. Clone foonathan_memory_vendor via gitbash and install it via CMake Clone Fast-CDR via gitbash and install it via CMake Clone Fast-DDS via gitbash and install it via CMake Observe error LNK2019 referencing TinyXML2.
Expectation: There should not be a linker error on Tiny XML2 since I took the steps to install the NuGet package.