trying to make new cards but can't "build" with camelbox...
Posted: 15 Jan 2015, 12:25
Hiho, I decided to try and add some new cards to manalink. The text editing seems to work properly, though tedious, but when I decided to move on to coding I can't even really get started. Basically, build.pl never seems to create the manalink dll. I get an error 1 at the "make" command.
-I've been following this tutorial: http://www.slightlymagic.net/wiki/Codin ... C_Tutorial
-I got the manalink off of http://pierre.gonnetan.free.fr/ because I had problems downloading it elsewhere.
-Camelbox from http://www.softpedia.com/progDownload/C ... 05269.html
This is my build file, in case there's something wrong with it
Thanks,
Freddan
-I've been following this tutorial: http://www.slightlymagic.net/wiki/Codin ... C_Tutorial
-I got the manalink off of http://pierre.gonnetan.free.fr/ because I had problems downloading it elsewhere.
-Camelbox from http://www.softpedia.com/progDownload/C ... 05269.html
This is my build file, in case there's something wrong with it
- Code: Select all
use strict;
use warnings;
use File::Copy;
# Open ManalinkEh.asm and add in the new card / function
my $new_function = $ARGV[0];
if( $new_function ){
my $skip = 0;
$new_function = "_card_$new_function";
my $extern = 0;
my $jmp = 0;
my $hex;
open my $fh, '<', 'ManalinkEh.asm';
my @lines;
while( my $line = <$fh>){
if( $line =~ $new_function and not $skip ){
print "You already added that card.\n";
$skip = 1;
}
if( $line =~ /extern/ ){ $extern = 1; }
if( $extern and $line !~ /extern/ and not $skip){
push @lines, "extern $new_function\n";
$extern = 0;
}
if( $line =~ /jmp near/ ){
$jmp = 1;
($hex) = $line =~ /;\s+([A-Z0-9]+)/i;
}
if( $jmp and $line !~ /jmp near/ and not $skip){
my $a = eval( "0x$hex" ) + 5;
my $new_hex = sprintf "%x", $a;
push @lines, " jmp near $new_function ; $new_hex\n";
$jmp = 0;
print "Adding $new_function at $new_hex\n";
}
push @lines, $line;
}
close $fh;
# Re-write the file
open $fh, '>', 'ManalinkEh.asm';
print { $fh } @lines;
close $fh;
}
# Run make
`make`;
# Copy the new dll to the magic directory
copy('ManalinkEh.dll','D:\skrivbord\magic\ManalinkEh.dll') or die "Copy failed: $!";
#clean up
`make clean`;
If I remove alliances.c, I get the same error for the next one. And it's the first file in the cards directory so it doesn't appear to do anything. I'm guessing my perl-thingy is not correctly installed? Is anyone able to give me a hand?C:\camelbox\bin>perl build.pl
In file included from cards/alliances.c:1:
./manalink.h:2886: warning: declaration of 'target_player' shadows a global declaration
./manalink.h:2030: warning: shadowed declaration is here
make: *** [cards/alliances.o] Error 1
Copy failed: No such file or directory at build.pl line 51.
Thanks,
Freddan