Error compiling the code... - General Discussion and Assistance - CHDK Forum  

Error compiling the code...

  • 11 Replies
  • 4638 Views
Error compiling the code...
« on: 31 / January / 2008, 04:09:26 »
Advertisements
Hey guys,

First off, thanks for all the great work...  So...

I thought I'd give it a go compiling the CHDK code the other day, but I am having trouble.  I followed the wiki instructiions and installed MinGW-5.1.3.exe (to c:\MinGW), MSYS-1.0.10.exe (to c:\MinGW\msys), gc_env_for_hdk-3.4.6.rar (to c:\CHDK\gcc) and got the sources.zip file (to c:\CHDK\src).  I also  added ";c:\chdk\gcc\bin;C:\CHDK\gcc\libexec;c:\CHDK\\gcc\libexec\gcc\arm-elf\4.1.1" to the end of my System Path variable after reading the forum.

I get the following errors...

expr: syntax error
echo "**** Build: 180"
**** Build: 180
echo "BUILD_NUMBER := 180" > version.inc
>> Entering to tools
c:\chdk\gcc\bin\gmake.exe[1]: Entering directory `c:/chdk/src/branches/grand/tools'
/usr/bin/sh: -c: line 1: syntax error near unexpected token `;'
/usr/bin/sh: -c: line 1: `for i in ; do  echo \>\> Entering to tools/$i;  c:/chdk/gcc/bin/gmake.exe -C $i FOLDER="tools/$i/" || exit 1;  echo \<\< Leaving tools/$i;  done'
c:\chdk\gcc\bin\gmake.exe[1]: *** [all-recursive] Error 258
c:\chdk\gcc\bin\gmake.exe[1]: Leaving directory `c:/chdk/src/branches/grand/tools'
c:\chdk\gcc\bin\gmake.exe: *** [all-recursive] Error 1

it appears to be failing to resolve the SUBDIRS variable in the make as the error suggests that there's nothing between the 'in' and the ';' of the 'for i in ; do' line.

Has anyone had this error, or any ideas on a fix?  I'm hoping I've just missed a step or I'm using bad versions of something.

« Last Edit: 31 / January / 2008, 04:20:21 by stevetm2 »

*

Offline GrAnd

  • ****
  • 916
  • [A610, S3IS]
    • CHDK
Re: Error compiling the code...
« Reply #1 on: 31 / January / 2008, 04:23:37 »
Looks like incorrect shell. Do not use Mingw, MSYS, Cigwin, etc. The gcc_env_for_hdk-3-4-6.rar package is enough for compiling.
http://chdk.wikia.com/wiki/Compiling_CHDK_under_Windows
CHDK Developer.

Re: Error compiling the code...
« Reply #2 on: 31 / January / 2008, 04:34:00 »
Thanks for the fast response GrAnd...  I just opened a dos shell and did the "gmake fir" command and it built many files but now finished on a final error of...

<< Leaving loader/a710
c:\chdk\gcc\bin\gmake[1]: Leaving directory `C:/CHDK/src/branches/grand/loader'
<< Leaving loader
-> a710-100a.FIR
cp ./loader/a710/main.bin .//bin/main.bin
dd if=/dev/zero bs=1k count=100 >> .//bin/main.bin 2> NUL
gmake: *** [firsub] Error 1

is this ok?  I now have a main.bin in the C:\CHDK\src\branches\grand\bin folder, is that what I copy to the SD card then?  jfyi, I changed the make to use the a710 as the platform...


*

Offline GrAnd

  • ****
  • 916
  • [A610, S3IS]
    • CHDK
Re: Error compiling the code...
« Reply #3 on: 31 / January / 2008, 04:46:14 »
is this ok?  I now have a main.bin in the C:\CHDK\src\branches\grand\bin folder, is that what I copy to the SD card then?  jfyi, I changed the make to use the a710 as the platform...
No, it's not ok. Moreover, this command "dd..." should never be executed because it's under #ifndef for defined veriable in Makefile.
CHDK Developer.


Re: Error compiling the code...
« Reply #4 on: 31 / January / 2008, 04:58:45 »
I just added "OSTYPE=Windows" to the top of the Makefile and it works now :)  It created a710-100a.FIR of 102KB and DISKBOOT.BIN of 102KB...  I'll try a rename/copy to SD...   ...Worked like a dream...

Thanks again GrAnd.. time to play :)

*

Offline GrAnd

  • ****
  • 916
  • [A610, S3IS]
    • CHDK
Re: Error compiling the code...
« Reply #5 on: 31 / January / 2008, 05:20:32 »
Hmm... It should be defined automatically. From the "dd ... " from your compile log before, you can see that null-device is defined properly (NUL). But it's strange that OSTYPE is not defined, because the definition is in the same place:
Code: [Select]
63   HOSTPLATFORM:=$(shell uname -s | head -c 5)
64   ifeq ($(HOSTPLATFORM),MINGW)
65     OSTYPE = Windows
66     EXE = .exe
67     SH = sh
68     DEVNULL = NUL
69     SORT = $(dir $(shell which uniq.exe | sed s/\\\\/\\\//g))/sort.exe
70   else

In addition this code:
Code: [Select]
23 ifndef NOZERO100K
24 ifeq ($(OSTYPE),Windows)
25         zero | dd bs=1k count=100 >> $(topdir)/bin/main.bin 2> $(DEVNULL)
26 else
27         dd if=/dev/zero bs=1k count=100 >> $(topdir)/bin/main.bin 2> $(DEVNULL)
28 endif
29 endif
should never be executed, because NOZERO100K is defined in makefile.inc.

And finally, the resulted size of these two files should be about 130KB (Allbest) without 100KB of zeros at the end of each file. Your 102KB looks like 2KB code with 100KB zeros.
CHDK Developer.

Re: Error compiling the code...
« Reply #6 on: 31 / January / 2008, 05:41:07 »
I'll have to take a look at your follow up info tomorrow night as its 2.35am right now here in the US :)  The file size difference was because I was building the source.zip that the wiki talks about.  I'm now building AllBest which is now creating files of 131KB as you suggested.  I just made a change to the code to allow the PRINT key to be used as a shift for the MF on the Zoom feature.  Now I can use zoom as usual and MF on zoom keys when holding the PRINT button :)  A nice little test.  I'll checkout the makefile again tomorrow, time for bed...  Thanks again...

*

Offline m2tk

  • **
  • 50
  • Sheet happens ...
Re: Error compiling the code...
« Reply #7 on: 18 / March / 2008, 14:57:00 »
Code: [Select]
expr: syntax error
**** Build:
>> Entering to tools
<< Leaving tools
>> Entering to lib
>> Entering to lib/font
<< Leaving lib/font
>> Entering to lib/math
<< Leaving lib/math
>> Entering to lib/ubasic
<< Leaving lib/ubasic
>> Entering to lib/lang
<< Leaving lib/lang
<< Leaving lib
>> Entering to platform
>> Entering to platform/a610
>> Entering to platform/a610/sub
>> Entering to platform/a610/sub/100e
<< Leaving platform/a610/sub/100e
<< Leaving platform/a610/sub
<< Leaving platform/a610
<< Leaving platform
>> Entering to core
gui.c -> gui.o
-> main.elf
   text    data     bss     dec     hex filename
  98064    5020   32836  135920   212f0 main.elf
main.elf -> main.bin
<< Leaving core
>> Entering to loader
>> Entering to loader/a610
>> Entering to loader/a610/resetcode
<< Leaving loader/a610/resetcode
blobs.S -> blobs.o
-> main.elf
main.elf -> main.bin
<< Leaving loader/a610
<< Leaving loader
-> a610-100e.FIR
Building FIR for camera 30FD ver 01000100
**** Firmware creation completed successfully

hi,
i've tried to compile project and found above output,
is it correct with that syntax error?
time to look at it im spare time,
last Q: where i can find any S5 branch?
regards.

nb. maybe someone can write OSD emulator?  :)
« Last Edit: 18 / March / 2008, 15:07:00 by m2tk »
S5IS 1.01bc


*

Offline GrAnd

  • ****
  • 916
  • [A610, S3IS]
    • CHDK
Re: Error compiling the code...
« Reply #8 on: 18 / March / 2008, 16:24:34 »
Did you change version.inc file?
CHDK Developer.

*

Offline m2tk

  • **
  • 50
  • Sheet happens ...
Re: Error compiling the code...
« Reply #9 on: 19 / March / 2008, 09:17:05 »
Did you change version.inc file?

shouldn't or should i?
S5IS 1.01bc

 

Related Topics