Problem with running Warzone compiled in VS2010

For code related discussions and questions
Post Reply
Reg312
Regular
Regular
Posts: 681
Joined: 25 Mar 2011, 18:36

Problem with running Warzone compiled in VS2010

Post by Reg312 »

Hello
I'm using VS2010 for compiling warzone for my debug experiments
Source file stats.cpp was changes in latest commints in master-version (converting stats to ini)
since this changes i cannot run warzone, getting memory errors!

Also i found way to fix this memory erros
i just need add strdup() calls to places where QT string get converted to c-string
e.g.
weaponName =ini.value("turret").toString().toUtf8().constData();
weaponName = strdup(ini.value("turret").toString().toUtf8().constData());

after this changes i can run warzone.

Also i got problem with nonexistent file e3demo.cpp (just removed it from list of files and warzone got compiled)
User avatar
aubergine
Professional
Professional
Posts: 3459
Joined: 10 Oct 2010, 00:58
Contact:

Re: Problem with running Warzone compiled in VS2010

Post by aubergine »

The E3 demo was removed recently according to this: viewtopic.php?f=3&t=10252
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3780
Joined: 03 Aug 2006, 19:39

Re: Problem with running Warzone compiled in VS2010

Post by Per »

Reg312 wrote:i just need add strdup() calls to places where QT string get converted to c-string
e.g.
weaponName =ini.value("turret").toString().toUtf8().constData();
weaponName = strdup(ini.value("turret").toString().toUtf8().constData());
Please file a bug ticket.
Reg312
Regular
Regular
Posts: 681
Joined: 25 Mar 2011, 18:36

Re: Problem with running Warzone compiled in VS2010

Post by Reg312 »

Per wrote:
Reg312 wrote:i just need add strdup() calls to places where QT string get converted to c-string
e.g.
weaponName =ini.value("turret").toString().toUtf8().constData();
weaponName = strdup(ini.value("turret").toString().toUtf8().constData());
Please file a bug ticket.

if i understood correct - here is ticket #3821
User avatar
vexed
Inactive
Inactive
Posts: 2538
Joined: 27 Jul 2010, 02:07

Re: Problem with running Warzone compiled in VS2010

Post by vexed »

"FEFEFEFE"

This is *not* a problem with VS2010.
This is a problem with that commit, and also a problem that people don't use a sane debug CRT to find these ugly bugs.

Reg312, your solution leaks memory.
I'll do a fix shortly.

Oh, and I guess I'll push the fix for the e3 removal sooner or later. :stressed:
/facepalm ...Grinch stole Warzone🙈🙉🙊 contra principia negantem non est disputandum
Super busy, don't expect a timely reply back.
Post Reply