Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve support for C++ project. #19

Open
xkam1x opened this issue Jul 17, 2024 · 0 comments
Open

Improve support for C++ project. #19

xkam1x opened this issue Jul 17, 2024 · 0 comments

Comments

@xkam1x
Copy link

xkam1x commented Jul 17, 2024

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant