So I was trying to figure out how to get tilemaps working in a program for my TI-84 Plus CE. I created the tileset, and converted it using convimg. Then I made a CSV of the tilemap, and converted it with convbin. I followed the examples and docs to do what I thought would draw the tilemap, but it gave me an error on line 7 of main.c about globals. Then, I tried something else, using a .h for the tilemap instead of a .c like the example (Since I saw that in a different program) but I still seemed to get the same error.

Here's my code, if anyone could help me that would be great! Very Happy
Relevant example program: https://github.com/CE-Programming/toolchain/blob/master/examples/graphx/tilemap

Note the extern unsigned char tilemap_map[]; - the extern here means that the tilemap data was compiled in another file. (tilemap.c). Never put variables in header files unless they are declared extern like this - see the Coding Guidelines here for more information.
I changed it to match closer to what is in the example, but I'm still getting the error. Here's what it says:


Code:
[compiling] src\gfx\global_palette.c
[compiling] src\gfx\tileset.c
[convimg] icon.png
[linking] bin\NONAME.bin
C:\CEdev\meta\ld.alm [1488] macro ? [1235] :read? [7] C:\\CEdev\\lib\\shared\\crt0.src [531]:
        extern _main
extern? [12] (CALM)
Error: symbol ':globals._main' is undefined or out of scope.
make: *** [bin/NONAME.bin] Error 2
Is your main file not actually in your src folder, like it is in the repository? Only .c files in the src/ directory actually get compiled, so if your main function is outside of there the linker has no idea that it exists.
Alright, it looks like everything was all in the wrong places. Thanks, and sorry for my stupidity! Razz
  
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
Page 1 of 1
» 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