Compiling issues ...continued

i changed it to “multithreaded DLL”

and now i only get 1 error:

Linking…
SDLmain.lib(SDL_main.obj) : error LNK2001: unresolved external symbol
_SDL_main
Debug/ShaderDemo.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.

ShaderDemo.exe - 2 error(s), 0 warning(s)-------------------------------
Fabian “SupaGu” Mathews


Tired of spam? Get advanced junk mail protection with MSN 8.
http://join.msn.com/?page=features/junkmail

Fabian Mathews wrote:

Linking…
SDLmain.lib(SDL_main.obj) : error LNK2001: unresolved external symbol
_SDL_main

Is your program written in C++?
This sounds like you haven’t declared your main() function properly - you need to use the following in C++:

extern “C” int main(int argc, char** argv)
{
// Insert code here
}

If you are wanting to make a library, it seems like the thing is set up to produce an executable, since it gives Debug/ShaderDemo.exe as the output filename.
That would also explain the problem - the program would not contain the main function if meant to be a library.

Chris E.
-------------- next part --------------
A non-text attachment was scrubbed…
Name: signature.asc
Type: application/pgp-signature
Size: 256 bytes
Desc: OpenPGP digital signature
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20040423/b30610a7/attachment.pgp

My library compiles fine,
its when i go to use my library i get this error.

Do i need to put that main declaration in my library?

(im using C++)

ShaderDemo.exe is the exe i want to make that includes my static library.

Thanks again,
Fabian-------------------------------
Fabian “SupaGu” Mathews

From: chrise@chrise.tk (Chris E.)
Reply-To: sdl at libsdl.org
To: sdl at libsdl.org
Subject: [SDL] Re: compiling issues …continued
Date: Fri, 23 Apr 2004 18:39:09 +0100

Fabian Mathews wrote:

Linking…
SDLmain.lib(SDL_main.obj) : error LNK2001: unresolved external symbol
_SDL_main

Is your program written in C++?
This sounds like you haven’t declared your main() function properly - you
need to use the following in C++:

extern “C” int main(int argc, char** argv)
{
// Insert code here
}

If you are wanting to make a library, it seems like the thing is set up to
produce an executable, since it gives Debug/ShaderDemo.exe as the output
filename.
That would also explain the problem - the program would not contain the main
function if meant to be a library.

Chris E.
<< signature.asc >>
its when


Tired of spam? Get advanced junk mail protection with MSN 8.
http://join.msn.com/?page=features/junkmail

okay, some more details,

if i include my lib its fine
#pragma comment( lib, “SiphonGL.lib” )

but none of my classes are recognised, so i include my “stdafx” type file
from me engine code:
#include “SiphonGL.h”

then thats when i get the error(s).

ideas on a solutiuon?-------------------------------
Fabian “SupaGu” Mathews

From: @Fabian_Mathews (Fabian Mathews)
Reply-To: sdl at libsdl.org
To: sdl at libsdl.org
Subject: [SDL] Re: compiling issues …continued
Date: Sat, 24 Apr 2004 04:16:17 +0000

My library compiles fine,
its when i go to use my library i get this error.

Do i need to put that main declaration in my library?

(im using C++)

ShaderDemo.exe is the exe i want to make that includes my static library.

Thanks again,
Fabian


Fabian “SupaGu” Mathews

From: chrise@chrise.tk (Chris E.)
Reply-To: sdl at libsdl.org
To: sdl at libsdl.org
Subject: [SDL] Re: compiling issues …continued
Date: Fri, 23 Apr 2004 18:39:09 +0100

Fabian Mathews wrote:

Linking…
SDLmain.lib(SDL_main.obj) : error LNK2001: unresolved external symbol
_SDL_main

Is your program written in C++?
This sounds like you haven’t declared your main() function properly - you
need to use the following in C++:

extern “C” int main(int argc, char** argv)
{
// Insert code here
}

If you are wanting to make a library, it seems like the thing is set up to
produce an executable, since it gives Debug/ShaderDemo.exe as the output
filename.
That would also explain the problem - the program would not contain the main
function if meant to be a library.

Chris E.
<< signature.asc >>
its when


Tired of spam? Get advanced junk mail protection with MSN 8.
http://join.msn.com/?page=features/junkmail


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


Help STOP SPAM with the new MSN 8 and get 2 months FREE*
http://join.msn.com/?page=features/junkmail

Fabian Mathews wrote:

My library compiles fine,
its when i go to use my library i get this error.

Do i need to put that main declaration in my library?

(im using C++)

ShaderDemo.exe is the exe i want to make that includes my static library.

Thanks again,
Fabian

Well, here is a list of things to check:
#1. Have you configured the linker to use both your library and SDL?
#2. Have you configured the compiler to use the appropriate include directories for everything?
#3. Are you sure you’ve included the header files for everything you use?
#4. Have you included “SDL.h” into the file in which you define your main() function?
#5. Have you declared main() like I showed before? The argument list is important.

I reckon your problem is probably with point #4 - even if you don’t use any SDL functions in the source
file containing function main(), you must include SDL.h to provide the definitions required for SDL to use it.

Chris E.
-------------- next part --------------
A non-text attachment was scrubbed…
Name: signature.asc
Type: application/pgp-signature
Size: 256 bytes
Desc: OpenPGP digital signature
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20040424/fbe70194/attachment.pgp

it was my main method, i had char[] argv changed it to char** argv-------------------------------
Fabian “SupaGu” Mathews

From: chrise@chrise.tk (Chris E.)
Reply-To: sdl at libsdl.org
To: sdl at libsdl.org
Subject: [SDL] Re: compiling issues …continued
Date: Sat, 24 Apr 2004 17:13:14 +0100

Fabian Mathews wrote:

My library compiles fine,
its when i go to use my library i get this error.

Do i need to put that main declaration in my library?

(im using C++)

ShaderDemo.exe is the exe i want to make that includes my static library.

Thanks again,
Fabian

Well, here is a list of things to check:
#1. Have you configured the linker to use both your library and SDL?
#2. Have you configured the compiler to use the appropriate include
directories for everything?
#3. Are you sure you’ve included the header files for everything you use?
#4. Have you included “SDL.h” into the file in which you define your main()
function?
#5. Have you declared main() like I showed before? The argument list is
important.

I reckon your problem is probably with point #4 - even if you don’t use any
SDL functions in the source
file containing function main(), you must include SDL.h to provide the
definitions required for SDL to use it.

Chris E.
<< signature.asc >>


The new MSN 8: advanced junk mail protection and 2 months FREE*
http://join.msn.com/?page=features/junkmail

Have you also included SDLmain.lib?

Do you have defined main() the way it should be?
I mean

int main (int argc, char* argv[])
{}

Cheers,
Paulo Pinto

Fabian Mathews wrote:> i changed it to “multithreaded DLL”

and now i only get 1 error:

Linking…
SDLmain.lib(SDL_main.obj) : error LNK2001: unresolved external symbol
_SDL_main
Debug/ShaderDemo.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.

ShaderDemo.exe - 2 error(s), 0 warning(s)


Fabian “SupaGu” Mathews


Tired of spam? Get advanced junk mail protection with MSN 8.
http://join.msn.com/?page=features/junkmail


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl