• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
dudedbz1

entry point must be defined???

14 posts in this topic

Huh? I have a simple SDL app running in Visual C++ Studio 2k5 Express... Well, not running though. I get this:
LINK : fatal error LNK1561: entry point must be defined
What is this? I'm guess its because I'm not linking with SDL. Well, how can I accomplish this with Visual C++ Studio 2k5 Express? I looked in 'Project' 'Properties', but found nothing.. Any ideas?
0

Share this post


Link to post
Share on other sites
I think you need to add /SUBSYSTEM:WINDOWS to the linker options. I can go check if that doesn't work.
0

Share this post


Link to post
Share on other sites
Ok, I think that did away with that error... But now I get more:

main.obj : error LNK2019: unresolved external symbol _SDL_Quit referenced in function _SDL_main
main.obj : error LNK2019: unresolved external symbol _SDL_SetVideoMode referenced in function _SDL_main
main.obj : error LNK2019: unresolved external symbol _SDL_Init referenced in function _SDL_main
LIBCMT.lib(wincrt0.obj) : error LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup
C:\Documents and Settings\Administrator\Desktop\C++\Visual C++\cApp\Debug\cApp.exe : fatal error LNK1120: 4 unresolved externals

I guess thats from not linking, but HOW DO I LINK WITH THIS THING??? LOl, its weird... there's no simple -lSDLmain -lSDL thing-a-mo-bob like in MingW...
0

Share this post


Link to post
Share on other sites
To link the SDL libraries, you can use the #pragma comment compiler directive at the beginning of your main.cpp file or whatever:
#pragma comment(lib, "SDL.lib")
#pragma comment(lib, "SDLmain.lib")

You could also go to Project->Properties->Linker->Input->Additional Dependencies, I think. I use the pragma comment more just because I can look at the code and see what I'm linking.
0

Share this post


Link to post
Share on other sites
Quote:
Original post by misterPhyrePhox
To link the SDL libraries, you can use the #pragma comment compiler directive at the beginning of your main.cpp file or whatever:
#pragma comment(lib, "SDL.lib")
#pragma comment(lib, "SDLmain.lib")

You could also go to Project->Properties->Linker->Input->Additional Dependencies, I think. I use the pragma comment more just because I can look at the code and see what I'm linking.


You are, the best.

One more problem now... Look:

msvcrt.lib(MSVCR80.dll) : error LNK2005: _exit already defined in LIBCMT.lib(crt0dat.obj)
msvcrt.lib(MSVCR80.dll) : error LNK2005: __isctype already defined in LIBCMT.lib(isctype.obj)
LINK : fatal error LNK1104: cannot open file 'uuid.lib'

I have never seen anything like this before...
0

Share this post


Link to post
Share on other sites
Do you have it set for a multithreaded dll runtime?

If you still need uuid.lib I think it comes with the SDK you can download from microsoft (big download for one file though).
0

Share this post


Link to post
Share on other sites
If you want use SDL in Visual studio, I think you have to set "use default libraries" (or whatever it's called) to off.
0

Share this post


Link to post
Share on other sites
To read the documentation is always a Good Thing :)
Anyway, directly from SDL documentation:

Quote:

Creating a Project with SDL

Create a project as a Win32 Application.

Create a C++ file for your project.

Set the C runtime to "Multi-threaded DLL" in the menu: Project|Settings|C/C++ tab|Code Generation|Runtime Library .

Add the SDL include directory to your list of includes in the menu: Project|Settings|C/C++ tab|Preprocessor|Additional include directories .
VC7 Specific: Instead of doing this I find it easier to add the include and library directories to the list that VC7 keeps. Do this by selecting Tools|Options|Projects|VC++ Directories and under the "Show Directories For:" dropbox select "Include Files", and click the "New Directory Icon" and add the [SDLROOT]\include directory (ex. If you installed to c:\SDL-1.2.5\ add c:\SDL-1.2.5\include). Proceed to change the dropbox selection to "Library Files" and add [SDLROOT]\lib.

The "include directory" I am referring to is the include folder within the main SDL directory (the one that this HTML file located within).

Now we're going to use the files that we had created earlier in the Build SDL step.

Copy the following files into your Project directory:

* SDL.dll

Add the following files to your project (It is not necessary to copy them to your project directory):

* SDL.lib
* SDLmain.lib

(To add them to your project, right click on your project, and select "Add files to project")

Instead of adding the files to your project it is more desireable to add them to the linker options: Project|Properties|Linker|Command Line and type the names of the libraries to link with in the "Additional Options:" box. Note: This must be done for each build configuration (eg. Release,Debug).


The "Multi-threaded DLL" stuff will avoid errors like "error LNK2005: _exit already defined in LIBCMT.lib". This happens because the library was built under this compiler setting (multi-threaded environment), and your compiler must do the same thing to avoid linker errors.

Linking "SDLmain.lib" will avoid errors like "LNK1561: entry point must be defined".

I prefer to do all the linking stuff from inside the source code through the use of #pragma preprocessor directives, like this:

// Microsoft Visual C++ specific
#ifdef _MSC_VER
#pragma comment( lib, "OpenGL32.lib" ) // Link against OpenGL
#pragma comment( lib, "SDL.lib" ) // Link against SDL
#pragma comment( lib, "SDLmain.lib" ) // Link against SDLmain
...
#endif



Goodbye!
0

Share this post


Link to post
Share on other sites
I did all that, step by step... It gives me this:

LINK : fatal error LNK1561: entry point must be defined

What does that mean? I'm linking with SDLmain.lib and SDL.lib, and have it set to 'Multithreaded DLL'. What am I doing wrong?
0

Share this post


Link to post
Share on other sites
It seems wierd that noone else suggest this, so I have a feeling I'm wrong, but doesn't that just mean that you are missing a "main" function (aka the entry point for your program)? I belive SDL has a special definition of what main should look like too (I'm sure it's in the docs somewhere).

Matt
0

Share this post


Link to post
Share on other sites
If you are doing your project in debug mode, you need to change your DLL type to Multithreaded Debug DLL.
0

Share this post


Link to post
Share on other sites
Quote:
Original post by matthughson
It seems wierd that noone else suggest this, so I have a feeling I'm wrong, but doesn't that just mean that you are missing a "main" function (aka the entry point for your program)? I belive SDL has a special definition of what main should look like too (I'm sure it's in the docs somewhere).

Matt


Only kinda...it converts other main functions to SDL_main. By using regular main(), you satisfy MSVC's expectations, and SDL uses some kind o' macro to satisfy SDL's expectations.

Before coding:

  1. Turn on multi-threaded DLLs.
  2. Put the DLL in your project folder (or system folder, but I recommend against it).
  3. Set up your compiler's include path to the SDL SDK folder
  4. Set up your compiler's library path to the SDL SDK folder
  5. Include SDL headers
  6. Input Library files to the linker (with #pragma in MSVC)


I use:

#include <SDL.h>
#include <SDL_main.h>

#ifdef WIN32
#pragma comment(lib,"SDL.lib")
#pragma comment(lib,"SDL_main.lib")
#endif

int main(int argc, char** argv)
{
return 0;
}



0

Share this post


Link to post
Share on other sites
Check my first post about the linker options. This is specific to SDL and VC 8.0 (which Express 2k5 uses).
0

Share this post


Link to post
Share on other sites
Ive had this error. And I can only tell you this - something is wrong with your main function - check carefully whether you wrote it precisely as it should be. Different projects require different versions of main so check its correct spelling.
0

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  
Followers 0