YSI-Includes
YSI-Includes copied to clipboard
cannot read from file: "YSI_Data\y_iterate" on linux
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/[email protected]"
],
"build": {
"name": "",
"args": [
"-d3",
"-;+",
"-(+",
"-Z-",
"-i../include"
]
}
}
Change to
#include <YSI-Data\y_iterate>
Then I get cannot read from file: "YSI-Data\y_iterate"
.
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.
I created repository in which I reproduced this error: https://github.com/Mrucznik/samp-ysi-bug https://travis-ci.com/Mrucznik/samp-ysi-bug
When I replace compiler flag -Z- to -Z+ it compiling without errors. But I need -Z-
"pawn-lang/[email protected]"
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.
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.
@Mrucznik
Hey, sorry for pinging. But could you solve the problem? I need -Z-
too.
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-
?
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.