pawn-lang / YSI-Includes

Just the YSI include files, none of the extra stuff.
211 stars 106 forks source link

cannot read from file: "YSI_Data\y_iterate" on linux #372

Open Mrucznik opened 5 years ago

Mrucznik commented 5 years ago

I get this error only when I build on linux (Ubuntu 16.04.6 LTS amd64) using Travis CI. On windows everything is ok.

Error: test.pwn:2 (fatal) cannot read from file: "YSI_Data\y_iterate"

Code:

#include <a_samp>
#include <YSI_Data\y_iterate>

main()
{
    printf("Hello");
}

For compiling I use sampctl and my pawn.json looks like this:

{
    "user": "Mrucznik",
    "repo": "Mrucznik-RP-2.5",
    "entry": "gamemodes/test.pwn",
    "output": "gamemodes/test.amx",
    "dependencies": [
        "sampctl/samp-stdlib:0.3.7-R2-2-1",
        "Open-GTO/sa-mp-fixes",
        "emmet-jones/New-SA-MP-callbacks",
        "YashasSamaga/I-ZCMD",
        "NexiusTailer/Nex-AC",
        "oscar-broman/strlib",
        "samp-incognito/samp-streamer-plugin:v2.9.4",
        "zeex/samp-plugin-crashdetect:v4.19.4",
        "maddinat0r/sscanf:v2.8.3",
        "maddinat0r/samp-log:v0.4",
        "maddinat0r/samp-discord-connector:v0.2.4",
        "pawn-lang/YSI-Includes@4.x"
    ],
    "build": {
        "name": "",
        "args": [
            "-d3",
            "-;+",
            "-(+",
            "-Z-",
            "-i../include"
        ]
    }
}
rsetiawan7 commented 5 years ago

Change to

#include <YSI-Data\y_iterate>
Mrucznik commented 5 years ago

Then I get cannot read from file: "YSI-Data\y_iterate".

rsetiawan7 commented 5 years ago

It's weird. I got working on Windows, but not trying yet in Linux.

EDIT: I'm building on container Ubuntu i386 and it's working.

Mrucznik commented 5 years ago

I created repository in which I reproduced this error: https://github.com/Mrucznik/samp-ysi-bug https://travis-ci.com/Mrucznik/samp-ysi-bug

Mrucznik commented 5 years ago

When I replace compiler flag -Z- to -Z+ it compiling without errors. But I need -Z-

Crayder commented 5 years ago

"pawn-lang/YSI-Includes@4.x"

So you're using YSI 4... But if I recall correctly the new include method wasn't enforced until YSI 5. You probably just need to change YSI_Data to YSI. I'm not positive and I'd check but I'm at work on my phone.

Y-Less commented 5 years ago

4.x had those paths, they've actually been there a long time. It was only 5.x that started enforcing it. But if you fixed it already, great.

kubeeek commented 4 years ago

@Mrucznik

Hey, sorry for pinging. But could you solve the problem? I need -Z- too.

Y-Less commented 4 years ago

You can't use the old includes on Linux without compatibility mode. They were written before there was a Linux compiler, so were never designed to work on Linux. -Z+ will enable some settings to make Linux behave more like Windows - why exactly do you need -Z-?

kubeeek commented 4 years ago

You can't use the old includes on Linux without compatibility mode. They were written before there was a Linux compiler, so were never designed to work on Linux. -Z+ will enable some settings to make Linux behave more like Windows - why exactly do you need -Z-?

I may be somewhat beginner to PAWN, but I had some issues with y_hooks and file includes (like only first file in the directory is included and not the rest) - I could not understand why though. But later on, I had checked the compiler page and If I understood correctly the docs page of the compiler, when the -Z+ flag is passed, the compiler creates include guard for each file. Since I had files with the same name but in different directories, -Z- appeared as magical solution to all my problems and they were gone suddenly. But I see the point. Thanks for the explanation. Guess I will mess with file namings and such in my project as alternative solution.