Page 1 of 1

Symbol 'System_Init' not defined

Posted: February 3rd, 2019, 6:02 am
by wkt
Hello
I have a problem with Playstation Development Library for the PSY-Q created by Orion, when I try running compile code using ccpsx I see following error:

C:\USERS\XXX\APPDATA\LOCAL\TEMP\PQ4 : Error : Symbol 'System_Init' not defined
C:\USERS\XXX\APPDATA\LOCAL\TEMP\PQ4 : Error : Symbol 'DataManager_LoadDatas' not defined
C:\USERS\XXX\APPDATA\LOCAL\TEMP\PQ4 : Error : Symbol 'Tim_Load' not defined
C:\USERS\XXX\APPDATA\LOCAL\TEMP\PQ4 : Error : Symbol 'Sprite_Init' not defined
C:\USERS\XXX\APPDATA\LOCAL\TEMP\PQ4 : Error : Symbol 'Sprite_SetPosition' not defined
C:\USERS\XXX\APPDATA\LOCAL\TEMP\PQ4 : Error : Symbol 'System_Exit' not defined

I have tried to change directory for that library I have put in C:\psyq\include and also in my project folder but it still did not work. I have also tried compiling both on windows xp and windows 10 but that did not fix the issue.

Re: Symbol 'System_Init' not defined

Posted: February 3rd, 2019, 10:35 am
by gwald
This is pretty basic CC stuff,
Symbol not defined means it tried linking to the library and couldn't find it, it's the .a or .lib file, it should go into the lib folder or in your working folder and you tell the compiler to use the library via the -L (library path if it's in a non standard folder) and or -l (library name) (on gcc anyway, it's probably the same).

Re: Symbol 'System_Init' not defined

Posted: February 3rd, 2019, 2:24 pm
by wkt
gwald wrote: February 3rd, 2019, 10:35 am This is pretty basic CC stuff,
Symbol not defined means it tried linking to the library and couldn't find it, it's the .a or .lib file, it should go into the lib folder or in your working folder and you tell the compiler to use the library via the -L (library path if it's in a non standard folder) and or -l (library name) (on gcc anyway, it's probably the same).
I moved whole library to lib folder and I wrote -l argument but now I have following error...

"C:\PSYQ\LIB\HITMOD.OBJ : Error : File c:\PsyQ\LIB\HITMOD.OBJ is not a valid library file"

Re: Symbol 'System_Init' not defined

Posted: February 3rd, 2019, 4:12 pm
by Shadow
An object file is not a library file so you don't need to use -l.

Code: Select all

ccpsx -Xm -Wall -Xo$80001000 main.c example1.obj example2.obj -lexample.lib -omain.cpe,main.sym,main.map

Re: Symbol 'System_Init' not defined

Posted: February 4th, 2019, 2:45 am
by wkt
Shadow wrote: February 3rd, 2019, 4:12 pm An object file is not a library file so you don't need to use -l.

Code: Select all

ccpsx -Xm -Wall -Xo$80001000 main.c example1.obj example2.obj -lexample.lib -omain.cpe,main.sym,main.map
Thanks, that works, although I have new issue, after compiling the game and trying to run it in the emulator I only get black screen (I run examples so it can't be fault of my code).

Re: Symbol 'System_Init' not defined

Posted: February 4th, 2019, 8:08 am
by gwald
you might want to be more verbose with what you're doing if you want help, we're not mind readers.. yet.

Re: Symbol 'System_Init' not defined

Posted: February 4th, 2019, 9:24 am
by wkt
gwald wrote: February 4th, 2019, 8:08 am you might want to be more verbose with what you're doing if you want help, we're not mind readers.. yet.
Ok, I don't know how to explain it so I'm sending whole project in the attachment, I'm using psyq compiled for x64 and i use epsxe emulator.

Re: Symbol 'System_Init' not defined

Posted: February 4th, 2019, 6:36 pm
by gwald
Hmm.. just had a quick look at what you are trying to do, load two tim files and display them.. via main.c:

// These are a group of files we want to load
DataManager_Files game_datas[] =
{
{"sprite.tim", 0},
{"blur.tim", 0},
{NULL, 0}
};

I think you have two issues:
#1 I don't see where you are load the tim files, you can do this many way's bin2c (hex code in a c file and easiest), I use Net Yaroze with this for testing on emulators I don't know what the psyq equivalent is or actually load it from a CD, which you need to build the iso for, which I don't think you do that.
Ok, so: DataManager_LoadDatas("DATA", game_datas); // from the "DATA" folder
You need to build an iso with the tim files in the DATA folder
Search the forums on how to build the iso.

#2 re the code above, I think the zeros are meant to be RAM address space, this is where your TIM are loaded into RAM. looks like DataManager_LoadDatas manages the RAM address, so the zeros are allocated the correct RAM address.
Hope that helps.

Re: Symbol 'System_Init' not defined

Posted: February 12th, 2019, 4:51 am
by Orion_
maybe you should read again my tutorial
http://onorisoft.free.fr/psx/tutorial/tuto.htm
and particularly the "CDRom and Data loading philosophy of my library." section and "Creating a valid Psx CD Image."