The MASM Forum Archive 2004 to 2012

Specialised Projects => Compiler Based Assembler => Pelle's C compiler and tools => Topic started by: grofaz on November 22, 2007, 10:58:25 PM

Title: Need Help Setting Up SDL With PellesC
Post by: grofaz on November 22, 2007, 10:58:25 PM
What does this mean ??

> polink.exe -subsystem:console -machine:ix86  kernel32.lib advapi32.lib delayimp.lib SDL.lib SDLmain.lib -out:"C:\PellesC\Projects\gbcsdl\gbcsdl.exe" C:\PellesC\Projects\gbcsdl\output\gbcsdl.obj
POLINK: warning: Unrecognized option 'manifestdependency:"type='win32''; ignored.
POLINK: fatal error: File not found: 'name='Microsoft.VC80.CRT''.
*** Error code: 1 ***
Done.


Trying to run the SDL init sample code:

#include "SDL/SDL.h"   /* All SDL App's need this */
#include <stdio.h>

int main(int argc, char *argv[]) {
   
    printf("Initializing SDL.\n");
   
    /* Initialize defaults, Video and Audio */
    if((SDL_Init(SDL_INIT_VIDEO|SDL_INIT_AUDIO)==-1)) {
        printf("Could not initialize SDL: %s.\n", SDL_GetError());
        exit(-1);
    }

    printf("SDL initialized.\n");

    printf("Quiting SDL.\n");
   
    /* Shutdown all subsystems */
    SDL_Quit();
   
    printf("Quiting....\n");

    exit(0);
}

How do I get this to build ??

Thanks,
grofaz
Title: Re: Need Help Setting Up SDL With PellesC
Post by: Vortex on November 23, 2007, 06:07:33 PM
Microsoft.VC80.CRT... I suspect your project have dependencies on Visul C++ 2005 run-time library. Are you trying to compile a VC++ 2005 project on PellesC?
Title: Re: Need Help Setting Up SDL With PellesC
Post by: MichaelW on November 23, 2007, 08:06:59 PM
There is a Mingw32 package that might work better here:

http://www.libsdl.org/download-1.2.php


Title: Re: Need Help Setting Up SDL With PellesC
Post by: grofaz on November 23, 2007, 10:52:36 PM
Quote from: Vortex on November 23, 2007, 06:07:33 PM
Microsoft.VC80.CRT... I suspect your project have dependencies on Visul C++ 2005 run-time library. Are you trying to compile a VC++ 2005 project on PellesC?

No. Just SDL using a console project template.
Title: Re: Need Help Setting Up SDL With PellesC
Post by: grofaz on November 23, 2007, 10:53:59 PM
Quote from: MichaelW on November 23, 2007, 08:06:59 PM
There is a Mingw32 package that might work better here:

http://www.libsdl.org/download-1.2.php




I'll try it out, but I've never run into this problem before setting up SDL. BTW it's the linker that is firing the error.
Title: Re: Need Help Setting Up SDL With PellesC
Post by: zooba on November 24, 2007, 01:38:51 AM
Probably SDL has the dependency on VC80.CRT.

If you have the source you should be able to recompile with a different C runtime library.

Cheers,

Zooba :U
Title: Re: Need Help Setting Up SDL With PellesC
Post by: grofaz on November 24, 2007, 03:18:14 AM
Quote from: zooba on November 24, 2007, 01:38:51 AM
Probably SDL has the dependency on VC80.CRT.

If you have the source you should be able to recompile with a different C runtime library.

Cheers,

Zooba :U

Yeah, I kind of thought about that today. I'll try building the source code in PellesC from scratch. Thanks man!

Title: Re: Need Help Setting Up SDL With PellesC
Post by: Vortex on November 24, 2007, 11:34:36 AM
Quote from: grofaz on November 23, 2007, 10:52:36 PM
Quote from: Vortex on November 23, 2007, 06:07:33 PM
Microsoft.VC80.CRT... I suspect your project have dependencies on Visul C++ 2005 run-time library. Are you trying to compile a VC++ 2005 project on PellesC?

No. Just SDL using a console project template.

grofaz,

VC80.CRT comes with Visual Studio 2005.
Title: Re: Need Help Setting Up SDL With PellesC
Post by: grofaz on November 24, 2007, 06:18:47 PM
Quote from: Vortex on November 24, 2007, 11:34:36 AM
Quote from: grofaz on November 23, 2007, 10:52:36 PM
Quote from: Vortex on November 23, 2007, 06:07:33 PM
Microsoft.VC80.CRT... I suspect your project have dependencies on Visul C++ 2005 run-time library. Are you trying to compile a VC++ 2005 project on PellesC?

No. Just SDL using a console project template.

grofaz,

VC80.CRT comes with Visual Studio 2005.

I've been looking for it everywhere, even downloaded Visual Studio 2008, but I can't find it anywhere. What file is it exactly ? And where would it be ? I've run searches of my Windows folder but no joy. Googled the web but still no joy locating a copy. Maybe I should remove VS 2008 and try 2005 ? Very exasperating as I really can't stand VS. PellesC is very nice!

Title: Re: Need Help Setting Up SDL With PellesC
Post by: grofaz on November 24, 2007, 07:17:56 PM
OK. I've rebuilt SDL.lib and SDLmain.lib using Visual Studio 2008 Express so now the sample SDL program wants:

Microsoft.VC90.CRT

Cool!

Now I've run a search and found the following:

Microsoft.VC90.CRT
Microsoft.VC90.CRT.manifest


Great!

Microsoft.VC90.CRT is a folder which contains Microsoft.VC90.CRT.manifest.

How do I tell POLINK where to look ? I've tried adding the directory to Project/Project Options/Folders but it doesn't do the trick.

Getting closer but still not through the hoop. I need a nudge!
Title: Re: Need Help Setting Up SDL With PellesC
Post by: dancho on November 24, 2007, 08:08:04 PM
this could help:

http://www.friedspace.com/cprogramming/sdlsetup.php
Title: Re: Need Help Setting Up SDL With PellesC
Post by: grofaz on November 24, 2007, 08:35:58 PM
Quote from: dancho on November 24, 2007, 08:08:04 PM
this could help:

http://www.friedspace.com/cprogramming/sdlsetup.php


Thank you dancho, you're the Man! Works!
Title: Re: Need Help Setting Up SDL With PellesC
Post by: dancho on November 25, 2007, 09:33:52 AM
np,
and I can recommend LazyFoo tutorials for SDL game programming...

http://lazyfoo.net/SDL_tutorials/index.php
Title: Re: Need Help Setting Up SDL With PellesC
Post by: grofaz on November 25, 2007, 08:47:25 PM
Yeah, they're great! Will Pelles C c++ add-in allow for c++ code or do you need to translate Lazy Foos stuff into straight C code ?