In a nutshell, I want to start a side project and I need to make .exe
of my code. I manage to but whenever I try to click it gives the error:
This app can't run on your pc
The normal terminal runs the executable perfectly.
I already know it is a PATH problem and I have been looking for an answer for a couple of days now. I just do not know what the PATH problem is or how to make the %.exe
to include its path so it is clickable.
I think the problem is not in the actual code but I will still include a snapshot of my Makefile here:
.Phony: all server dist clean
IDIR = include
CC ?= gcc
USERFLAGS+=
CLFLAGS += -I$(IDIR) -g -Wall -Wpedantic $(USERFLAGS) -std=c11 -Wno-format-extra-args
ODIR=obj
LDIR=lib
SRCDIR=src
LIBS=-lm
SRCS= $(wildcard $(SRCDIR)/*.c)
DEPS= $(wildcard $(ODIR)/*.o)
OBJ = $(patsubst $(SRCDIR)/%, $(ODIR)/%, $(SRCS:%.c=%.o))
all: server.exe
$(ODIR)/%.o: $(SRCDIR)/%.c
@echo "Making objects..."
mkdir -p $(ODIR)
$(CC) -MMD $(CLFLAGS) -c -o $@ $<
server.exe: $(OBJ)
@echo "Compiling..."
$(CC) -o $@ $(OBJ) $(CFLAGS) $(LIBS)
The main error message in normal mode:
This app cannot run on this pc
Error message in administrative mode:
Windows cannot find "[]/[]/server.exe", make sure you typed in the name correctly.
And I just do not know where to set the path or how to automate that, if possible.