Mingw32-make Error 87 when building on Windows

Question/Issue: I keep on getting a mingw32-make error when trying to build my c++ library on windows:

make (e=87): The parameter is incorrect.
mingw32-make: *** [Makefile:110: app] Error 87
“Building standalone classifier OK”

Project ID: 315617

Context/Use case: I am trying to run local inferencing on a raspberry pico W of a tflite model I have. I deploy the project as a C++ library, and upon downloading the library and adding the files to the “example-standalone-inferencing-master” template I run “build.bat” in the command line. It is building the project for about 5 minutes until I get the make (e=87): The parameter is incorrect error. I’m having a tough time troubleshooting and could use some assistance! It seems its having an issue with line 110 of the makefile, which is just the else line in the block:

ifeq ($(OS), Windows_NT)
	if not exist build mkdir build
else
	mkdir -p $(BUILD_PATH)
endif
	$(CXX) $(COBJECTS) $(CXXOBJECTS) $(CCOBJECTS) -o $(BUILD_PATH)/$(NAME) $(LDFLAGS)
1 Like

replace
$(CXX) $(COBJECTS) $(CXXOBJECTS) $(CCOBJECTS) -o $(BUILD_PATH)/$(NAME) $(LDFLAGS)

with
ar -crv $(BUILD_PATH)/ar1.a $(COBJECTS)
ar -crv $(BUILD_PATH)/ar2.a $(CXXOBJECTS)
ar -crv $(BUILD_PATH)/ar3.a $(CCOBJECTS)
$(CXX) $(BUILD_PATH)/AR1.a $(BUILD_PATH)/AR2.a $(BUILD_PATH)/AR3.a -o $(BUILD_PATH)/$(NAME) $(LDFLAGS)

5 Likes

It worked perfectly, thanks a bunch!

I had the same problem in windows and this solution worked perfectly. Thank you @EnergyYF

i had a same problem thank you