How to compile CLIVAN challenge

The Cathedral of Attnam > Other Coding

#1 Oct 1, 2013, 11:53 am Hide


Here are some instructions on how to compile for example, Continuation of Lampshade's Iter Vehemens ad Necem.

You will need:
MinGW 3.4.2
CLIVAN source
Programmer's Notepad

Try with a later version of MinGW to see if it works. It probably won't, so don't try this.
Once you have installed all three, open Programmer's Notepad, open Tools->Options. On the left is a menu, click on Tools.
Add the following as per the screenshots in the attachment.

Press F9...

Let me know how you get on. Get stuck? Maybe I can help...
#2 Mar 12, 2014, 5:57 pm Hide


I've been trying to compile the source from Github as per these settings, but it only results in a slew of compiler errors (as seen in the attached .txt).

MinGW (at least v3.4.2) doesn't seem to actually include mingw32-make.exe, which I had to find elsewhere; this could likely cause problems.
Attached files
ierr.txt (0)
#3 Mar 12, 2014, 6:36 pm Hide


That's strange. So you got a MinGW 3.4.2 with no mingw32-make.exe?
Compiling is tricky, but to make progress you just work through the errors until they go away.
For starters, from the errors it seems like the compiler can't find things like math.h or stdio.h. Maybe check whether these are in the file because they're part of the standard library. See if you can get that machinery going and then see what errors come up next.
#4 Mar 12, 2014, 6:54 pm Hide


Alright, for some reason that download of MinGW was wonky; I fixed that up (with a newer version however; where did you get the 3.4.2 you use?), and after grabbing SDL, I get this:
Compiling IVAN.exe...
/mingw/lib/libmingwex.a(pformat.o):pformat.c:(.text+0x3f4): undefined reference to `__chkstk_ms'
/mingw/lib/libmingwex.a(pformat.o):pformat.c:(.text+0x66f): undefined reference to `__chkstk_ms'
/mingw/lib/libmingwex.a(pformat.o):pformat.c:(.text+0xa94): undefined reference to `__chkstk_ms'
/mingw/lib/libmingwex.a(pformat.o):pformat.c:(.text+0x13df): undefined reference to `__chkstk_ms'
\mingw\lib\gcc\mingw32\3.4.2\..\..\..\..\mingw32\bin\ld.exe: /mingw/lib/libmingwex.a(pformat.o): bad reloc address 0x34 in section `.rdata'
\mingw\lib\gcc\mingw32\3.4.2\..\..\..\..\mingw32\bin\ld.exe: final link failed: Invalid operation
collect2: ld returned 1 exit status
C:\MinGW\bin\mingw32-make.exe: *** [IVAN.exe] Error 1
#5 Mar 12, 2014, 7:11 pm Hide


Curiouser and curiouser.
Is it related to: this discussion item on stackoverflow?

>gcc -v
in the command line.

Keep perservering, we're almost there. It's probably something getting mucked up with library versions or something.
#6 Mar 12, 2014, 8:22 pm Hide


I reinstalled MinGW (4.8.1) and removed old versions, now I get an error here:

C:\ivan\FeLib/Include/save.h:395:19: note:   template argument deduction/substitution failed:
C:\ivan\FeLib/Include/save.h:262:14: note:   mismatched types 'fearray<type>' and 'long long int'
     SaveFile >> Vector[c];

C:\ivan\ivanmgw.mak:27: recipe for target 'C:\ivan\FeLib/Source/hscore.o' failed

mingw32-make: *** [C:\ivan\FeLib/Source/hscore.o] Error 1
#7 Mar 12, 2014, 10:11 pm Hide


It looks as if it is starting to compile. Is the compiler building object files?
The error is a plain old bug. It looks complicated because fearray belongs to FeLib, which the devs wrote. They basically created a bevy of new data types to accomodate what they wanted to achieve. I don't know whether they wrote this concurrently with IVAN or before. I think newer compilers have a problem with that situation.

Maybe fiddle around with the warning levels on the compiler. Is it a warning or a downright error? Probably won't tell us anything new.

I have a grave fear that we may need to use an antiquated compiler...

Here's the link to the old forum on how to compile.
#8 Mar 12, 2014, 11:30 pm Hide


Thanks, I'll take a look at it tomorrow and report back on my progress.

UPDATE: I attached a .txt with the problematic area again. It seems to be having some trouble with the << and >> operators in this section of FeLib\Include\save.h

template <class type>
inline outputfile& operator<<(outputfile& SaveFile,
			      const std::vector<type>& Vector)
  SaveFile << ulong(Vector.size());

  for(ulong c = 0; c < Vector.size(); ++c)
    SaveFile << Vector[c]; // error: ambiguous overload for 'operator<<' (operand types are 'outputfile' and 'const long long int')

  return SaveFile;

template <class type>
inline inputfile& operator>>(inputfile& SaveFile,
			     std::vector<type>& Vector)
  Vector.resize(ReadType<ulong>(SaveFile), type());

  for(ulong c = 0; c < Vector.size(); ++c)
    SaveFile >> Vector[c]; //error: no match for 'operator>>' (operand types are 'inputfile' and 'long long int')

  return SaveFile;
Attached files
ierr.txt (0)
#9 Mar 13, 2014, 4:13 am Hide


Have a go at rolling back the changes I made to some of the source files. Just put the semicolons back where they were. Maybe it helps maybe it doesn't.
#10 Mar 13, 2014, 3:03 pm Hide


The semicolons just give warnings, but don't seem to affect anything... I can't seem to get it compile past hscore.o
#11 Mar 16, 2014, 6:19 pm Hide


Try using an older compiler. In the link to MinGW 3.4.2, you'll need the gcc core and g++ compiler.
If you run into more problems, I could zip my distribution and send it to you, just pm me an address.
#12 Mar 16, 2014, 8:07 pm Hide


I used that link, but that gave me the initial problems. I'll pm you

EDIT: Thanks, it worked!