Jump to content

sdcc_skeleton compile errors...


JMS
 Share

Recommended Posts

so i was getting ready to try and start making some kinda app... i figured the best place to start would be to get this to compile on my box first.  along the way i ran into two errors when i run make in a clean copy of the sdcc_skeleton from svn.

1. the easy one...

/home/l/midibox/svn/mios/trunk/bin/mios-gpasm: 24: declare: not found

/home/l/midibox/svn/mios/trunk/bin/mios-gpasm: 27: declare: not found

i fixed these 2 errors by changing "declare -a" to "local" on both lines in the mios-gpasm script and saving the file.

---apparently this error is caused by the ubuntu team switching the default shell between 6.06 and 8.04 from sh to dash according to what i read here: https://wiki.kubuntu.org/DashAsBinSh

2. here is where i got stuck:

sh /home/l/midibox/svn/mios/trunk/bin/mios-gpasm -c -p p18f452 -I./src -I /home/l/midibox/svn/mios/trunk/include/asm -I /home/l/midibox/svn/mios/trunk/include/share -I /home/l/midibox/svn/mios/trunk/modules/debug_msg -I /home/l/midibox/svn/mios/trunk/modules/app_lcd/dummy -DDEBUG_MODE=0  -DSTACK_HEAD=0x37f -DSTACK_IRQ_HEAD=0x33f -I /home/l/midibox/svn/mios/trunk/modules/mios_wrapper /home/l/midibox/svn/mios/trunk/modules/mios_wrapper/mios_wrapper.asm  -o _output/mios_wrapper.o

/home/l/midibox/svn/mios/trunk/bin/mios-gpasm: 37: Syntax error: "(" unexpected (expecting "fi")

so i'm sorta new to programming.. does anyone have any ideas on what would fix this in the mios-gpasm script?  obviously i know it's a syntax error in the code on line 37, but, i don't know what the correct syntax is YET.. i will search on!

in the meantime... does anyone have any ideas on what would fix this in the mios-gpasm script?

Link to comment
Share on other sites

along the way i ran into two errors when i run make in a clean copy of the sdcc_skeleton from svn

I suppose you first made a clean checkout of the whole mios-repository?

did you define your environment variables properly? in my kubuntu system:

MIOS_PATH="/home/this/mios/trunk"
MIOS_BIN_PATH="/home/this/mios/trunk/bin"
MIOS_SHELL="/bin/bash"

I added those lines in "/etc/environment" to have them set at startup automatically. You should not have to modify mios-gpasm at all, this looks like some basic missconfiguration to me.

If you have your toolchain set up properly (sdcc / gputils), and the environment variables above, try "make" in the sdcc skelleton folder. If this fails, there's something wrong.

If this works, copy "main.c" "Makefile" "README.txt" from the sdcc skelleton folder to a new folder (without .svn dir!) and start coding :-)

Link to comment
Share on other sites

That was very creative but there is an easier way:

edit ~/.profile

add these lines: (edit the paths to match yours, this is just a paste of my temporary setup)

export MIOS_PATH=~/_mios/mios/trunk
export MIOS_BIN_PATH=$MIOS_PATH/bin

export MIOS_SHELL=/bin/bash
Save, then enter this command: (makes your changes take effect immediately0
. ./.profile

Link to comment
Share on other sites

I suppose you first made a clean checkout of the whole mios-repository?

yes, did this as a first step...

did you define your environment variables properly? in my kubuntu system:

MIOS_SHELL="/bin/bash"

DOH!  this is one would have prevented me needing to change the "declare -a" to "local", i bet...

with stryd's help in chat the other day, i discovered what was missing... it was my PATH variables.  i did set the MIOSPATH and MIOS_BIN_PATH up in my /etc/environment file.  i must have missed the SHELL variable in my excitement of learning to program these pic thingys.

(on a side note... the ubuntu build environment howto has "and now we need to set up our environment variables..." and then nothing  after searching through the wiki and the forums i didn't find a list of everything that needs to be set with PATH=. maybe i overlooked something)

If this works, copy "main.c" "Makefile" "README.txt" from the sdcc skelleton folder to a new folder (without .svn dir!) and start coding :-)

will give it a go with a clean copy of mios-gpasm, after i set up the rest of my PATH (MIOS_SHELL="/bin/bash").

thanks for the input!

Link to comment
Share on other sites

ehh.. ok fixed... i finally tried to recompile and it's all well after setting ALL the correct environment variables... in /etc/environment.  (i swear i read about 30 forum posts and wiki pages looking for them.. :D )

thanks again!

Link to comment
Share on other sites

with stryd's help in chat the other day, i discovered what was missing... it was my PATH variables.  i did set the MIOSPATH and MIOS_BIN_PATH up in my /etc/environment file.  i must have missed the SHELL variable in my excitement of learning to program these pic thingys.

Errr... Guilty. I forgot that you were on ubuntu, and didn't tell you about the MIOS_SHELL var. I did grab you the next day and tell you though! There was a lot of traffic I guess you missed it. Sorry man!

the ubuntu build environment howto

There's a howto now? LOL I had no idea!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...