Pages: [1]
  Print  
Author Topic: string and ini_read_string not implemented, or is it just LateralGM?  (Read 843 times)
Offline (Unknown gender) tildearrow
Posted on: May 08, 2016, 10:48:21 PM
Member
Joined: May 2016
Posts: 2

View Profile
Hey there. I've been searching for some stuff, until I saw a screenshot of LateralGM, and learned about this software.
I've been using it recently, mostly to convert my GM:S projects (and also to get rid of GameMaker: Studio and all its restrictions).

But I got into a major issue.

For some reason, I can't use ini_read_string:
Code: [Select]
Unknown function or script `ini_read_string'
nor at least string:
Code: [Select]
Unknown function or script `toString'
I wonder if this is a bug in LateralGM, or if they really aren't implemented.

Steps to Reproduce:
  • Open LateralGM.
  • Add an object, and insert a=string(1); in the code.
  • Add a room, and put that object.
  • Try to run the game.

What can I do in this case?
(yes, I'm using latest enigma and LateralGM)
(yes, I'm using latest openjdk (sorry):
Code: [Select]
openjdk version "1.8.0_92"
OpenJDK Runtime Environment (build 1.8.0_92-b14)
OpenJDK 64-Bit Server VM (build 25.92-b14, mixed mode)
)
(btw, Linux linux 4.1.15-rt17-1-rt-fixedtimers #1 SMP PREEMPT RT Sat Jan 16 01:14:52 GMT+5 2016 x86_64 GNU/Linux)
Logged
Offline (Male) Goombert
Reply #1 Posted on: May 09, 2016, 01:45:20 AM

Contributor
Location: Cappuccino, CA
Joined: Jan 2013
Posts: 3060

View Profile
Actually, "insert a=string(1);" in the create event of an object does work, I just tested on Windows 10. You have a bigger problem going on. Is this the first time you've used ENIGMA in a while? Did you use it on a different PC before? Also, we do not support OpenJDK because it has terrible issues with running Swing (LateralGM) applications. I would recommend installing the Oracle JDK.
Logged
Offline (Male) Garo
Reply #2 Posted on: May 09, 2016, 11:23:07 AM

Member
Location: Szczecin, Poland
Joined: Sep 2014
Posts: 22

View Profile
I get the same issue on Linux with the latest master branch.
Logged
Offline (Male) Josh @ Dreamland
Reply #3 Posted on: May 09, 2016, 06:14:43 PM

Prince of all Goldfish
Developer
Location: Ohio, United States
Joined: Feb 2008
Posts: 2946

View Profile Email
I'm sorry; I see the same problem on my Arch Linux install. I can only guess what's causing it, as the only error reported is a lack of support (by JDI) for C++11.

You can work around the issue temporarily by placing this at the top of SHELLmain.cpp:

Code: (C++) [Select]
#ifndef JUST_DEFINE_IT_RUN
  #include <string>
#else
  #define _GLIBCXX_STRING 1
  template<typename T, typename traits = int> class basic_string {};
  typedef basic_string<char> string;
#endif

That's really ugly, and I always hoped no one would ever have to do that, but I can't tell why this is failing, and a proper fix seems far off.
Logged
"That is the single most cryptic piece of code I have ever seen." -Master PobbleWobble
"I disapprove of what you say, but I will defend to the death your right to say it." -Evelyn Beatrice Hall, Friends of Voltaire
Offline (Unknown gender) tildearrow
Reply #4 Posted on: May 09, 2016, 11:11:23 PM
Member
Joined: May 2016
Posts: 2

View Profile
I'm sorry; I see the same problem on my Arch Linux install. I can only guess what's causing it, as the only error reported is a lack of support (by JDI) for C++11.

You can work around the issue temporarily by placing this at the top of SHELLmain.cpp:

Code: (C++) [Select]
#ifndef JUST_DEFINE_IT_RUN
  #include <string>
#else
  #define _GLIBCXX_STRING 1
  template<typename T, typename traits = int> class basic_string {};
  typedef basic_string<char> string;
#endif

That's really ugly, and I always hoped no one would ever have to do that, but I can't tell why this is failing, and a proper fix seems far off.

Thank you for helping. Now everything works alright.
Logged
Offline (Unknown gender) TheExDeus
Reply #5 Posted on: May 10, 2016, 01:16:34 AM

Developer
Joined: Apr 2008
Posts: 1914

View Profile
Lack of C++11? Which versions of gcc you guys are having? Please "gcc -v".
Logged
Offline (Male) Garo
Reply #6 Posted on: May 10, 2016, 04:40:34 AM

Member
Location: Szczecin, Poland
Joined: Sep 2014
Posts: 22

View Profile
gcc version 5.3.1 20160413 (Ubuntu 5.3.1-14ubuntu2)

I believe the C++11 standard was complete since 4.8.1, right?
Logged
Offline (Male) Goombert
Reply #7 Posted on: May 10, 2016, 06:49:24 AM

Contributor
Location: Cappuccino, CA
Joined: Jan 2013
Posts: 3060

View Profile
Yes but the problem is that they might have changed something in some standard header. Josh wrote JDI which parses the code and then feeds it to gcc to compile as C++, so JDI makes GCC a little more like Clang/LLVM. Part of the reason Clang/LLVM is becoming more popular is that it gives you more access to the compiler's internals. Anyway, JDI never got very good template support, because Josh is very busy much of the time. What might have happened to cause this is that somebody maintaining <string> in GCC could have changed something that made JDI unable to parse it, so it ended up ignoring the rest of SHELLmain.cpp and thus why nothing else can be found.
« Last Edit: May 10, 2016, 07:04:31 AM by Robert B Colton » Logged
Offline (Male) Josh @ Dreamland
Reply #8 Posted on: May 10, 2016, 06:19:23 PM

Prince of all Goldfish
Developer
Location: Ohio, United States
Joined: Feb 2008
Posts: 2946

View Profile Email
What Robert is trying to say is that contained within ENIGMA's compiler is the parser part of a C++ compiler, which I called "Just Define It" (JDI). For ENIGMA's syntax checking and EDL parsing to work, JDI has to be able to read the engine file, as a C++ compiler would. While I coded in some support for C++11 when I wrote JDI, the specification was new at the time, and I didn't feel like meddling in it. So even though JDI has some C++11 features, I believe it's missing enough of them that I never told it to advertise support for the specification—it sets __cplusplus to reflect support only for like C++98/03.

This has never been a problem, because (A) all the STL headers are SUPPOSED to compile under C++98, and (B) the features of C++11 that you enjoy (and are using in ENIGMA) are blindingly easy to support in compilers, so I supported them. This was somewhat perforce, as GNU C++ has supported the bulk of these features since the dawn of time. That said, harder constructs, such as variadic template parameters, are missing from JDI, and I have no intentions of adding them. If you use them in ENIGMA's engine, this will create problems for the current compiler.

Since C++98 is still a thing, I don't know why JDI has suddenly been rendered incapable of parsing <string> correctly. I also don't know why it's printing only one error... did someone suppress the rest of them? I can't make a diagnosis without them. Still, I suspect it doesn't matter; no one actually relies on JDI knowing what string can do, as evidenced by the above working.
Logged
"That is the single most cryptic piece of code I have ever seen." -Master PobbleWobble
"I disapprove of what you say, but I will defend to the death your right to say it." -Evelyn Beatrice Hall, Friends of Voltaire
Pages: [1]
  Print