Page 1 of 1

BricxCC for Mac OS ?

Posted: 13 Jan 2011, 16:15
by palbarede
Hello,

I am reading Hansen's book Lego Mindstorm Nxt power programming 2009 p. 6 "Versions of the BricxCC are available for Windows, Mac OS X and Linux".

However, I cannot find the Mac OS X version. Do you know where it is or is it a mistake in the book ? Thanks.

Re: BricxCC for Mac OS ?

Posted: 13 Jan 2011, 18:32
by m-goldberg
The short answer is: not yet. John Hansen is working on it, but I'm afraid he was a little too optimistic about the completion date when he wrote the book. I think he expected to have it ready by the time the book was available for sale, but it was not to be.

I write NXC program on a Mac running OS X 10.6.6 using John's NexT Tools and a code editor (TextMate in my case) and run the nbc compiler from Terminal. It's not as convenient as having BricxCC, but it gets the job done.

Re: BricxCC for Mac OS ?

Posted: 15 Jan 2011, 01:01
by nxtboyiii
How did you get the latest compiler?
Where is it?

Re: BricxCC for Mac OS ?

Posted: 15 Jan 2011, 06:11
by m-goldberg
nxtboyiii wrote:How did you get the latest compiler?
Where is it?
I'm using Next Byte Codes Compiler version 1.2 (1.2.1.r3, built Thu Jul 1 08:05:50 CDT 2010). AFAIK, it's the latest version for the Mac although somewhat behind the compiler included with BricxCC. I downloaded it from John Hansen's sourceforge page. Follow this link.

So far, although I would like to have a more up-to-date release, what I have is still good enough for what I'm doing.

Re: BricxCC for Mac OS ?

Posted: 17 Jan 2011, 05:47
by nxt-ai
I personally use Xcode from the install dvd (in the optional installs folder)

Make a new project: other > external build system and then use a makefile like this:

Code: Select all

# Config
USB=-U

# Path to the NXC compiler relative to the Makefile
NXC=/Applications/mindstorms/NXT/nbc
NXTCOM=/Applications/mindstorms/NXT/nxtcom

# Options to pass to the compiler
OPTIONS=-Z2

# Change the name of the program helloworld to be whatever you want
# to name the final executable
PROGRAM=helloworld

all: $(PROGRAM).rxe 
# make's input files
$(PROGRAM).rxe: $(PROGRAM).nxc
# command to run
	$(NXC) -O=$(PROGRAM).rxe \
				$(OPTIONS) \
		        $(PROGRAM).nxc
# download instructions (used by download target)
download: $(PROGRAM).rxe
	$(NXTCOM) $(USB) $(PROGRAM).rxe

# clean build products
clean:
	/bin/rm -vf $(PROGRAM).rxe
learned it from: http://www.mastincrosbie.com/Marks_LEGO ... _10.5.html

Instead of spending time rewriting BricxCC why not just make an Xcode extension?
-http://xcodeplugins.sourceforge.net/
-http://code.google.com/p/xcode-plugin/

Re: BricxCC for Mac OS ?

Posted: 18 Jan 2011, 01:33
by afanofosc
I will look into the xcode plugin route since the editor component that I use (synedit) is causing me grief on Mac OSX.

John Hansen

Re: BricxCC for Mac OS ?

Posted: 30 Jan 2011, 19:51
by palbarede
Hello,

I have tried

http://www.mastincrosbie.com/Marks_LEGO ... _10.5.html

However, as I have nbc installed (Unix style) in /usr/local/nbc,
I needed to modify the makefile as follows :

Code: Select all

# Config
USB=-U

# Path to the NXC compiler relative to the Makefile
NXC=/usr/local/nbc/bin/nbc
NXTCOM=/usr/local/nbc/bin/nxtcom

# Options to pass to the compiler
OPTIONS=-Z2

# Change the name of the program helloworld.rxe to be whatever you want
# to name the final executable
PROGRAM=helloworld

all: $(PROGRAM).rxe download

$(PROGRAM).rxe: ./source/$(PROGRAM).nxc ./Makefile
	$(NXC) -O=./build/$(PROGRAM).rxe \
				$(OPTIONS) \
		        ./source/$(PROGRAM).nxc

download: ./build/$(PROGRAM).rxe
	$(NXTCOM) $(USB) ./build/$(PROGRAM).rxe
	
clean:
	/bin/rm -vf ./build/$(PROGRAM).rxe
		   
and select Absolute path in Xcode Info.

The "Build and Run" button is greyed out, but Build (in the Build menu) works, provided the NXT is connected and no program is running.

The program can be run or killed remotely on the NXT with NeXT tools, NXT explorer, select the program and run, not very practical indeed.

In conclusion, basically, Xcode works and is likely to please most Mac users but an Xcode plugin to emulate the BricxCC would be even better.

Re: BricxCC for Mac OS ?

Posted: 31 Jan 2011, 04:07
by dsjove
afanofosc wrote:I will look into the xcode plugin route since the editor component that I use (synedit) is causing me grief on Mac OSX.

John Hansen
That will rock! If you want a hand with any part of that effort let me know.