Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
133 user(s) are online (91 user(s) are browsing Forums)

Members: 3
Guests: 130

skynet, TheMagicSN, emeck, more...

Support us!

Headlines

 
  Register To Post  

Codebench and C++
Just popping in
Just popping in


See User information
Is it supposed to work or is it C only? Gcc and Vbcc are preconfigured. If I manually choose C++ (with the correct path) it still runs gcc, or not at all.

Gcc/++ 8.3.0 is installed.

Go to top
Re: Codebench and C++
Just popping in
Just popping in


See User information
I use it with C++. I override it to specifically call g++.
I don't have the config with me where I am right now but can post it later if someone else doesn't do it first.
I have been using C++ with gcc 8.1

Go to top
Re: Codebench and C++
Supreme Council
Supreme Council


See User information
I must confess, I don't use C++ at all, but it should be a simple case of choosing "Other" in the compiler settings (http://codebench.co.uk/docs/amigaos4sdk.php#compiler) and pointing it to the builder of your choice.

You may have to alter other areas of the makefile as well, although that would be more experimentation on my part as C++ is gobbledegook to me :)

Simon

Comments made in any post are personal opinion, and are in no-way representative of any commercial entity unless specifically stated as such.
----
http://codebench.co.uk
Go to top
Re: Codebench and C++
Just popping in
Just popping in


See User information
@Rigo

Yes, and the linker too I presume.

Go to top
Re: Codebench and C++
Just popping in
Just popping in


See User information
@arfcarl

Hey arfcarl.

I have had a look at the configuration for a C++ project I am working on and the below config works for me with GCC 8.1.0. I imagine it will work with 8.3.0 but I don't want to upgrade in the middle of a project so haven't done it yet.
Sorry there are no images. I'm not sure how to upload them here. If someone were to tell me how it's done without hosting them, that would be handy

G++ Version Info:
g++ (adtools build 8.1.0) 8.1.0
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Make Tab Settings:
There is nothing special here, though I manage my own Makefile once the basic skeleton is generated.
I leave the Create Makefile unticked.
Builder name is "SDK:c/make -f"
Makefile name is "Makefile" though obviously change the name if yours is different.

Compiler Tab Settings:
Compiler name is set to "Specify >>" and the name supplied is "gcc:bin/g++"
I don't have anything further here that is special.

Target Settings:
I set up a target with the settings below ...
Linker Name is "gcc:bin/g++"
Linker Switches is "-lstdc++
Objects and libs specified as needed, though most is in the makefile.

The Makefile contains the following which may assist in your setup. It was originally generated automatically, then I edited it accordingly and stopped it generating automatically:
I also use Hans's debugging harness which is pretty handy.

Hope it all helps.

Cheers, Steady.

===================================
#
# HexSee Makefile
#

###################################################################
##
##//// Objects
##
###################################################################
HexSee_OBJ := \
HexSee.o \
RSApplication.o RSProcess.o RSTask.o \
RSWindow.o HSMainWin.o \
Debug.o retrami.o \
HexGadget.o

###################################################################
##
##//// Variables and Environment
##
###################################################################

CCPP := gcc:bin/g++
CC := gcc:bin/gcc

TARGET := HexSee

INCPATH := -I.

CPPFLAGS := $(INCPATH) -gstabs -mcrt=clib2 -athread=native
CFLAGS := $(INCPATH) -gstabs -mcrt=clib2 -athread=native

DFLAGS :=

# ----- UNCOMMENT DIFFERENT DFLAG LINES TO CHANGE THE LOGGING BEHAVIOUR -----
# DFLAGS for logging all debug messages
DFLAGS := -DDEBUG -DTARGET="$(TARGET)"

# DFLAGS for static debug level
#DFLAGS := -DDEBUG -DDEBUG_LOGLEVEL=DBG_WARNING -DTARGET="$(TARGET)"

# DFLAGS for user settable logging level

#DFLAGS := -DVARLEVEL_DEBUG -DTARGET="$(TARGET)"

###################################################################
##
##//// General rules
##
###################################################################

.PHONY: all all-before all-after clean clean-custom realclean

all: all-before HexSee all-after

all-before:
# You can add rules here to execute before the project is built
@echo "Copying latest binary and header from HexGadget project"
copy /HexGadget/HexGadget.h HexGadget.h
copy /HexGadget/HexGadget.o HexGadget.o

all-after:
# You can add rules here to execute after the project is built

clean: clean-custom
@echo "Cleaning compiler objects..."
@rm -f #?.o

realclean:
@echo "Cleaning compiler objects and targets..."
@rm -f #?.o HexSee

###################################################################
##
##//// Targets
##
###################################################################

HexSee: $(HexSee_OBJ)
@echo "Linking HexSee"
@$(CCPP) -o HexSee $(HexSee_OBJ) $(DFLAGS) $(CPPFLAGS)
@echo "Removing stale debug target: HexSee"
@rm -f HexSee.debug


###################################################################
##
##//// Standard rules
##
###################################################################

# A default rule to make all the objects listed below
# because we are hiding compiler commands from the output

.c.o:
@echo "Compiling $<"
@$(CC) -std=c11 -c $< -o $*.o $(DFLAGS) $(CFLAGS)

.cpp.o:
@echo "Compiling $<"
@$(CCPP) -std=c++14 -c $< -o $*.o $(DFLAGS) $(CPPFLAGS)

#
# C++ 2014
#
RSTask.o: RSTask.cpp RSTask.h retrami.h
RSProcess.o: RSProcess.cpp RSProcess.h RSTask.h retrami.h
RSApplication.o: RSApplication.cpp RSApplication.h RSProcess.h RSTask.h retrami.h
HexSee.o: HexSee.cpp HexSee.h RSApplication.h RSProcess.h RSTask.h retrami.h
RSWindow.o: RSWindow.cpp RSWindow.h retrami.h
HSMainWin.o: HSMainWin.cpp HSMainWin.h RSWindow.h retrami.h

#
# C 2011
#
debug.o: Debug.c Debug.h
retrami.o: retrami.c retrami.h

Go to top
Re: Codebench and C++
Just popping in
Just popping in


See User information
Thank you very much all of you.

There's clearly a bug regarding setting the Linker to something else than gcc. If I change to g++, next time I check it's back to gcc. The result of this is: @gcc:bin/gcc -o new_target $(new_target_OBJ) -lstdc++

Or will gcc understand it's g++ with the "-lstdc++" option?


The linking is probably the main problem for me.

Go to top
Re: Codebench and C++
Just popping in
Just popping in


See User information
@arfcarl

Just set it in your Makefile. That's what I do.

gcc with -lstdc++ seems to work but I changed it to be g++ which implies the stdc++ lib.

I think my compiler setting (with -lstdc++) was before I started modifying the Makefile directly and so is not needed with g++.

Go to top
Re: Codebench and C++
Just popping in
Just popping in


See User information
The Makefile should more or less be fine now.

Next problem: gcc:bin/g++ -MM -athread=native -O2 -W -Wall -I.. -std=c++11 -DTASKRUNNER_LOGERR -DTASKRUNNER_LOGWARN -DTASKRUNNER_LOGINFO -MT ../framework/beta.o ../framework/beta.cpp > ../framework/beta.d
gcc:bin/g++: unable to open redirection file
gcc:bin/g++ failed returncode 10
make: *** [../framework/beta.d] Error 10

This works on the cross compiler I've set up in Cygwin under Windows, with the help of Kas1e. Now I'm trying to make exactly the same code on a real OS 4.1 machine, with the help of Codebench. G++ 8.3.0 in both cases.

Go to top
Re: Codebench and C++
Home away from home
Home away from home


See User information
@arfcarl
That probably because of "../" , as equalent on amigaos are pure "/".

I.e. if you need on directory up, then "cd /", not "cd ../".

To make makefiles works both on amigaos4 natively and on corsscompiler, usually you made some vars in makefiles where you detect if it native or corsscompiler, and depends do the things. Like in that makefile we have for glsnoop:

ifneq ($(shell uname), AmigaOS)
    
CC         ppc-amigaos-gcc
    DELETE        
rm -f
    STRIP 
ppc-amigaos-strip
    AMIGADATE 
= $(shell date +"%-d.%-m.%Y")
else
    
CC         gcc
    DELETE        
delete
    STRIP 
strip
    AMIGADATE 
= $(shell date LFORMAT "%-d.%-m.%Y")
endif

NAME glSnoop
OBJS 
main.o ogles2_module.o warp3dnova_module.o logger.o gui.o common.o filter.o timer.o profiling.o
DEPS 
= $(OBJS:.o=.d)

CFLAGS = -Wall -Wextra -O3 -gstabs -D__AMIGA_DATE__="$(AMIGADATE)"

# Dependencies
%.: %.c
    
$(CC) -MM -MP -MT $(@:.d=.o) -$@ $< $(CFLAGS)

%.
: %.c
    
$(CC) -$@ -$< $(CFLAGS)

$(
NAME): $(OBJSmakefile
    
$(CC) -$@ $(OBJS) -lauto

clean
:
    $(
DELETE) $(OBJS)

strip:
    $(
STRIP) $(NAME)

ifneq ($(MAKECMDGOALS),clean)
-include $(
DEPS)
endif


In the same way you add something like "SEPARATOR" and use it later when need it: if it crosscompiler then "../" if it amigaos4 native then "/"

Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: Codebench and C++
Just popping in
Just popping in


See User information
Thank you. I have to try to understand all of that, right now I'm wasting hours just to make the thing build and find the right file in the right path.

Go to top

  Register To Post

 




Currently Active Users Viewing This Thread: 1 ( 0 members and 1 Anonymous Users )




Powered by XOOPS 2.0 © 2001-2024 The XOOPS Project