Skip to content

Improve support for C++ project. #19

@xkam1x

Description

@xkam1x

Issue

The template offers good support for C projects and attempts to include C++ projects as well.

Unfortunately, when using C++ files, the rules.mk fails to include C++ standard library -lstdc++ which can result in undefined reference to various objects.

Fix

You can add a few lines to rules.mk to check for CXXFILES and add the -lstdc++ if necessary.

Example Fix

100	100	LDLIBS += -Wl,--start-group -lc -lgcc -lnosys -Wl,--end-group
101	101	
	102	+ ifneq ($(strip $(CXXFILES)),)
	103	+ LDLIBS += -lstdc++
	104	+ endif
	105	+
102	106	# Burn in legacy hell fortran modula pascal yacc idontevenwat

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions