• 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
ChainedHollow

SDL2_ttf issues: Entry Point not found. Visual Studio

6 posts in this topic

I have been working on a game using SDL but recently decided to switch to SDL2. I've been going over the examples for SDL2 on LazyFoo but there isn't really any documentation, just code. I got to the ttf examples yesterday. The first basic one worked yesterday. Today, I got to another example that uses ttf and it's giving me an error. I tried the first one again and I'm getting the same error. I have no idea what is going on. I have searched on google to try to fix it but I havn't found anything helpful. The error is:

 

Entry Point not found
The procedure entry point InterLockedCompareExchange@12 could not be located in the dynamic link library libfreetype-6.dll
 
 
0

Share this post


Link to post
Share on other sites

The procedure entry point InterLockedCompareExchange@12 could not be located in the dynamic link library libfreetype-6.dll

The error message is a linker error. The linker combines your code with the code from the operating system, from the graphics libraries, from the audio libraries, and from everywhere else, and tells each of the parts about each other. It links the different parts of code together.

 

In this case the linker is looking for a function called InterLockedCompareExchange, and it is searching for it in a library called libfreetype-6

 

 

The function InterLockedCompareExchange is part of the Windows kernel. Your linker should be looking in kernel32, not libfreetype-6.  

 

This is a linker problem, and a few moments in Google shows that MinGW is frequently misconfigured to not search the system libraries. Are you using the MinGW compiler?

 

Edit: 

 

The function is usually implemented as a compiler intrinsic. It is very suspicious that your program would attempt to use the function version rather than the intrinsic version.  

Longer description because this is For Beginners forum:  A compiler intrinsic is when you write a function call but the compiler replaces it with in-place CPU instructions. One of many examples of intrinsic functions are math functions like sin() and cos(). The compiler could call the function for that, but calling a function requires setting a bunch of boilerplate code, setting up a stack frame, and then jumping to a new location, and cleaning up when it is done.  When the intrinsic version of the function is used the compiler doesn't actually call a function. Instead it calls the CPU instruction directly which saves a lot of time and complexity. Since the compiler usually doesn't call the actual function the sin() and cos() functions are not really needed except in rare situations, and if you see them being linked it means something is probably wrong with the code.  

 

The same is true with this intrinsic; the compiler probably should not be generating a function call for InterlockedCompareExchange. It is an atomic instruction on the platform and if the compiler isn't using the intrinsic then something is probably wrong with your settings.

0

Share this post


Link to post
Share on other sites

I saw what you were saying about MinGW on google, but Im not using it. Im using Visual Studio 2010. I do have the libfreetype.dll file in the project folder. Its the one that came with SDL2. I made a new project so that I could go through linking everything again, and its doing the same thing. I need to use text in my game, so I'm going to have to fix this eventually.

0

Share this post


Link to post
Share on other sites

In that case it becomes a matter of looking up the setting in the maze of property pages that VS2010 uses.

 

Open up the project settings, open up "Configuration Properties > C/C++ > Command Line" and copy/paste the block of text.  Then open up "Configuration Properties > Linker > Command Line" and copy/paste the block of text that shows up there.

 

Those are the exact command lines being used, and from there we can look at it to see what setting is incorrect.

1

Share this post


Link to post
Share on other sites

C/C++:

/ZI /nologo /W3 /WX- /Od /Oy- /D "_MBCS" /Gm /EHsc /RTC1 /GS /fp:precise /Zc:wchar_t /Zc:forScope /Fp"Debug\SDL2Tutorials.pch" /Fa"Debug\" /Fo"Debug\" /Fd"Debug\vc100.pdb" /Gd /analyze- /errorReport:queue 

 

Linker:

/OUT:"c:\users\brandon\documents\visual studio 2010\Projects\SDL2Tutorials\Debug\SDL2Tutorials.exe" /NOLOGO "SDL2.lib" "SDL2_image.lib" "SDL2_ttf.lib" "SDL2main.lib" "kernel32.lib" "user32.lib" "gdi32.lib" "winspool.lib" "comdlg32.lib" "advapi32.lib" "shell32.lib" "ole32.lib" "oleaut32.lib" "uuid.lib" "odbc32.lib" "odbccp32.lib" /MANIFEST /ManifestFile:"Debug\SDL2Tutorials.exe.intermediate.manifest" /ALLOWISOLATION /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /DEBUG /PDB:"c:\users\brandon\documents\visual studio 2010\Projects\SDL2Tutorials\Debug\SDL2Tutorials.pdb" /SUBSYSTEM:CONSOLE /PGD:"c:\users\brandon\documents\visual studio 2010\Projects\SDL2Tutorials\Debug\SDL2Tutorials.pgd" /TLBID:1 /DYNAMICBASE /NXCOMPAT /MACHINE:X86 /ERRORREPORT:QUEUE 

0

Share this post


Link to post
Share on other sites

It is suspicious that your SDL libraries are at the front instead of the back. The first should be kernel32.lib, user32.lib, etc., and the SDL libraries should be at the end. Find out where you listed the libraries in the maze of dialog boxes as there are several "additional libraries" fields that you might have put it in. Wherever you put it, make sure they appear at the end of the list on the linker command line.  
 
If reordering those libraries doesn't help, my next suspicion is that you are using a pre-built library that was built with the MinGW bug. I recommend for all packages you should download the source and recompile it on your machine so the compiler settings will match.  It is always frustrating to hunt down a bug that exists because of an incompatibility with a pre-built library. Sometimes there are subtle incompatibilities in reserved space or in reference implementations that are very time consuming to hunt down. That would be my second step if the error persisted. When in doubt about a library, rebuild it from the source.
 
Also I can see that libfreetype-6 is missing from your list, but your application is requiring it. That is another probable sign that your SDL library is pulling in unexpected dependencies. Building from the source can help you identify that as a problem.

0

Share this post


Link to post
Share on other sites

Well the issue is fixed! I just came back to tell you thank you so much for all the help. I did have trouble compiling the .dll myself, so that is not what fixed it for me. I think what finally fixed it was just verifying that both libfreetype-6.dll and zlib.dll in my project folder. They both were, but I copied over them anyway and it works now.

Edited by ChainedHollow
0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0