![]() |
| Forums | Gaming News | Videos | Downloads | Today's Posts | Mark Forums Read | Chat | FAQ | Members List | Contact |
| ||||||
This is a discussion on linking errors in cygwin within the PSP Development Forum forums, part of the PSP Development, Hacks, and Homebrew category; hi. im getting an annoying error in cygwin. i have 2 main files: main.cpp and main.h. here is my main.h: ...
![]() |
|
|
LinkBack | Thread Tools |
|
|
#1 |
![]() ![]() Your Fate is Grim...
|
hi. im getting an annoying error in cygwin. i have 2 main files: main.cpp and main.h. here is my main.h:
Code:
// Includes
#include <malloc.h> //For memalign()
#include <pspkernel.h>
#include <pspdisplay.h>
#include <pspctrl.h>
#include <pspdebug.h>
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <png.h>
#include <psppower.h>
#include <psptypes.h>
//**************************************************************************
// Exit callback
int exit_callback(int arg1, int arg2, void *common) {
sceKernelExitGame();
return 0;
}
// Callback thread
int CallbackThread(SceSize args, void *argp) {
int cbid;
cbid = sceKernelCreateCallback("Exit Callback", exit_callback, NULL);
sceKernelRegisterExitCallback(cbid);
sceKernelSleepThreadCB();
return 0;
}
// Sets up the callback thread and returns its thread id
int SetupCallbacks(void) {
int thid = 0;
thid = sceKernelCreateThread("update_thread", CallbackThread, 0x11, 0xFA0, 0, 0);
if(thid >= 0) {
sceKernelStartThread(thid, 0, 0);
}
return thid;
}
#include <pspgu.h>
#include <pspgum.h>
#include <psprtc.h>
#include "graphics.h"
#include "ModelMD2.h"
#define BUF_WIDTH (512)
#define SCR_WIDTH (480)
#define SCR_HEIGHT (272)
#define printf pspDebugScreenPrintf
#define MAX(X, Y) ((X) > (Y) ? (X) : (Y))
#define RGB(r, g, b) ((r)|((g)<<8)|((b)<<16))
#define PI 3.14159265
typedef struct {
unsigned int color;
float x, y, z;
} Vertex;
void InitGU( void ); // Initialize the Graphics Subsystem
void SetupProjection( void ); // Setups the Projection Matrix
void DrawScene( void ); // Render Geometry
Code:
main.cpp:(.text+0x378): undefined reference to `MD2RenderModel(_MODELMD2*)' main.o: In function `main': main.cpp:(.text+0x8a0): undefined reference to `MD2AllocateModel(int)' main.cpp:(.text+0x8bc): undefined reference to `MD2LoadModel(_MODELMD2*, char*, int)' main.cpp:(.text+0x8d8): undefined reference to `MD2LoadModel(_MODELMD2*, char*, int)' main.cpp:(.text+0x8e8): undefined reference to `MD2ChangeAnimation(_MODELMD2*, i nt, int)' collect2: ld returned 1 exit status make: *** [aso.elf] Error 1 ) so, whats wrong with my code??P.S. its not cygwin, cause 1 other person tried it and got the same results.
__________________
-------------------------------------------------------------------------------------- ![]() Last edited by Grimfate126; 09-27-2006 at 03:21 PM.. |
|
|
|
|
|
#2 | |
![]() ![]() Developer
|
Code:
extern "C" {
#include "graphics.h"
#include "ModelMD2.h"
}
__________________
![]() Check out my homebrew & C tutorials at http://insomniac.0x89.org/ Coder formerly known as Insomniac197 Quote:
|
|
|
|
|
|
|
#3 | |
![]() ![]() Your Fate is Grim...
|
Quote:
does that do in main.h? cause it still wont work. my main.h: Code:
// Includes
#include <malloc.h> //For memalign()
#include <pspkernel.h>
#include <pspdisplay.h>
#include <pspdebug.h>
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <png.h>
#include <psppower.h>
#include <psptypes.h>
#include <pspgu.h>
#include <pspgum.h>
#include <pspctrl.h>
extern "C" {
#include "graphics.h"
#include "ModelMD2.h"
}
//**************************************************************************
// Exit callback
int exit_callback(int arg1, int arg2, void *common) {
sceKernelExitGame();
return 0;
}
// Callback thread
int CallbackThread(SceSize args, void *argp) {
int cbid;
cbid = sceKernelCreateCallback("Exit Callback", exit_callback, NULL);
sceKernelRegisterExitCallback(cbid);
sceKernelSleepThreadCB();
return 0;
}
// Sets up the callback thread and returns its thread id
int SetupCallbacks(void) {
int thid = 0;
thid = sceKernelCreateThread("update_thread", CallbackThread, 0x11, 0xFA0, 0, 0);
if(thid >= 0) {
sceKernelStartThread(thid, 0, 0);
}
return thid;
}
#define BUF_WIDTH (512)
#define SCR_WIDTH (480)
#define SCR_HEIGHT (272)
#define printf pspDebugScreenPrintf
#define MAX(X, Y) ((X) > (Y) ? (X) : (Y))
#define RGB(r, g, b) ((r)|((g)<<8)|((b)<<16))
#define PI 3.14159265
typedef struct {
unsigned int color;
float x, y, z;
} Vertex;
void InitGU( void ); // Initialize the Graphics Subsystem
void SetupProjection( void ); // Setups the Projection Matrix
void DrawScene( void ); // Render Geometry
__________________
-------------------------------------------------------------------------------------- ![]() |
|
|
|
|
|
|
#4 | |
![]() ![]() Developer
|
You do have graphics.o, framebuffer.o and ModelMD2.o in the OBJS line of your makefile as well?
I assumed the name of the ModelMD2.o - you will need to add all the C files associated with the MD2 files to your OBJS line.
__________________
![]() Check out my homebrew & C tutorials at http://insomniac.0x89.org/ Coder formerly known as Insomniac197 Quote:
|
|
|
|
|
![]() |
| Tags |
| cygwin , errors , linking |
| Thread Tools | |
|
|