Einzelnen Beitrag anzeigen

Benutzerbild von paule32.jk
paule32.jk

Registriert seit: 24. Sep 2022
Ort: Planet Erde
312 Beiträge
 
Delphi 11 Alexandria
 
#1

Cross Compiler FPC erfordert Library

  Alt 24. Aug 2024, 10:28
Hallo,
ich habe folgendes Makefile:
Code:
# ---------------------------------------------------------------------------
# File:  Makefile
# Author: (c) 2024 Jens Kallup - paule32
# All rights reserved
# ---------------------------------------------------------------------------

WIN_PATH =
FPC_PATH = E:\FPCdeluxe

GPP_32 = $(WIN_PATH)/mingw32/bin/i686-w64-mingw32-g++.exe
GCC_32 = $(WIN_PATH)/mingw32/bin/i686-w64-mingw32-gcc.exe

FPC_32 = $(FPC_PATH)/fpc/bin/i386-win32/ppcross386.exe
FPC_64 = $(FPC_PATH)/fpc/bin/i386-win32/ppcrossx64.exe

GPP_64 = $(WIN_PATH)/mingw64/bin/x86_64-w64-mingw32-g++.exe
GCC_64 = $(WIN_PATH)/mingw64/bin/x86_64-w64-mingw32-gcc.exe

FPC_CC = $(FPC_PATH)/bin/i386-win32/gcc.exe
FPC_REL_FLAGS_LINUX =\
    -Tlinux -dRELEASE -FD$(FPC_PATH)/cross/bin/x86_64-linux \
    -Fu$(FPC_PATH)/fpc/units/x86_64-linux \
    -Fl$(FPC_PATH)/cross/lib/x86_64-linux \
    -Fu./pas -Fu./ \
    -FE./obj \
    -vn- -Mdelphi
#
FPC_DEB_FLAGS_LINUX =\
    -Tlinux -dDEBUG  -FD$(FPC_PATH)/cross/bin/x86_64-linux \
    -Fu$(FPC_PATH)/fpc/units/x86_64-linux \
    -Fl$(FPC_PATH)/cross/lib/x86_64-linux \
    -Fu./pas -Fu./ \
    -gl \
    -FE./obj \
    -vn- -Mdelphi

QT_632_INC =\
    -I./cpp \
    -I$(WIN_PATH)/mingw64/include

GCC_32_REL_FLAGS = -m32 -O2 -wno-write-strings -fPIC -shared
GCC_64_REL_FLAGS = -m64 -O2 -wno-write-strings -fPIC -shared

GCC_32_DEB_FLAGS += $(GCC_32_REL_FLAGS) -g gdb
GCC_64_DEB_FLAGS += $(GCC_32_REL_FLAGS) -g gdb

GPP_XX_REL_FLAGS = -O2 -Wno-write-strings -fPIC -shared -std=c++20
GPP_32_REL_FLAGS = $(GPP_XX_REL_FLAGS) -m32 $(INCLUDES)
GPP_64_REL_FLAGS = $(GPP_XX_REL_FLAGS) -m64 $(INCLUDES) -DDEBUG

GPP_32_DEB_FLAGS = $(GPP_32_REL_FLAGS) -g gdb
GPP_64_DEB_FLAGS = $(GPP_64_REL_FLAGS) -g gdb

WINDOWS_BIN_REL_32 = ./win32/Release
WINDOWS_BIN_REL_64 = ./win64/Release

WINDOWS_BIN_DEB_32 = ./win32/Debug
WINDOWS_BIN_DEB_64 = ./win64/Debug

TARGET = fpc-qt.dll

TARGET_REL_32 = $(WINDOWS_BIN_REL_32)/$(TARGET)
TARGET_REL_64 = $(WINDPWS_BIN_REL_64)/$(TARGET)

TARGET_DEB_32 = $(WINDOWS_BIN_DEB_32)/$(TARGET)
TARGET_DEB_64 = $(WINDOWS_BIN_DEB_64)/$(TARGET)

CPP_DIR = ./cpp
PAS_DIR = ./pas
OBJ_DIR = ./obj

SRCS = $(wildcard $(CPP_DIR)/*.cc)
OBJS = $(patsubst $(CPP_DIR)/%.cc,$(OBJ_DIR)/%.o,$(SRCS))

# ---------------------------------------------------------------------------
# start file
# ---------------------------------------------------------------------------
all: linux
#clean presteps $(TARGET_REL_64) $(TARGET_LINUX_64)

# ---------------------------------------------------------------------------
# 64-Bit release DLL target ...
# ---------------------------------------------------------------------------
$(TARGET_REL_64): $(OBJS)
   $(GPP_64) $(GPP_64_REL_FLAGS) -o $@ $^ -lQt5Core -lQt5Widgets

$(OBJ_DIR)/%.o: $(CPP_DIR)/%.cc
   $(GPP_64) $(GPP_64_REL_FLAGS) -o $@ -c $<

# ---------------------------------------------------------------------------
# 32-Bit release DLL target ...
# ---------------------------------------------------------------------------
$(TARGET_REL_32): $(OBJS)
   $(GPP_32) $(GPP_32_REL_FLAGS) -o $@ $^

# ---------------------------------------------------------------------------
# 64-Bit release DLL target ...
# ---------------------------------------------------------------------------
$(TARGET_LINUX_64): fpcqt.dpr
   $(FPC_64) $(FPC_REL_FLAGS_LINUX) fpcqt.dpr

linux: fpcqt.dpr
   echo "sss"
   $(FPC_64) $(FPC_REL_FLAGS_LINUX) fpcqt.dpr

clean:
   rm -rf $(OBJ_DIR) $(BIN_DIR)

rebuild: clean all

presteps:
   mkdir -p ./obj
   
.PHONY: all clean rebuild linux
und ich erhalte folgende Ausgabe, wenn ich am Prompt E: make eingebe:

Code:
E:\FPCdeluxe/fpc/bin/i386-win32/ppcrossx64.exe -Tlinux -dRELEASE -FDE:\FPCdeluxe/cross/bin/x86_64-linux -FuE:\FPCdeluxe/fpc/units/x86_64-linux -FlE:\FPCdeluxe/cross/lib/x86_64-linux -Fu./pas -Fu./ -FE./obj -vn- -Mdelphi fpcqt.dpr
Compiling Release Version
Free Pascal Compiler version 3.2.2-r0d122c49 [2024/08/23] for x86_64
Copyright (c) 1993-2021 by Florian Klaempfl and others
Target OS: Linux for x86-64
Compiling fpcqt.dpr
Linking .\obj\fpcqt
E:\FPCdeluxe\cross\bin\x86_64-linux\x86_64-linux-gnu-ld.exe: cannot find -lfpc-qt.dll: No such file or directory
E:\FPCdeluxe\cross\bin\x86_64-linux\x86_64-linux-gnu-ld.exe: cannot find -lfpc-qt: No such file or directory
fpcqt.dpr(36,1) Error: Error while linking
fpcqt.dpr(36,1) Fatal: There were 1 errors compiling module, stopping
Fatal: Compilation aborted
E:\lazarus\fpc\3.2.2\bin\x86_64-win64\make.exe: *** [linux] Error 1
Frage: wo kommte dieses -lfpc-qt.dll und -lfpc-qt her ?

Ziel: erstellen eines Programms in 64-Bit für Linux mittels Cross-Compiler FPC 3.2.2
Frag doch einfach
Alles was nicht programmiert werden kann, wird gelötet
  Mit Zitat antworten Zitat