pawn-lang / compiler

Pawn compiler for SA-MP with bug fixes and new features - runs on Windows, Linux, macOS
Other
301 stars 71 forks source link

Constant "Run time error 19: "File or function is not found"" error #721

Open tmob03 opened 1 year ago

tmob03 commented 1 year ago

Issue description:

Constantly getting the Run time error 19: "File or function is not found" error on many standard library functions. Functions like print() work but things like gettime() don't.

Dockerfile:

FROM ubuntu:bionic AS compiler-build

RUN apt-get update && \
    apt-get install -y gcc \
                       gcc-multilib \
                       make \
                       cmake \
                       git \
                       python3.8

WORKDIR /home
RUN git clone https://github.com/Zeex/pawn.git pawn
RUN mkdir build && \
    cd build && \
    cmake ../pawn/source/compiler \
    -DCMAKE_C_FLAGS=-m32 \
    -DCMAKE_BUILD_TYPE=Release && \
    make
WORKDIR /home/build
RUN cd /home/build && \
    chmod +x pawncc libpawnc.so pawnruns

COPY ["test.pawn", "run.sh", "."]
ENTRYPOINT ["./run.sh"]

run.sh:

#!/bin/bash
./pawncc test.pawn -O2 -i/home/pawn/include

./pawnruns test.amx

Minimal complete verifiable example (MCVE):

#include <time>
#include <console>

main()
{
    new hours, minutes, seconds,timestamp;
    timestamp = gettime(hours, minutes, seconds);
    printf("Seconds since midnight 1st January 1970: %d", timestamp);
}

Workspace Information: