cancel
Showing results for 
Search instead for 
Did you mean: 

syntax error: unexpected ")" when i run a binary in stm32mp157f-dk2

nitgbhat
Associate II

Hi,

I have written a cpp program with two threads, one thread for uart serial communication and other thread to control the GPIOs

i have compiled it, and i got a binary

But

When i transfered it to the board i get the error 

./fw_dali_controller: line 1: syntax error: unexpected ")"

 

I will paste the Makefile below knidly help me in resolving the issue.

Makefile

# Makefile for fw_dali_controller
PROG = dali
CC = g++
 
#CFLAGS = -Wall -std=c++11
#LDFLAGS = -lpthread
 
# Add / change option in CFLAGS and LDFLAGS
 
CFLAGS += -Wall $(sudo shell /home/nitesh/STM32MPU_workspace/STM32MP1-Ecosystem-v5.0.0/Developer-Package/SDK/sysroots/cortexa7t2hf-neon-vfpv4-ostl-linux-gnueabi/usr/share --cflags gtk+-3.0)
 
CFLAGS += -Wall $(sudo shell /home/nitesh/STM32MPU_workspace/STM32MP1-Ecosystem-v5.0.0/Developer-Package/SDK/sysroots/cortexa7t2hf-neon-vfpv4-ostl-linux-gnueabi/usr/src/debug --cflags shared-mime-info)
 
LDFLAGS += $(sudo shell /home/nitesh/STM32MPU_workspace/STM32MP1-Ecosystem-v5.0.0/Developer-Package/SDK/sysroots/cortexa7t2hf-neon-vfpv4-ostl-linux-gnueabi/usr/share --libs gtk+-3.0)
 
LDFLAGS += $(sudo shell /home/nitesh/STM32MPU_workspace/STM32MP1-Ecosystem-v5.0.0/Developer-Package/SDK/sysroots/cortexa7t2hf-neon-vfpv4-ostl-linux-gnueabi/usr/src/debug --libs shared-mime-info)
 
SRC_DIR = src
INC_DIR = inc
BUILD_DIR = build
BIN_DIR = bin
 
# List of source files
SRCS = $(SRC_DIR)/Serial_Comm.cpp $(SRC_DIR)/Gpio_Control.cpp $(SRC_DIR)/main.cpp
 
# List of object files
OBJS = $(patsubst $(SRC_DIR)/%.cpp,$(BUILD_DIR)/%.o,$(SRCS))
 
# Target executable
TARGET = $(BIN_DIR)/fw_dali_controller
 
# Targets
$(TARGET): $(OBJS)
$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
 
$(BUILD_DIR)/%.o: $(SRC_DIR)/%.cpp
$(CC) $(CFLAGS) -c -o $@ $< -I$(INC_DIR) -I$(SRC_DIR)
 
clean:
rm -rf $(BUILD_DIR)/*.o $(TARGET)
 
.PHONY: clean

 

1 REPLY 1
nitgbhat
Associate II

Hi ,

I am unable to compile the C++ program, 

I am getting undefined reference errors for this include file 

#include <iostream>

I am using the makefile which is given in this WIKI how link

https://wiki.st.com/stm32mpu/wiki/Getting_started/STM32MP1_boards/STM32MP157x-DK2/Develop_on_Arm%C2%AE_Cortex%C2%AE-A7/Create_a_simple_hello-world_application

Kindly help me resolve this issue

 

Regards,

Nitesh