mirror of
https://github.com/AntonioND/nitro-engine.git
synced 2025-06-18 16:45:33 -04:00
templates: examples: Fix linker invocation for C++
Using g++ to link object files automatically links the STD of C++. It looks like this library is linked outside of the start/end-group commands with the other libraries, which causes undefined reference errors when linking C++ projects that use standard library functions that interface with the OS, like `fopen()`. Thanks to @lifehackerhansol for the report and testing the fix.
This commit is contained in:
parent
5ea29c4f81
commit
d7ecc5cc4d
@ -1,6 +1,6 @@
|
||||
# SPDX-License-Identifier: CC0-1.0
|
||||
#
|
||||
# SPDX-FileContributor: Antonio Niño Díaz, 2023
|
||||
# SPDX-FileContributor: Antonio Niño Díaz, 2023-2024
|
||||
|
||||
export BLOCKSDS ?= /opt/blocksds/core
|
||||
export BLOCKSDSEXT ?= /opt/blocksds/external
|
||||
@ -71,6 +71,7 @@ endif
|
||||
PREFIX := $(ARM_NONE_EABI_PATH)arm-none-eabi-
|
||||
CC := $(PREFIX)gcc
|
||||
CXX := $(PREFIX)g++
|
||||
LD := $(PREFIX)gcc
|
||||
OBJDUMP := $(PREFIX)objdump
|
||||
MKDIR := mkdir
|
||||
RM := rm -rf
|
||||
@ -116,10 +117,8 @@ SPECS := $(BLOCKSDS)/sys/crts/ds_arm9.specs
|
||||
WARNFLAGS := -Wall
|
||||
|
||||
ifeq ($(SOURCES_CPP),)
|
||||
LD := $(CC)
|
||||
LIBS += -lc
|
||||
else
|
||||
LD := $(CXX)
|
||||
LIBS += -lstdc++ -lc
|
||||
endif
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
# SPDX-License-Identifier: CC0-1.0
|
||||
#
|
||||
# SPDX-FileContributor: Antonio Niño Díaz, 2023
|
||||
# SPDX-FileContributor: Antonio Niño Díaz, 2023-2024
|
||||
|
||||
BLOCKSDS ?= /opt/blocksds/core
|
||||
BLOCKSDSEXT ?= /opt/blocksds/external
|
||||
@ -70,6 +70,7 @@ endif
|
||||
PREFIX := $(ARM_NONE_EABI_PATH)arm-none-eabi-
|
||||
CC := $(PREFIX)gcc
|
||||
CXX := $(PREFIX)g++
|
||||
LD := $(PREFIX)gcc
|
||||
OBJDUMP := $(PREFIX)objdump
|
||||
MKDIR := mkdir
|
||||
RM := rm -rf
|
||||
@ -115,10 +116,8 @@ ARCH := -march=armv5te -mtune=arm946e-s
|
||||
WARNFLAGS := -Wall
|
||||
|
||||
ifeq ($(SOURCES_CPP),)
|
||||
LD := $(CC)
|
||||
LIBS += -lc
|
||||
else
|
||||
LD := $(CXX)
|
||||
LIBS += -lstdc++ -lc
|
||||
endif
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
# SPDX-License-Identifier: CC0-1.0
|
||||
#
|
||||
# SPDX-FileContributor: Antonio Niño Díaz, 2023
|
||||
# SPDX-FileContributor: Antonio Niño Díaz, 2023-2024
|
||||
|
||||
BLOCKSDS ?= /opt/blocksds/core
|
||||
BLOCKSDSEXT ?= /opt/blocksds/external
|
||||
@ -70,6 +70,7 @@ endif
|
||||
PREFIX := $(ARM_NONE_EABI_PATH)arm-none-eabi-
|
||||
CC := $(PREFIX)gcc
|
||||
CXX := $(PREFIX)g++
|
||||
LD := $(PREFIX)gcc
|
||||
OBJDUMP := $(PREFIX)objdump
|
||||
MKDIR := mkdir
|
||||
RM := rm -rf
|
||||
@ -115,10 +116,8 @@ ARCH := -march=armv5te -mtune=arm946e-s
|
||||
WARNFLAGS := -Wall
|
||||
|
||||
ifeq ($(SOURCES_CPP),)
|
||||
LD := $(CC)
|
||||
LIBS += -lc
|
||||
else
|
||||
LD := $(CXX)
|
||||
LIBS += -lstdc++ -lc
|
||||
endif
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
# SPDX-License-Identifier: CC0-1.0
|
||||
#
|
||||
# SPDX-FileContributor: Antonio Niño Díaz, 2023
|
||||
# SPDX-FileContributor: Antonio Niño Díaz, 2023-2024
|
||||
|
||||
BLOCKSDS ?= /opt/blocksds/core
|
||||
BLOCKSDSEXT ?= /opt/blocksds/external
|
||||
@ -71,6 +71,7 @@ endif
|
||||
PREFIX := $(ARM_NONE_EABI_PATH)arm-none-eabi-
|
||||
CC := $(PREFIX)gcc
|
||||
CXX := $(PREFIX)g++
|
||||
LD := $(PREFIX)gcc
|
||||
OBJDUMP := $(PREFIX)objdump
|
||||
MKDIR := mkdir
|
||||
RM := rm -rf
|
||||
@ -116,10 +117,8 @@ ARCH := -march=armv5te -mtune=arm946e-s
|
||||
WARNFLAGS := -Wall
|
||||
|
||||
ifeq ($(SOURCES_CPP),)
|
||||
LD := $(CC)
|
||||
LIBS += -lc
|
||||
else
|
||||
LD := $(CXX)
|
||||
LIBS += -lstdc++ -lc
|
||||
endif
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user