Author Topic: Configuring mingw project in v22.0.2.1  (Read 12368 times)

bremenpl

  • Community Member
  • Posts: 90
  • Hero Points: 0
  • Electrical Engineer
Configuring mingw project in v22.0.2.1
« on: May 22, 2018, 04:32:02 AM »
Hello there,
I started using Slickedit back in 2013 and last time I used it was in 2014. I tried to like it more but it was simply to complicated to setup as an IDE, thus, to expensive to use only as an alternative to Notepad++ for viewing files.
Yesterday I decided to give it another shot, since some years passed by. Thought maybe it improved, maybe I will know how to set it up faster since im doing my job for a longer amount of time now. And again, I cannot set up a simple mingw c project on Windows platform... Maybe I dont get it but i is just so much simplier in Eclipse. I tried to use this blog post: https://www.youtube.com/watch?v=njXbtrW3-po but the context menus are out of date already. And this is just the compiler step, i will have to setup the debugger as well.

My question is: Is there any up to date, step-by-step guide on what to do in order to setup a c compiler in Slickedit v22.0.2.1? I would appreciate all help.

Dan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2907
  • Hero Points: 153
Re: Configuring mingw project in v22.0.2.1
« Reply #1 on: May 22, 2018, 11:58:35 AM »
Sorry this isn't more obvious, but it's fairly simple to make it work.

  • Be sure g++ is in your path
  • Use the project wizard(s) for GNU C/C++
  • Go to Debug>Debugger Options>Configurations.  There should be an entry there for the MinGW debugger already (if not let me know).  Select it and click "Default native debugging configurations".

bremenpl

  • Community Member
  • Posts: 90
  • Hero Points: 0
  • Electrical Engineer
Re: Configuring mingw project in v22.0.2.1
« Reply #2 on: May 22, 2018, 03:07:20 PM »
Hi, thanks for answer. Yes, thats another thing. Is there a way to define the g++ (and all other programs) manually so it doesnt have to be set in PATH?

Dan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2907
  • Hero Points: 153
Re: Configuring mingw project in v22.0.2.1
« Reply #3 on: May 22, 2018, 03:09:52 PM »
Hi, thanks for answer. Yes, thats another thing. Is there a way to define the g++ (and all other programs) manually so it doesnt have to be set in PATH?

Yes.  Go to Build>GNU C Options and it's on the Compile tab toward the bottom.  There's another on the Link tab.  We already talked about the debugger configuration in the previous post.

bremenpl

  • Community Member
  • Posts: 90
  • Hero Points: 0
  • Electrical Engineer
Re: Configuring mingw project in v22.0.2.1
« Reply #4 on: May 22, 2018, 03:29:55 PM »
I had to change the default slashes from "\" to "/" because the program did not recognize them. At the moment trying to compile hello world. The Pathes seems ok but still:

Code: [Select]
K: & cd K:\testowy

K:\testowy>echo VSLICKERRORPATH="K:\testowy"
VSLICKERRORPATH="K:\testowy"

K:\testowy>"C:\Program Files\SlickEdit Pro 22.0.2\win\vsbuild" -signal 56182 -command make -f "K:\testowy\test2.mak" CFG=Debug
 VSLICKERRORPATH="K:\testowy"
make -f K:\testowy\test2.mak CFG=Debug
C:/MinGW/bin/gcc.exe -c   -g3 -ggdb -p -pg -o "Debug/test2.o"  test2.c
make: *** [Debug/test2.o] Error 1

K:\testowy>

Any idea what could be left there to set?

Dan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2907
  • Hero Points: 153
Re: Configuring mingw project in v22.0.2.1
« Reply #5 on: May 22, 2018, 03:32:34 PM »
Did you choose build with a SlickEdit maintained makefile?  Or did you have this makefile already?

bremenpl

  • Community Member
  • Posts: 90
  • Hero Points: 0
  • Electrical Engineer
Re: Configuring mingw project in v22.0.2.1
« Reply #6 on: May 22, 2018, 03:35:44 PM »
I choose for slickedit to maintain makefile.

Dan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2907
  • Hero Points: 153
Re: Configuring mingw project in v22.0.2.1
« Reply #7 on: May 23, 2018, 01:23:20 PM »
I choose for slickedit to maintain makefile.

OK.  Can you send me or attach the makefile?  Maybe we're doing something in there that GNU supports that MinGW's make doesn't (or maybe there's a bug with that option).

bremenpl

  • Community Member
  • Posts: 90
  • Hero Points: 0
  • Electrical Engineer
Re: Configuring mingw project in v22.0.2.1
« Reply #8 on: May 23, 2018, 05:34:54 PM »
Sure thing, here it is:

Code: [Select]
# SlickEdit generated file.  Do not edit this file except in designated areas.

# Make command to use for dependencies
MAKE=make
RM=rm
MKDIR=mkdir

# -----Begin user-editable area-----

# -----End user-editable area-----

# If no configuration is specified, "Debug" will be used
ifndef CFG
CFG=Debug
endif

#
# Configuration: Debug
#
ifeq "$(CFG)" "Debug"
OUTDIR=Debug
OUTFILE=$(OUTDIR)/test.exe
CFG_INC=
CFG_LIB=
CFG_OBJ=
COMMON_OBJ=$(OUTDIR)/test.o
OBJ=$(COMMON_OBJ) $(CFG_OBJ)
ALL_OBJ=$(OUTDIR)/test.o

COMPILE=C:/MinGW/bin/gcc.exe -c   -O0 -g3 -ggdb -p -pg -o "$(OUTDIR)/$(*F).o" $(CFG_INC) $<
LINK=C:/MinGW/bin/gcc.exe  -O0 -g3 -ggdb -p -pg -o "$(OUTFILE)" $(ALL_OBJ)
COMPILE_ADA=gnat -g -c -o "$(OUTDIR)/$(*F).o" "$<"
COMPILE_ADB=gnat -g -c -o "$(OUTDIR)/$(*F).o" "$<"
COMPILE_F=gfortran -c -g -o "$(OUTDIR)/$(*F).o" "$<"
COMPILE_F90=gfortran -c -g -o "$(OUTDIR)/$(*F).o" "$<"
COMPILE_D=gdc -c -g -o "$(OUTDIR)/$(*F).o" "$<"

# Pattern rules
$(OUTDIR)/%.o : %.c
$(COMPILE)

$(OUTDIR)/%.o : %.ada
$(COMPILE_ADA)

$(OUTDIR)/%.o : %.d
$(COMPILE_D)

$(OUTDIR)/%.o : %.adb
$(COMPILE_ADB)

$(OUTDIR)/%.o : %.f90
$(COMPILE_F90)

$(OUTDIR)/%.o : %.f
$(COMPILE_F)

# Build rules
all: $(OUTFILE)

$(OUTFILE): $(OUTDIR) $(OBJ)
$(LINK)

$(OUTDIR):
$(MKDIR) -p "$(OUTDIR)"

# Rebuild this project
rebuild: cleanall all

# Clean this project
clean:
$(RM) -f $(OUTFILE)
$(RM) -f $(OBJ)

# Clean this project and all dependencies
cleanall: clean
endif

#
# Configuration: Release
#
ifeq "$(CFG)" "Release"
OUTDIR=Release
OUTFILE=$(OUTDIR)/test.exe
CFG_INC=
CFG_LIB=
CFG_OBJ=
COMMON_OBJ=$(OUTDIR)/test.o
OBJ=$(COMMON_OBJ) $(CFG_OBJ)
ALL_OBJ=$(OUTDIR)/test.o

COMPILE=gcc -c   -o "$(OUTDIR)/$(*F).o" $(CFG_INC) $<
LINK=gcc  -o "$(OUTFILE)" $(ALL_OBJ)
COMPILE_ADA=gnat -O -c -o "$(OUTDIR)/$(*F).o" "$<"
COMPILE_ADB=gnat -O -c -o "$(OUTDIR)/$(*F).o" "$<"
COMPILE_F=gfortran -O -g -o "$(OUTDIR)/$(*F).o" "$<"
COMPILE_F90=gfortran -O -g -o "$(OUTDIR)/$(*F).o" "$<"
COMPILE_D=gdc -c -g -o "$(OUTDIR)/$(*F).o" "$<"

# Pattern rules
$(OUTDIR)/%.o : %.c
$(COMPILE)

$(OUTDIR)/%.o : %.ada
$(COMPILE_ADA)

$(OUTDIR)/%.o : %.d
$(COMPILE_D)

$(OUTDIR)/%.o : %.adb
$(COMPILE_ADB)

$(OUTDIR)/%.o : %.f90
$(COMPILE_F90)

$(OUTDIR)/%.o : %.f
$(COMPILE_F)

# Build rules
all: $(OUTFILE)

$(OUTFILE): $(OUTDIR) $(OBJ)
$(LINK)

$(OUTDIR):
$(MKDIR) -p "$(OUTDIR)"

# Rebuild this project
rebuild: cleanall all

# Clean this project
clean:
$(RM) -f $(OUTFILE)
$(RM) -f $(OBJ)

# Clean this project and all dependencies
cleanall: clean
endif

Dan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2907
  • Hero Points: 153
Re: Configuring mingw project in v22.0.2.1
« Reply #9 on: May 23, 2018, 06:36:15 PM »
I can't reproduce that problem.  Are your project files in one directory?  Are they in the same directory as the .vpj file, or a relative path?

bremenpl

  • Community Member
  • Posts: 90
  • Hero Points: 0
  • Electrical Engineer
Re: Configuring mingw project in v22.0.2.1
« Reply #10 on: May 23, 2018, 06:47:31 PM »
Yes, its a single hello world file:

Code: [Select]
k:\test>dir
 Wolumin w stacji K to RAMDISK
 Numer seryjny woluminu: 0E17-3000

 Katalog: k:\test

2018-05-23  19:36    <DIR>          .
2018-05-23  19:36    <DIR>          ..
2018-05-23  19:36               199 test.vpw
2018-05-23  19:38               112 test.vpwhist
2018-05-23  19:38             7 372 test.vpj
2018-05-23  19:36               105 test.c
2018-05-23  19:39           147 456 test.vtg
2018-05-23  19:38             2 669 test.mak
2018-05-23  19:37    <DIR>          Debug
               6 plik(ów)            157 913 bajtów
               3 katalog(ów)   2 135 937 024 bajtów wolnych

k:\test>

bremenpl

  • Community Member
  • Posts: 90
  • Hero Points: 0
  • Electrical Engineer
Re: Configuring mingw project in v22.0.2.1
« Reply #11 on: May 23, 2018, 07:14:00 PM »
Its odd, because if I execute the make line manually:

Code: [Select]
C:/MinGW/bin/gcc.exe  -O0 -g3 -ggdb -p -pg -o "Debug/test.exe" Debug/test.o
It compiles. The make does not work:

Code: [Select]
k:\test>make -f test.mak CFG=Debug
C:/MinGW/bin/gcc.exe -c   -O0 -g3 -ggdb -p -pg -o "Debug/test.o"  test.c
C:/MinGW/bin/gcc.exe  -O0 -g3 -ggdb -p -pg -o "Debug/test.exe" Debug/test.o
gcc.exe: fatal error: no input files
compilation terminated.
make: *** [Debug/test.exe] Error 1
« Last Edit: May 23, 2018, 07:17:01 PM by bremenpl »

Dan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2907
  • Hero Points: 153
Re: Configuring mingw project in v22.0.2.1
« Reply #12 on: May 23, 2018, 07:16:17 PM »
I wonder if it is the slashes.  I didn't change mine.

bremenpl

  • Community Member
  • Posts: 90
  • Hero Points: 0
  • Electrical Engineer
Re: Configuring mingw project in v22.0.2.1
« Reply #13 on: May 23, 2018, 07:17:36 PM »
But I can copy those gcc lines and execute in terminal and they work.
Also the lib part works:

Code: [Select]
C:/MinGW/bin/gcc.exe -c   -O0 -g3 -ggdb -p -pg -o "Debug/test.o"  test.c
The output generation does not:

Code: [Select]
C:/MinGW/bin/gcc.exe  -O0 -g3 -ggdb -p -pg -o "Debug/test.exe" Debug/test.o

Dan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2907
  • Hero Points: 153
Re: Configuring mingw project in v22.0.2.1
« Reply #14 on: May 23, 2018, 07:23:00 PM »
What if you use g++ rather than gcc?