Compiling

A modern Prince of Persia 1 for SNES level editor for Windows.

Moderator: English Moderator Team

User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 2980
Joined: April 9th, 2009, 10:58 pm
Contact:

Compiling

Postby Norbert » July 1st, 2015, 1:52 pm

For fun, I just tried compiling SDLPoP on Linux using Wine and that worked (see below).
Then I was wondering if I could also compile Pr1SnesLevEd under Linux using Wine, but that didn't work (see below).

SDLPoP (Dev-C++):

I used the instructions in the doc/Readme.txt file.
Got three warnings (see below) and sound effects are echoing like crazy (dunno why), but otherwise it seems to work fine.

1280:29 Z:\home\norbert\Desktop\SDLPoP-1.14\seg009.c [Warning] multi-character character constant
1281:29 Z:\home\norbert\Desktop\SDLPoP-1.14\seg009.c [Warning] multi-character character constant
884 Z:\home\norbert\Desktop\SDLPoP-1.14\seg006.c [Warning] comparison is always false due to limited range of data type

Pr1SnesLevEd (C++Builder):

I saw version value BCB.05.03, so I tried to get C++Builder 5. Version 5 is no longer for sale, 6 is (end o/t page), but the only free trial I could find was for XE8. XE8 does not work because the .NET Framework 2.0a x64 installation fails. I could download version 6 and it installed without problems.

When compiling with version 6, it fails at...
ms_level->SetSize(sizeof(TLevel));
...which may be because version 6 has a function TMemoryStream::SetSize(const __int64). And/or it's because I'm on 64-bit?
I tried typecasting with (int), but got a "Access violation. Link terminated." error.
Then I just replaced the whole "sizeof(TLevel)" with 3940 but I got the same error.

Falcury
Wise Scribe
Wise Scribe
Posts: 294
Joined: June 25th, 2009, 10:01 pm

Re: Compiling

Postby Falcury » July 1st, 2015, 4:04 pm

Norbert wrote:1280:29 Z:\home\norbert\Desktop\SDLPoP-1.14\seg009.c [Warning] multi-character character constant
1281:29 Z:\home\norbert\Desktop\SDLPoP-1.14\seg009.c [Warning] multi-character character constant
884 Z:\home\norbert\Desktop\SDLPoP-1.14\seg006.c [Warning] comparison is always false due to limited range of data type

The first two warnings have been fixed recently. I think the third warning occurs because there is a check whether an unsigned variable has a value less than zero (which can never happen).

David
The Prince of Persia
The Prince of Persia
Posts: 1366
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: Compiling

Postby David » July 2nd, 2015, 2:39 pm

Norbert wrote:When compiling with version 6, it fails at...
ms_level->SetSize(sizeof(TLevel));
...which may be because version 6 has a function TMemoryStream::SetSize(const __int64). And/or it's because I'm on 64-bit?
I tried typecasting with (int), but got a "Access violation. Link terminated." error.
Then I just replaced the whole "sizeof(TLevel)" with 3940 but I got the same error.

Do you get the errors at compile-time or at runtime? And what is the error message?
"Link terminated" sounds like compile-time, am I right?

If an Access violation happens in the compiler, then it might be a bug in the compiler or in Wine.

User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 2980
Joined: April 9th, 2009, 10:58 pm
Contact:

Re: Compiling

Postby Norbert » July 2nd, 2015, 6:38 pm

Strangely enough the error message is sometimes different.

The error message I mentioned previously now only shows up occasionally.
The one I now get more often is:

Code: Select all

Build
  [Linker Error] Fatal: Error detected (C:\279)
  [Linker Error] Fatal: Error detected (C:\347)
  [Linker Warning] Cannot release virtual memory at addr 00000000 for 33554432 bytes (errcode 87)


The only two leads I could find were:
- Maybe Wine needs a fix? https://groups.google.com/d/msg/comp.em ... gqElblKB0J
- Maybe it's a ilink32.dll problem? http://www.delphigroups.info/3/73/18536.html

I use Wine 1.6.2. I was thinking about manually compiling and trying Wine 1.7.46, but then I'd need the 32-bit version of Wine on my 64-bit OS, which would require an lxc container or chroot or something; too much trouble, plus probably not a solution for the error anyway.

David
The Prince of Persia
The Prince of Persia
Posts: 1366
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: Compiling

Postby David » July 4th, 2015, 4:59 pm

Norbert wrote:- Maybe Wine needs a fix? https://groups.google.com/d/msg/comp.em ... gqElblKB0J

Based on that page, it seems that the linker tries to allocate memory in a way that does not work if a certain area (0x80000000) is available for allocation.


Return to “Pr1SnesLevEd”

Who is online

Users browsing this forum: Yahoo [Bot] and 1 guest