Error Lnk2019 Unresolved External Symbol _sdl_main Referenced In Function _main
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Resolving error LNK2019; unresolved external symbol up vote 0 down vote favorite 1 I have written this code using SDL but there are some errors. This is the code #include
and how can i fix this i am using visual studio check the code : 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include
topic ForumsMembersHelp Files Developer Journals Gallery Calendar Downloads Resources Store http://www.gamedev.net/topic/376205-defeating-sdl-linker-errors-in-visual-studio-net/ Classifieds Tracker Links Home For Beginners Articles All Articles Post http://trac.wildfiregames.com/ticket/3138 an Article Technical Game Programming General Programming Graphics Programming and Theory DirectX and XNA OpenGL and Vulkan Multiplayer and Network Programming Artificial Intelligence Math and Physics Mobile Development Middleware, Libraries, and Tools Virtual and Augmented Reality Creative Game Design error lnk2019 Music and Sound Visual Arts Business Breaking into the Industry Production and Management Interviews Business and Law Event Coverage Forums All Forums Technical Game Programming General Programming Graphics Programming and Theory DirectX and XNA OpenGL & Vulkan Multiplayer and Network Programming Artificial Intelligence Math and Physics Mobile & Console Development error lnk2019 unresolved Build Systems & Source Control Middleware, Libraries, and Tools Virtual and Augmented Reality Creative Game Design Writing For Games Music and Sound Visual Arts Gallery Business Breaking into the Industry Business & Law Production & Management Community GDNet Lounge Coding Horrors Article Writing Comments, Suggestions and Ideas Your Announcements Hobby Project Classifieds Indie Project Showcase Community Developer Journals GDNet+ Subscriptions Gallery Store Classifieds Jobs Freelancers Hobby Projects Marketplace Newsletter » Home » Forums » The Technical Side » Middleware, Libraries, and Tools Chat Watched Content New Content 0 Defeating SDL linker errors in Visual Studio .NET Started by socrates200X, Feb 16 2006 06:10 PM Old topic! Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic. You cannot reply to this top
modified 5 months ago #3138 closed defect (fixed) [PATCH] SDL 2.0.4 devel version breaks Windows build Reported by: historic_bruno Owned by: historic_bruno Priority: Should Have Milestone: Alpha 20 Component: Core engine Keywords: patch Cc: Description I tested the latest SDL 2.0.4 dev copy from Hg, and there are various Windows build errors related to the main() function. For one thing, we no longer need to define a wmain() function to convert cl arguments to UTF-8, SDL2 does that. Then, the test suite is broken: 1>------ Build started: Project: test, Configuration: Release Win32 ------ 1> test_root.cpp 1>SDL2main.lib(SDL_windows_main.obj) : error LNK2005: _main already defined in test_root.obj 1> Creating library ..\..\..\binaries\system\test.lib and object ..\..\..\binaries\system\test.exp 1>SDL2main.lib(SDL_windows_main.obj) : error LNK2019: unresolved external symbol _SDL_main referenced in function _main_utf8 1>..\..\..\binaries\system\test.exe : fatal error LNK1120: 1 unresolved externals I was able to fix this by manually adding #include "lib/external_libraries/libsdl.h" to test_root.cpp, but I don't know how that file is generated or if this might break older SDL versions. Attachments (2) wseh.cpp.patch (1.0 KB) - added by historic_bruno 19 months ago. sdl2.0.4-win-fixes.patch (2.4 KB) - added by historic_bruno 19 months ago. Download all attachments as: .zip Oldest first Newest first Threaded Comments only Change History (11) Changed 19 months ago by historic_bruno Attachment wseh.cpp.patch added Changed 19 months ago by historic_bruno Attachment sdl2.0.4-win-fixes.patch added comment:1 Changed 19 months ago by historic_bruno leper pointed me in the right direction for the tests error, I needed to add an include in premake4.lua. The new patch has a little more cleanup for wseh.cpp. comment:2 Changed 19 months ago by leper I guess we could also remove the MAIN_STARTUP define now (I really think we should just rip ICC related code out since it hasn't been tested in years and likely is broken, but that would be another ticket). Apart from that the patch looks go