Hi.

I just got done setting up GCC and PrizmSDK on Ubuntu 11.10 according to the instructions on this page. Now, my question is, how do I get started?

I have never used C/C++ before, but I'm planning on going through a tutorial. Does anyone know of a good one?

Also, how do I compile programs with PrizmSDK?

Thanks,
flyingfisch
For C++, this is by far the best tutorial I have seen.

http://www.cplusplus.com/doc/tutorial/
Ahh... but. What should I use? C or C++? Is one better than the other?
C++ is an extension of C. So I'd say C++ because it can do everything C does and more.
Can I use C code with C++?
flyingfisch wrote:
according to the instructions on this page.
Ooh, thanks for writing that up, AHelper (and Kerm a little)!

flyingfisch wrote:
how do I compile programs with PrizmSDK?
In general, all you need to do to build things for the prizm is compile your code with GCC for SH, then link it and run mkg3a on the linker output. In practice, that requires knowing a few dark incantations to make everything work.
The toolchain directory in Jonimus' libfxcg repository includes the linker script and a sample Makefile to make everything work, so that's going to be your easiest option.

With your source code and Makefile in place (see also: the example project), just invoke make in the same directory to build.

HOMER-16 wrote:
C++ is an extension of C. So I'd say C++ because it can do everything C does and more.
I disagree, mostly because I feel that C++ tends to abstract too much out. When working on a small system like the Prizm, I much prefer to know exactly what will be going on with my code. Beyond that, anything that C++ can do, C can as well, but with a bit of careful design required.

Really, I just dislike C++. It will probably be easier to pick up C first, at any rate.
In my opinion (and dTal's), saying C++ is an extension of C is misleading. If you learn C or C++, you can certainly write the other one fairly easily, but there are fundamental differences between the two that will trip you up or at least make you write confusing and/or bad code if you're not aware of them. For the Prizm, I recommend that you learn C, so you learn a procedural approach, C-style strings, etc. One of the best things you can do is take a look at the code for already-released C programs, like the add-ins that Shaun and I have written.
Alright, so I have step 1 finished... I'm going to learn C.

Step 2: Learn C Razz

OK, Kerm said look at others code. I should probably do a tutorial too, right?

Next up, I'd like to make sure I installed everything correctly, so how do I compile PrizmSDK/Projects/EXAMPLE?
First, follow the Windows instructions in the PrizmSDK Setup Guide to create a new project folder and modify the Makefile. Then just run the 'make' command in a terminal in that directory.
There is no


Code:
...
CSOURCES=example.c
...
BIN=example.bin


in my makefile Sad

EDIT: My makefile: http://pastebin.com/MTq36uwm

EDIT2: I found a C tut ( http://www.cprogramming.com/tutorial/c/lesson1.html ). But really, could someone take a look at my makefile and tell me what to do?
The wiki is wrong there. The new makefile (what you have) automatically tries to build all the source files in the specified directory. Put the source file(s) into a 'src' directory and it should just work.
Tari wrote:
The wiki is wrong there. The new makefile (what you have) automatically tries to build all the source files in the specified directory. Put the source file(s) into a 'src' directory and it should just work.
Whoops, would you mind updating the wiki with the correct information? I continued to use my own Makefiles when I upgraded to v0.3 of the PrizmSDK.
Tari wrote:
The wiki is wrong there. The new makefile (what you have) automatically tries to build all the source files in the specified directory. Put the source file(s) into a 'src' directory and it should just work.


Thanks for that info Smile

EDIT: How do I run Make.bat in linux? It opens in leafpad (a text editor)
You don't run batch files in Linux. As I said, in Linux, you simply type the command "make" from a terminal.
I believe in Linux it's a bash file instead of batch file.
HOMER-16 wrote:
I believe in Linux it's a bash file instead of batch file.
Bash scripting or shell scripting is the general term, yes, but you don't really need a script assuming that you're working from a terminal.
I get this when I try to make: http://pastebin.com/g4RMXk1r
please note that tutorial 2 on the wiki will explain in detail how 0.3 is set up, what the files are, how to compile projects, using make, mkg3a, etc.. Tutorial 3 will start on actual code and building projects.

I will be able to do that this weekend.
So what does my error message mean?
flyingfisch wrote:
So what does my error message mean?

Code:
/usr/local/cross/lib/gcc/sh3eb-elf/4.6.2/../../../../sh3eb-elf/bin/ld: cannot find -lgcc
This means that libgcc can't be found. However, I'm not sure how to fix this; perhaps Jonimus or Tari can make a suggestion? I'd personally assume something like -I../../libs or something, but I;m not entirely positive.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
» Goto page 1, 2, 3, 4, 5, 6  Next
» View previous topic :: View next topic  
Page 1 of 6
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement