Hi Friend,
I am not so sure if that is possible if you are using HMG-IDE to build your program. Perhaps if you wish to compile your source code using another version of Mingw, you have to build it from dos command window or console window as they call it. Prepare a makefile.gcc and a batch file to compile codes. Also you have to set the path for binaries.
I build harbour source code using Mingw that comes from HMG distribution. Here is a sample of my batch file to set only the path.
1. I created a shortcut for c:\windows\system32\cmd.exe.
2. I modify the target (from the shortcut icon, right click->properties) and changed it to:
%SystemRoot%\system32\cmd.exe /K f:\DAD\BATCHCOMMAND\SETMINGW.BAT
3. the batch file only contain this lines:
Code: Select all
@ECHO OFF
C:
CD\
F:
CD\
set HB_PATH=c:\hmg\harbour
set path=%path%;c:\hmg\mingw\bin;c:\hmg\harbour\bin
@ECHO ON
In your case, simply changed c:\hmg\mingw\bin with c:\mingw\bin (if you installed it on that folder, otherwise put the correct path so that the executables can be found).
4. Here is a sample of my hmgobjects.gcc that I used to build HMG Objects as libhmgobjects.a
Code: Select all
HRB_DIR = c:/hmg/harbour
INC_DIR = c:/hmg/include
OBJ_DIR = f:/dad/hmgobjects/source
LIB_DIR = f:/dad/hmgobjects/source
SRC_DIR = f:/dad/hmgobjects/source
CFLAGS = -Wall -mno-cygwin -O3
all: \
$(LIB_DIR)/libhmgobjects.a \
$(LIB_DIR)/libhmgobjects.a : \
$(OBJ_DIR)/objects.o
ar rc $@ $^
$(OBJ_DIR)/objects.o : $(OBJ_DIR)/objects.c
$(OBJ_DIR)/objects.c : $(SRC_DIR)/objects.prg
$(HRB_DIR)/bin\harbour.exe $^ -n -I$(HRB_DIR)/include -i$(INC_DIR) -d__WINDOWS__ -o$@ $^
.prg.c:
$(HRB_DIR)/bin\harbour.exe $^ -n -I$(HRB_DIR)/include -i$(INC_DIR) -d__WINDOWS__ -o$@ $^
.c.o:
gcc $(CFLAGS) -c -I$(INC_DIR) -I$(HRB_DIR)/include -o $@ $^
5. Here is a batch file to call the hmgobjects.gcc
Code: Select all
@echo off
set HmgPath=c:\hmg
Set Path=%HmgPath%\mingw\bin
if "%1" == "clean" goto CLEAN
if "%1" == "CLEAN" goto CLEAN
:BUILD
mingw32-make.exe -f hmgobjects.gcc
if errorlevel 1 goto BUILD_ERR
:BUILD_OK
goto EXIT
:BUILD_ERR
goto EXIT
:CLEAN
del *.a
del *.bak
del *.o
del *.c
goto EXIT
:EXIT
6. Caveats: I don't use the shortcut (from item #1 to #3) if I want to compile HMG codes or programs instead I use the combination of batch file and <makefile>.gcc
If I wanted to build some Harbour contribs from nightly source or from Harbour SVN I used the shortcut and used hbmk2 <compilescript>.hbp if it failed to find the library I just copy it in the current directory try it again. (Sorry, I am not so familiar with the mingw script).
In the end, I resort to creating the gcc script as stated in item #4 and recompile.
Frankly speaking, friend, it is much easier to review working samples from the distribution and deduce the difference and create a script. Well it is frustrating sometime, but when you are able to do what you have intended, you would gain some insight.
Don't delete the mingw installation from hmg, simply rename the folder so that you have a fall back just in case everything didn't turn out right...
But if what I have written here does not help you, I'm sorry and then don't loose hope, in a few days more you would find the solution for sure. Don't let your HMG spirit fades...
Regards,
Danny