compiling questions

compiling questions

Discuss the source code and development of Spring Engine in general from a technical point of view. Patches go here too.

Moderator: Moderators

Post Reply
chaime
Posts: 12
Joined: 10 Nov 2006, 20:55

compiling questions

Post by chaime »

i have a question,
i tried to modify class cglFont to make spring can display chinese charactors,
i add glut in the project and add in cglfont.h.

Code: Select all


#include "gl/glu.h"
//some glut's header
#include <windows.h>
#undef max
#undef CreateDirectory

and redefined function printstringx() to replace printstring().
i did it ,and compiled the project to spring.exe.
now i can execute sprint.exe which can display chinese charactors.
but glut32.dll will be called by spring.exe.

question is :why i cant start spring in SP or TAsclient?

is there a compliing options set?

if i can not add some new headers or dlls?

for anit cheats?

i will post the error report while SP and Tasclient launching spring.exe as soon as possible.
User avatar
lurker
Posts: 3842
Joined: 08 Jan 2007, 06:13

Re: compiling questions

Post by lurker »

There is nothing I can think of that would make it so spring.exe worked by itself, but couldn't be run by SpringSP or TASClient.
There are no special compilation options; there shouldn't be any headers or dlls to add to run it, there are no anti-cheating measures.
Jonanin
Posts: 107
Joined: 13 Jan 2008, 21:34

Re: compiling questions

Post by Jonanin »

Can you please tell us what error you are getting?

What do you mean when you say 'but glut32.dll called by spring'? Do you mean that you don't have glut32.dll?

Edit: It might be because TASclient and Spring SP you have to set a path to spring.exe so it can find it: it might not be set to the spring.exe you compiled.
Jonanin
Posts: 107
Joined: 13 Jan 2008, 21:34

Re: compiling questions

Post by Jonanin »

[6:03:33 AM] <chaosch> i got error report
[6:03:40 AM] <Jonanin> Can you tell me what it is?
[6:03:56 AM] <chaosch> Microsoft Visual C++ Runtime Library
[6:04:06 AM] <chaosch> Runtime Error!
[6:04:13 AM] <chaosch> Program: I:\games\TaSpring\Spring\spring.exe
[6:04:21 AM] <chaosch> This application has requested the Runtime to terminate it in an unusual way.
[6:04:30 AM] <chaosch> Please contact the application's support team for more information.
[6:05:23 AM] <chaosch> i can run spring.exe by execute spring.exe in the correct folder
[6:05:38 AM] <Jonanin> But not from TASClient?
[6:05:45 AM] <chaosch> yes

Ehh... Anyone know what the problem is?
sulbon
Posts: 3
Joined: 30 Dec 2005, 13:08

Re: compiling questions

Post by sulbon »

Mr chaime is having problems logging into this forum, so I will tell what I know.

He modified the spring source code of the Cglfont class to support Chinese (maybe all the unicode thing). He modified the CGlfont constructor to read in a Chinese font file instead of the English one, and rewrote all of the text rendering functions to present Chinese strings onto screen.

The problem:
He can launch spring.exe directly (say, double click on the spring.exe) without any problem.
But when he launches spring.exe through springSP or TASClient, he gets a run time error.
He uses VC8.
User avatar
Vadi
Posts: 446
Joined: 03 Jan 2008, 14:51

Re: compiling questions

Post by Vadi »

Did he try compiling with mingw?
User avatar
BrainDamage
Lobby Developer
Posts: 1164
Joined: 25 Sep 2006, 13:56

Re: compiling questions

Post by BrainDamage »

i'm wondering if his patch influenced script.txt decoding, as in such file gets written using ASCII-8 or utf-8 from lobbies to pass params to spring, if he tries to decode it using the wrong encoding, spring will fail to launch when called from a lobby, but work fine when launched stand alone
User avatar
rattle
Damned Developer
Posts: 8278
Joined: 01 Jun 2006, 13:15

Re: compiling questions

Post by rattle »

But when he launches spring.exe through springSP or TASClient, he gets a run time error.
Did he recompile unitsync as well? Dunno if that's necessary though.
chaime
Posts: 12
Joined: 10 Nov 2006, 20:55

Re: compiling questions

Post by chaime »

Jonanin wrote:[6:03:33 AM] <chaosch> i got error report
[6:03:40 AM] <Jonanin> Can you tell me what it is?
[6:03:56 AM] <chaosch> Microsoft Visual C++ Runtime Library
[6:04:06 AM] <chaosch> Runtime Error!
[6:04:13 AM] <chaosch> Program: I:\games\TaSpring\Spring\spring.exe
[6:04:21 AM] <chaosch> This application has requested the Runtime to terminate it in an unusual way.
[6:04:30 AM] <chaosch> Please contact the application's support team for more information.
[6:05:23 AM] <chaosch> i can run spring.exe by execute spring.exe in the correct folder
[6:05:38 AM] <Jonanin> But not from TASClient?
[6:05:45 AM] <chaosch> yes

Ehh... Anyone know what the problem is?
thanks Jonanin.
yes,that's the error reported.
Brain Damage wrote:i'm wondering if his patch influenced script.txt decoding, as in such file gets written using ASCII-8 or utf-8 from lobbies to pass params to spring, if he tries to decode it using the wrong encoding, spring will fail to launch when called from a lobby, but work fine when launched stand alone
I modified the class CglFont that loading ttf files and print string to screen (CglFont.printstring()),it really can influence script.txt decoding?
I search the string "script.txt" all over the project,but nothing was found,where is the code decoding script.txt?

Vadi wrote:Did he try compiling with mingw?
no i didn't
rattle wrote:
But when he launches spring.exe through springSP or TASClient, he gets a run time error.
Did he recompile unitsync as well? Dunno if that's necessary though.
no i didn't ,how to recompile unitsync?
chaime
Posts: 12
Joined: 10 Nov 2006, 20:55

Re: compiling questions

Post by chaime »

i don't know what happened.
I can post,reply,edit here using my note book,but not my PC.
maybe i should logout when i shutdown my note book.
chaime
Posts: 12
Joined: 10 Nov 2006, 20:55

Re: compiling questions

Post by chaime »

Now I have a new question:
I just compiled the Source WITHOUT any modification to spring.exe.
I can launch spring In springSP,but when I select GlobalAI test (KAIK-0.13).I got error message as below:
---------------------------
Incorrect Global AI dll version 1639, expected 2363
---------------------------
AI\Bot-libs\KAIK-0.13.dll

I am sure That dll is correct file,because it works before I replaced the origin spring.exe.

what's wrong?
User avatar
Vadi
Posts: 446
Joined: 03 Jan 2008, 14:51

Re: compiling questions

Post by Vadi »

Exactly what it says "Incorrect Global AI dll version 1639, expected 2363". The version of the AI is incorrect - it's too old.

You need to compile spring and ai's together, because as you see here, spring is expecting a newer version.
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Re: compiling questions

Post by Tobi »

Vadi wrote:Exactly what it says "Incorrect Global AI dll version 1639, expected 2363". The version of the AI is incorrect - it's too old.

You need to compile spring and ai's together, because as you see here, spring is expecting a newer version.
The AI dll version isn't really in terms of older/newer, it's a checksum that's automatically calculated from size of some important AI interface types (ie. types that break the AI interface if they change).

So it just means the spring.exe is incompatible with that AI dll, which indeed usually means they were compiled with a different compiler (remember that there's no such thing as ABI compatibility for C++ on Windows between GCC and MSVC or even different MSVC versions).

tl;dr: compile AI DLLs and spring.exe with the same compiler!
User avatar
Vadi
Posts: 446
Joined: 03 Jan 2008, 14:51

Re: compiling questions

Post by Vadi »

Which is gcc or mingw, I read.
HoneyFox
Posts: 20
Joined: 01 Aug 2007, 06:44

Re: compiling questions

Post by HoneyFox »

I'm a friend of chaime and I know the problem in details.

He tried to analyze the error and found that something goes wrong when the spring program came to deal with the win_lpCmdLine part, ie startup options.

system\main.cpp line: 470 approximately

Code: Select all

	string cmdLineStr = win_lpCmdLine;
here is where it goes wrong.
chaime use "-a" as the command line and win_lpCmdLine shows the correct context, but after cmdLineStr is given the value of win_lpCmdLine, some strange characters appear in the front of cmdLineStr and "-a" follows behind like "ultc-a".

chaime tried to use substr to clear those unknown characters but was told some errors occured when trying to change the string.
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Re: compiling questions

Post by Tobi »

Probably the unicode aware WinMain variant needs to be used, so win_lpCmdLine can be set to an unicode string?
HoneyFox
Posts: 20
Joined: 01 Aug 2007, 06:44

Re: compiling questions

Post by HoneyFox »

Anyway, chaime has solved that weird problem.
the reason is ... that font library...
he created a new font library and now the Chinese version of Spring 0.76b1 is almost completed.
widgets translating procedure is underway... :P
User avatar
rattle
Damned Developer
Posts: 8278
Joined: 01 Jun 2006, 13:15

Re: compiling questions

Post by rattle »

no i didn't ,how to recompile unitsync?
In VC++, no idea actually.

With scons (and mingw/gcc) however it's "scons spring" for spring only, "scons unitsync" for... you get the idea. The available options are in the beginning of the SConstruct file.
Post Reply

Return to “Engine”