You are not logged in.

#1 2008-06-12 12:47:03

SilentMan
Member
From: Ukraine
Registered: 2007-09-20
Posts: 41

Porting windows program with winelib - compiles, but fails to link.

I'm trying to port zCPU emulator . I've got it to build and created object files. Now it doesn't link to its own functions and some wine ones sad
Any ideas?
As you see, I'm using small script for build.

Here's a package of what I'm building from: http://silentman.org.ua/build.tar.bz2

[sm@home-sm zcpu_emu_build] LANG="en_US.UTF-8" sh ./build.sh
zcpu_emu.o: In function `putch(int)':
zcpu_emu.cpp:(.text+0x20c): undefined reference to `_putch'
zcpu_emu.o: In function `kbhit()':
zcpu_emu.cpp:(.text+0x229): undefined reference to `_kbhit'
zcpu_emu.o: In function `getch()':
zcpu_emu.cpp:(.text+0x246): undefined reference to `_getch'
zcpu_emu.o: In function `RunLoop(void*)':
zcpu_emu.cpp:(.text+0x6ad): undefined reference to `video_event_loop()'
zcpu_emu.o: In function `PokeVideoDriver(int&, int&)':
zcpu_emu.cpp:(.text._Z15PokeVideoDriverRiS_[PokeVideoDriver(int&, int&)]+0x58): undefined reference to `con_putch(int)'
zcpu_emu.cpp:(.text._Z15PokeVideoDriverRiS_[PokeVideoDriver(int&, int&)]+0xef): undefined reference to `video_draw_rectangle(int, int, int, int, unsigned char, unsigned char, unsigned char)'
zcpu_emu.o: In function `ScratchPort(int, int)':
zcpu_emu.cpp:(.text._Z11ScratchPortii[ScratchPort(int, int)]+0x39): undefined reference to `WriteToSCSI(int, int, int)'
zcpu_emu.o: In function `GetPort(int&)':
zcpu_emu.cpp:(.text._Z7GetPortRi[GetPort(int&)]+0x1d): undefined reference to `ReadFromSCSI()'
SCSI.o: In function `InitSCSI()':
SCSI.cpp:(.text+0xe1): undefined reference to `con_write(char const*, ...)'
SCSI.cpp:(.text+0x198): undefined reference to `con_write(char const*, ...)'
SCSI.cpp:(.text+0x22a): undefined reference to `con_endl()'
SCSI.cpp:(.text+0x238): undefined reference to `con_write(char const*, ...)'
SCSI.cpp:(.text+0x23d): undefined reference to `con_endl()'
zBIOS.o: In function `DiskIO()':
zBIOS.cpp:(.text+0x11c): undefined reference to `WriteToSCSI(int, int, int)'
zBIOS.cpp:(.text+0x13c): undefined reference to `WriteToSCSI(int, int, int)'
zBIOS.cpp:(.text+0x15d): undefined reference to `WriteToSCSI(int, int, int)'
zBIOS.cpp:(.text+0x162): undefined reference to `ReadFromSCSI()'
zBIOS.cpp:(.text+0x194): undefined reference to `WriteToSCSI(int, int, int)'
zBIOS.cpp:(.text+0x199): undefined reference to `ReadFromSCSI()'
/usr/lib/wine/libwinecrt0.a(exe_main.o): In function `main':
exe_main.c:(.text+0x9d): undefined reference to `WinMain'
collect2: ld returned 1 exit status
winegcc: g++ failed

Last edited by SilentMan (2008-06-12 12:54:38)

Offline

#2 2008-06-13 03:21:38

dwi
Member
Registered: 2008-01-27
Posts: 27

Re: Porting windows program with winelib - compiles, but fails to link.

Look like it is expecting Conio, which was a MS only console IO API. There are some implementations of Conio for Linux though. It might be worth learning ncurses, to just replace the Conio bits.

Offline

#3 2008-06-13 07:28:32

SilentMan
Member
From: Ukraine
Registered: 2007-09-20
Posts: 41

Re: Porting windows program with winelib - compiles, but fails to link.

Yes, I do have conio header for linux. And what about its own functions like WriteToSCSI()?

Offline

Board footer

Powered by FluxBB