Compile on Linux
#1

Hi,

I've written a simple CI-Server (Continuous Integration Server) for my SAMP-Server. It's a simple shell script called via cronjob which updates the SAMP-Server folder from my SVN repository. If something got updated the script starts the Pawn compiler (pawncc). And after successful compilation it restarts the server if there are no players on it.
I'm using Debian 6 x86 as server OS. The compiler is running native without wine.

Now my problem: Sometimes the Linux compiler shows me warnings or errors which I'm not getting when I compile the script on Windows with the Windows Pawn compiler.

The compiler version of the Linux compiler is the same as the Windows compiler. Compiler options are also the same.


The biggest problem: The Linux compiler doesn't include a file if another file with the same name but in another folder is already included.
Example: I'm including "includes/irc.inc" and later in my pwn file "includes/grgserver/irc.inc"
In the first include file were the natives of the IRC plugin I'm using. The second include file contains my IRC callbacks like "IRC_OnConnect".
On Windows the Pawn compiler includes both files. On Linux only the first irc.inc is included (/includes/irc.inc).

The version of both compilers are the same (3.2.3664)... so what is the problem?
Reply
#2

Quote:
Originally Posted by ******
Посмотреть сообщение
Slice has ported the modifications to a Linux compiler.
Is it the compiler included in QuickPawn? That's the compiler I'm using on my Linux server.
If not: Where can I get it?

Quote:
Originally Posted by ******
Посмотреть сообщение
Two, you can't have two files with the same name, regardless of where they are.
Hmm... but why is that working on a Windows system?

This code can be compiled with the Windows version of the compiler:
Код:
#include <myinclude>
#include <subfolder/myinclude>
#include <subfolder/anotherinclude>
With the Linux version the code above is the same as that:
Код:
#include <myinclude>
#include <subfolder/anotherinclude>
subfolder/myinclude get's ignored...
Reply
#3

Hmm, what about using the Windows Pawn compiler using WINE on Linux?

I tried that but it stops working saying me msvcr80.dll is missing. I know I can install the MS Visual C++ Runtime Library, but how should I do that on a Linux server without any Display/X Server?
Reply
#4

But the normal slash (/) also works on Windows.

The following code is working fine on Windows:

Код:
#include <myinclude>
#include <subdir/myinclude>
It includes BOTH files.

I've compiled the Linux Pawn compiler using the sc2.c file provided by Slice in this post. Now some other errors are gone, but I still cannot include a file from another directory if a file with the same file is already included.

Why does it work on Windows but not on Linux?
Reply
#5

Quote:
Originally Posted by ******
Посмотреть сообщение
I've already said that! "/" is not the native directory separator on Windows, "\" is (you can't say "/" is the "normal" one because there's no such thing, different OSes can and do do it differently, often with limited support for alternates). Because you are doing it wrong on Windows, the compiler is working wrong on Windows and correctly on Linux. I also explained how to get it to work wrong on Linux and thus do what you want!
Right!

I replaced / with \ and now on Windows I get the same error.


But... if that is the right way, the grandlarc gamemode supplied with the server is also incorrect:

Код:
...
#include "../include/gl_common.inc"
#include "../include/gl_spawns.inc"
...
Reply
#6

Quote:
Originally Posted by ******
Посмотреть сообщение
I give up! I'm not explaining it all AGAIN!
No, I know I can not include another file with the same name.

What I want to say: The Windows compiler handles includes the wrong way if you use / as directory separator.

Now as I use \ on Windows it shows me the error, which is correct.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)