0

I used the built in NuGet package in visual studio community 2015 in order to download and properly install automatically SDL version 1.2.15.16 for c++. For some reason, when I try to include the SDL.h file, I get the following error:

"LNK 1561 entry point must be defined .... the packages element is not declared" Here is my code:

#include<iostream>
#include <string>
#include "SDL.h"
using namespace std;

int main() {

    cout << "HELLOO" << endl;
    string s;
    cin >> s;
    return 0;
}
Paz_Rosada
  • 11
  • 2
  • What kind of project did you create? – jaredready Nov 12 '15 at 21:38
  • There isn't a "win32 empty project". Make sure you choose just "empty project" and configure linking and search directories yourself. This issue sounds like a project configuration issue. – jaredready Nov 12 '15 at 21:50

1 Answers1

1

Your main function should be defined exactly as:

int main(int argc, char *argv[]) // note function arguments

because SDL library expects it to be in that format.

Petr Abdulin
  • 33,883
  • 9
  • 62
  • 96
  • even when i changed the main function arguments to match those, it still does not work..I get the same link error – Paz_Rosada Nov 16 '15 at 07:53
  • @Paz_Rosada please be sure that you have selected console win32 application for your project. In project properties, go to `Linker`, then `System` and for `SubSystem` it must be set to `Console`. Or try creating new Win32 console application project. – Petr Abdulin Nov 16 '15 at 08:37
  • Ok, this eliminated the error however, now it is saying "warning LNK4098: defaultlib 'msvcrt.lib' conflicts with use of other libs; use /NODEFAULTLIB:library" – Paz_Rosada Nov 18 '15 at 01:09
  • Then when I use /NODEFAULTLIB:library I get a ton of other .lib not found errors. – Paz_Rosada Nov 18 '15 at 02:35
  • See this about resolving this warning: http://stackoverflow.com/questions/3007312/resolving-lnk4098-defaultlib-msvcrt-conflicts-with – Petr Abdulin Nov 18 '15 at 03:04