NO

Author Topic: Porting my project  (Read 2990 times)

quadcricket

  • Guest
Porting my project
« on: October 25, 2015, 08:54:12 PM »
Hello, I've been working on an open project called "Legend of Pandora" for the Pandora handheld gaming device and Linux. So far I've gotten SDL and the game working on both platforms with a cross compiler and was interested in getting everything working on Windows.

When I try to compile using Pelles C I keep running into issues. I THINK I got SDL and SDL_mixer correctly made into a lib and installed but I'm still getting many errors such as unreachable code and "(250): fatal error: Internal error: liveness_usesite()" whatever that means.

I know I'm asking a lot but if anyone more experienced could let me know if the code can be made to work with Pelles C and what I'm missing I would appreciate it.

Here is a link to the source:
https://github.com/quadcricket/legend-of-pandora/blob/master/source/common/source/main.c

and the main page if you want to use the resources:
https://github.com/quadcricket/legend-of-pandora

Thanks for your time.

PS: I'm still pretty new to programming so I'm sorry for any ugly code :/

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 2115
Re: Porting my project
« Reply #1 on: October 26, 2015, 09:07:16 AM »
No such an error with PellesC 8 ?
Using
SDL-devel-1.2.15-VC
SDL_mixer-devel-1.2.12-VC

I add only this:
Code: [Select]
#ifdef __POCC__
#pragma warn(disable: 2154 2231)
#pragma comment(lib, "SDL_main.lib")
#pragma comment(lib, "SDL.lib")
#pragma comment(lib, "SDL_Mixer.lib")
#endif
« Last Edit: October 27, 2015, 08:34:56 AM by TimoVJL »
May the source be with you

quadcricket

  • Guest
Re: Porting my project
« Reply #2 on: October 26, 2015, 04:34:57 PM »
Pelles C version: 8.00.60
SDL version: 1.2

I've added what you've recommended but I am still having errors.

Errors:

Code: [Select]
Building main.obj.
Use <stdlib.h> instead of non-standard <malloc.h>
C:\Users\Cricket\Documents\Pelles C Projects\Legend_of_Pandora\main.c(244): warning #2235: Not all control paths return a value.
C:\Users\Cricket\Documents\Pelles C Projects\Legend_of_Pandora\main.c(532): warning #2115: Local 'ed_painChannel' is initialized but never used.
C:\Users\Cricket\Documents\Pelles C Projects\Legend_of_Pandora\main.c(452): warning #2114: Local 'pixel' is not referenced.
Building Legend_of_Pandora.exe.
POLINK: error: Unresolved external symbol '_music_mixer'.
POLINK: error: Unresolved external symbol '_music_active'.
POLINK: error: Unresolved external symbol '_open_music'.
POLINK: error: Unresolved external symbol '_Mix_VolumeMusic'.
POLINK: error: Unresolved external symbol '__Mix_InitEffects'.
POLINK: error: Unresolved external symbol '_Mix_LoadVOC_RW'.
POLINK: error: Unresolved external symbol '_Mix_LoadAIFF_RW'.
POLINK: error: Unresolved external symbol '_close_music'.
POLINK: error: Unresolved external symbol '__Mix_DeinitEffects'.
POLINK: fatal error: 9 unresolved external(s).
*** Error code: 1 ***
Done.

I think this may be a problem with my SDL mixer setup?

Library and object files:
Code: [Select]
kernel32.lib advapi32.lib delayimp.lib sdl.lib sdl_main.lib sdl_Mixer.lib

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 2115
Re: Porting my project
« Reply #3 on: October 27, 2015, 09:55:41 AM »
Only Mix_VolumeMusic is in normal SDL_mixer.lib
Are these user defined?
Code: [Select]
music_mixer
music_active
open_music
close_music
Mix_LoadVOC_RW
Mix_LoadAIFF_RW
_Mix_InitEffects
_Mix_DeinitEffects
May the source be with you

quadcricket

  • Guest
Re: Porting my project
« Reply #4 on: October 27, 2015, 07:17:51 PM »
I found out I was using the SDL2 mixer by accident. That would explain a lot.

The only thing it says now is:
Code: [Select]
Use <stdlib.h> instead of non-standard <malloc.h>
but that doesn't bother me any.

It seems to all be working now! Those #pragma statements really seemed to do the trick.

Thanks again!