Jump to content
IGNORED

Programming in "C" on Windows XP


Recommended Posts

I reproduced the steps I last took to get a Jag compiler set up and confirmed I can "make" the hello example.

This is the output I got when attempting to run make from the example1 folder:

C:\jaguar\example1>make
WARNING:  missing nmake.err; displaying error numbers without messages.



    ..\bin\vlink.exe -o example1.rom  -b rawbin2  -s -S -x -X -T..\cfg\cart.
link ..\jlibc\src\crt0.o -L..\lib -lvbcc -L..\jlibc\src -ljlibc -L..\rmv\src -lr
mv data.o  example1.o
Fatal error 8: Cannot open "..\jlibc\src\crt0.o": No such file or directory.
Aborting.
NMAKE :  U1077:
Stop.

I double checked the C:\jaguar\jlibc\src directory and, although a crt0.s file existed there was no crt0.o or any other file that had the extension .o

 

Any clues?

Link to comment
Share on other sites

Did you build jlibc and the rmv libraries before trying to build the example?

*cough* With that extra step it compiled. Jagulator choked on the resulting ROM but that's another battle!

 

I'd give Virtual Jaguar a whirl, it's some shiny magic in an .exe :)

 

Nice work GroovyBee!

  • Like 4
Link to comment
Share on other sites

Hey, theloon, when does RobotFindKitten? :)

 

When I figure out how to use the sprintf command? I didn't manage to get that ROM to run on an emulator. No flash cart for my jag either. My next step is to repeat GroovyBees instructions on a clean PC. Try again with all the Jag emulators I can muster. The two points of failure I can think of is that either the example doesn't run on the current bunch of emulators or I messed up the compilation somehow.

 

Thanks for the reminder!

 

P.S. Before proper documentation, are the header files considered to be the way to learn a command or function? I checked out the DOCs folder in jlibc but it doesn't seem very verbose.

Edited by theloon
  • Like 1
Link to comment
Share on other sites

I didn't manage to get that ROM to run on an emulator.

 

Quick tip: When using VJ, use JiFFI set to ROM and save as ROM - that will pad the file to the correct size & VJ will be much happier.

Edited by sh3-rg
Link to comment
Share on other sites

I use Project Tempest for most testing because it doesnt need files padding to a certain size. If I do much more jag development I'll make a command line tool that does the padding out and it'll be called as part of the build process. Then I'll move over to VJ full time.

 

@theloon: The best way to learn "C" is from books and not on the jag ;). Trying to learn the language and the machine at the same time is a sure fire way of killing the passion for your project in my opinion. When you dont have a good way to debug your code its hard going. I'd also recommend joining the jagware forums. Plenty of coders hang out there.

  • Like 2
Link to comment
Share on other sites

If you can get it to build a .COF/.ABS file, then they don't need any padding for VJ. JiFFI can convert to either of these formats for you.

 

Of course, but the guy said he couldn't get the ROM to work, so... ;-)

Link to comment
Share on other sites

 

@theloon: The best way to learn "C" is from books and not on the jag ;). Trying to learn the language and the machine at the same time is a sure fire way of killing the passion for your project in my opinion. When you dont have a good way to debug your code its hard going. I'd also recommend joining the jagware forums. Plenty of coders hang out there.

 

What book would you recommend?

Link to comment
Share on other sites

I learnt "C" a long time ago so I can't recommend a good book to start from. Any book that starts with the language keywords and syntax before moving onto library functions would be a good place to start. Books on embedded programming techniques or 68000 assembly language would also be good. If you don't know any other computer languages then find a local 2nd hand book store and see what they have available.

 

Link to comment
Share on other sites

I have always found the "Sam's teach yourself in 21 days" books very very good. They do shorter ones, but I would stick to the 24 day based ones. I have these for a bunch of languages (including C) and found them excellent.

 

This is the one I have http://www.amazon.co.uk/Sams-Teach-Yourself-21-Days/dp/0672324482/ref=sr_1_1?ie=UTF8&qid=1341915462&sr=8-1

Link to comment
Share on other sites

The C Programming Language? It's the one I used.

http://www.amazon.co...41915911&sr=8-1

 

That one is from the masters K&R themselves. It is very good but not the easiest to read.

 

The O'Reilly's in a nutshell series is excellent too:

C in a Nutshell

 

Robert

 

I think we all started with that one (K&R). I also had Microsoft Code Complete:

http://www.microsoft...22&locale=en-us

 

It's not a C book but it helps in any language. If only Microsoft followed their own advice :P

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.
Note: Your post will require moderator approval before it will be visible.

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...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...