The C compiler is not able to compile a simple test program

Hello,
Hello, I’m trying to install Gazebo on my Windows 10 machine and I’m following the official tutorial (Gazebo : Tutorial : Windows). When I try to configure and build the dependencies using CMake I get the following error:

Any idea on how to fix this problem?
Many thanks in advance.

It seems you have mixed toolchains somehow - the compiler chosen in cl.exe (MSVC toolchain), but it’s trying to link by ld.exe (GNU toolchain).

1 Like

Thank you for the hint. Can you please explain how to use the right toolchain? So what is the next step? I’m not a software developer and this is my first encounter with CMake.

I realize it’s not ideal but try using the meson instructions. At least for setting up your toolchain environment.

Use this for setting up your compilers/linkers. Ignore everything else regarding meson.
https://mesonbuild.com/SimpleStart.html

1 Like

In particular try using the pre-baked command prompts visual studio provides. Instead of you trying to use the .bat file.

IE: Try invoking your project from a vs command prompt:

image

Just use cmd prompt. Then try using cmake like normal.

1 Like

Thank you. I already have VS 2019 with Desktop Development with C++. Then I installed meson. Now should I build the project using meson? The file I’m trying to run is called (.\configure), should I build a project to run it?
Frankly it still does not make sense to me.

I believe I have confused you further the point was not to install meson. Just to make sure you already had setup the proper toolchain environment. Don’t install meson.

Uninstall meson. That’s not gonna help you here.

I’m not really familiar with NMake. Is there any reason you can’t use Visual Studio / Ninja as your generator instead?

1 Like

someone on Github suggested that it is a DLL Hell (DLL Hell - Wikipedia) because my system is not cleaned or formatted for a long time, and that’s true. I installed Gazebo in another way, namely by installing ROS, and I got Gazebo included by default. So I got the software I need but didn’t fix the issue in CMake. That is fine for the mean time.
Thank you for your help and care @YMba9g8j9CJp0wLoQf5y :pray: :tulip: