#130893 - The_Perfection - Sat Jun 09, 2007 1:49 am
I've stubled across a problem while trying to make a function to display 3D objects. While I think that the context of the function has nothing to do with the problem, I am still having difficulties getting it to work. I'll try to post the minimal code.
In main.cpp:
In Sphere_001.h:
In Sphere_001.c:
The code compiles, it's at the linking step that things get messed up. I don't understand why; the proper files are included and I've tried everything I could think of to make the function visible and it still wont show up. If I brute force display the triangles it works fine meaning the symbols in the file are recognized by the main file, but not the function. Why?
In main.cpp:
Code: |
#include <nds.h>
#include <stdio.h> #include "Sphere_001.h" // The rest of setting up the hardware // The main game loop int DrawGLScene() { glColor(RGB5(25, 25, 25)); // Problematic line of code displaySphere_001(); glEnd(); return TRUE; } |
In Sphere_001.h:
Code: |
extern const float Sphere_001Points[12][3];
extern const unsigned short Sphere_001Triangles[20][3]; extern void displaySphere_001(void); |
In Sphere_001.c:
Code: |
#include <nds.h>
#include "Sphere_001.h" const float Sphere_001Points[12][3] = { // Point Data }; const unsigned short Sphere_001Triangles[20][3] = { // Triangle Data }; void displaySphere_001(void) { // Function Internals } |
The code compiles, it's at the linking step that things get messed up. I don't understand why; the proper files are included and I've tried everything I could think of to make the function visible and it still wont show up. If I brute force display the triangles it works fine meaning the symbols in the file are recognized by the main file, but not the function. Why?