Linker error: Symbol not defined

General help for the PSY-Q SDK, such as setting the SDK up, compiling correctly, linking and debugging
Post Reply
PolybiusProxy
What is PSXDEV?
What is PSXDEV?
Posts: 4
Joined: Jul 06, 2020

Linker error: Symbol not defined

Post by PolybiusProxy » June 27th, 2023, 6:48 am

Hi there, I'm getting the following linker errors:

Code: Select all

C:\PSYQ\LIB\LIBSN.LIB : Error : Symbol '__do_global_dtors' not defined
C:\PSYQ\LIB\LIBSN.LIB : Error : Symbol '__bb_exit_func' not defined
C:\PSYQ\LIB\LIBSN.LIB : Error : Symbol '_cleanup' not defined
I'm using PSY-Q 4.7. I tried with the altered PSY-Q SDK and the Programmers Tool CD 2.2, by extracting the 4.7 runtime on them.
Can anyone help? Thanks.

User avatar
Shadow
Verified
Admin / PSXDEV
Admin / PSXDEV
Posts: 2670
Joined: Dec 31, 2012
PlayStation Model: H2000/5502
Discord: Shadow^PSXDEV

Post by Shadow » June 27th, 2023, 11:59 am

What's your PSYQ.INI file look like? This is mine for 4.7.

Code: Select all

[ccpsx]
stdlib=libgs.lib libgte.lib libgpu.lib libspu.lib libsnd.lib libetc.lib libapi.lib libsn.lib libc.lib libcd.lib libcard.lib libmath.lib libds.lib libpress.lib libpad.lib libtap.lib libgun.lib libsio.lib libmcrd.lib

compiler_path=C:\psyq\bin
assembler_path=C:\psyq\bin
linker_path=C:\psyq\bin
library_path=C:\psyq\lib
c_include_path=C:\psyq\include
cplus_include_path=C:\psyq\include
If you still get the linker errors after verifying libsn.lib is present in your INI, then include the correct header in your C or C++ file you're linking. The linker is literally telling you it cannot find (for example) _cleanup in your compiled object because the header is most likely missing.

If you're using PSYLINK.EXE, then also make sure you check and edit the linker file. On Windows, it is overlooked because of the *.LNK extension so don't be fooled if it looks like a shortcut or garbage file.

Example:
Image

Image

Image
You do not have the required permissions to view the files attached to this post.
Development Console: SCPH-5502 with 8MB RAM, MM3 Modchip, PAL 60 Colour Modification (for NTSC), PSIO Switch Board, DB-9 breakout headers for both RGB and Serial output and an Xplorer with CAETLA 0.34.

PlayStation Development PC: Windows 98 SE, Pentium 3 at 400MHz, 128MB SDRAM, DTL-H2000, DTL-H2010, DTL-H201A, DTL-S2020 (with 4GB SCSI-2 HDD), 21" Sony G420, CD-R burner, 3.25" and 5.25" Floppy Diskette Drives, ZIP 100 Diskette Drive and an IBM Model M keyboard.

PolybiusProxy
What is PSXDEV?
What is PSXDEV?
Posts: 4
Joined: Jul 06, 2020

Post by PolybiusProxy » June 27th, 2023, 4:28 pm

Hi,

My PSYQ.INI file looks almost the same. All the paths match, the only different things are some missing libs like libmcrd.lib. Added all of them just in case, and I'm still getting the errors.

The headers and the libs I'm using are from the PSY-Q 4.7 runtime ZIP from the Downloads page.

I don't see any *.LNK file in my project.

Here's my MAKEFILE.MAK, if it helps:

Code: Select all

all:
		del main.exe
		cls
		
		ccpsx -Xo0x80010000 -Wall game/*.cpp -I game -o main.cpe
		cpe2x /ce main.cpe

User avatar
Shadow
Verified
Admin / PSXDEV
Admin / PSXDEV
Posts: 2670
Joined: Dec 31, 2012
PlayStation Model: H2000/5502
Discord: Shadow^PSXDEV

Post by Shadow » June 28th, 2023, 4:54 pm

Don't include libmcrd.lib unless you need it as it'll just bloat your CPE/EXE. The same goes for any other libs if you're not using them.

Not sure what's going on, but try replacing libsn.lib with the 4.6 version instead. It looks like mine is from Wednesday, 28 July 1999 compared to Friday, 18 February 2000 for all my other libs (which are 4.7) so maybe I did replace my libsn.lib with 4.6 because I had the same problem (I cannot remember though) :?
:null:
:null:
Psy-Q V4.6 LIBSN.LIB (Wednesday, 28 July 1999)
LIBSN.LIB
You do not have the required permissions to view the files attached to this post.
Development Console: SCPH-5502 with 8MB RAM, MM3 Modchip, PAL 60 Colour Modification (for NTSC), PSIO Switch Board, DB-9 breakout headers for both RGB and Serial output and an Xplorer with CAETLA 0.34.

PlayStation Development PC: Windows 98 SE, Pentium 3 at 400MHz, 128MB SDRAM, DTL-H2000, DTL-H2010, DTL-H201A, DTL-S2020 (with 4GB SCSI-2 HDD), 21" Sony G420, CD-R burner, 3.25" and 5.25" Floppy Diskette Drives, ZIP 100 Diskette Drive and an IBM Model M keyboard.

PolybiusProxy
What is PSXDEV?
What is PSXDEV?
Posts: 4
Joined: Jul 06, 2020

Post by PolybiusProxy » June 29th, 2023, 9:48 am

Thanks! That fixed it.

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests