I am working on winexe project currently. winexe compiles windows C code on linux using -mno-cygwin as CFLAGS .
following is Makefile under directory winexesvc :-
CFLAGS=-mno-cygwin -Os
LDFLAGS=-mno-cygwin -s -Os
CC_WIN32 := $(shell bash -c 'which {i386,i586}-{mingw32,mingw32msvc}-gcc')
CC_WIN64 := $(shell bash -c 'which {x86_64,amd64}-{mingw32,mingw32msvc}-gcc')
all: winexesvc32_exe.c winexesvc64_exe.c
winexesvc32.exe: winexesvc32.o service32.o
$(CC_WIN32) $(LDFLAGS) -o $@ $^
winexesvc64.exe: winexesvc64.o service64.o
$(CC_WIN64) $(LDFLAGS) -o $@ $^
%32.o: %.c
$(CC_WIN32) -c $(CPPFLAGS) $(CFLAGS) -o $@ $^
%64.o: %.c
$(CC_WIN64) -c $(CPPFLAGS) $(CFLAGS) -o $@ $^
winexesvc32_exe.c: winexesvc32.exe bin2c.exe
./bin2c.exe winexesvc32_exe winexesvc32.exe > $@
winexesvc64_exe.c: winexesvc64.exe bin2c.exe
./bin2c.exe winexesvc64_exe winexesvc64.exe > $@
bin2c.exe: bin2c.c
gcc -s -o $@ $^
clean:
-@rm *.exe *.o *_exe.c
The entire code compiles and run successfully when no modification is done.
But,whenever I replace winexsvc.c file or winexesvc64_exe.c file or winexesvc32_exe.c (I need to modify these 3 files). It shows following error when I replace winexesvc.c with modified code. The modified code dosen't call any other file or any function outside the file.
So, the problem is when I do some modifications in above mentioned 3 files, I get above mentioned errors. Any Idea why this is happening ?
P.S :- I have read other post regarding error of -mno-cygwin option in gcc. but those are not relevant to my problem. additional information :- [I have got this from Makefile of winexesvc folder under winexe.]
Solved :- I used i586-mingw32msvc-gcc command along with suitable flags to compile every file by hand then linking it accordingly.
Got , the required results.