0

I borrowed a C++ programming book from my local Library and decided to have a read. Turns out it uses SSDL to code. So i downloaded SSDL and decided to follow along the book. However, when i first compiled and ran my code, this error message popped up.

1>D:\C++ Coding proj\Coding by myself (own projects)\SSDLcode\SSDLcode\main.cpp(11,2): warning 
C4551: function call missing argument list
1>main.obj : error LNK2001: unresolved external symbol "class std::basic_ostream<char,struct s 
td::char_traits<char> > sout" (?sout@@3V?$basic_ostream@DU?$char_traits@D@std@@@std@@A)
1>D:\C++ Coding proj\Coding by myself (own projects)\SSDLcode\x64\Debug\SSDLcode.exe : fatal 
error LNK1120: 1 unresolved externals

Entire error message here, if that helps. (from Build Output)

Build started...
1>------ Build started: Project: SSDLcode, Configuration: Debug x64 ------
1>main.cpp
1>D:\C++ Coding proj\Coding by myself (own projects)\SSDLcode\SSDLcode\main.cpp(11,2): warning 
C4551: function call missing argument list
1>main.obj : error LNK2001: unresolved external symbol "class std::basic_ostream<char,struct 
std::char_traits<char> > sout" (?sout@@3V?$basic_ostream@DU?$char_traits@D@std@@@std@@A)
1>D:\C++ Coding proj\Coding by myself (own projects)\SSDLcode\x64\Debug\SSDLcode.exe : fatal 
error LNK1120: 1 unresolved externals
1>Done building project "SSDLcode.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

since I am new to SSDL, i have no idea what these mean.

In the Additional Library Directories section, I put my Libraries as x64. But my Visual Studio compiler codes on x86(is 32-bit, i believe). x86

so i changed the x86 to x64 and ran the code again. Then the error message showed.

Here is my code.

#include "SDL.h"
#include "SSDL.h"

int main(int argc, char** argv)
{



    sout << "Hello, world! (Press any key to quit)\n";

    SSDL_WaitKey;







    return 0;



}

would there be a solution to solve the LNK1120 error?

Botje
  • 26,269
  • 3
  • 31
  • 41
cyntanic
  • 13
  • 2
  • 1
    What is `sout`? What is `SSDL_WaitKey`? What is the statement `SSDL_WaitKey;` supposed to do? It seems you need to spend more time with [some good books](https://stackoverflow.com/questions/388242/the-definitive-c-book-guide-and-list) and perhaps take a few classes. – Some programmer dude Jun 21 '21 at 07:21
  • I had to do a bit of searching to find the SSDL you mentioned, it is part of [this GitHub repository](https://github.com/Apress/cpp-for-lazy-programmers/tree/master/external/SSDL). – Botje Jun 21 '21 at 07:22
  • Please verify that you built SDDL in the x64-Debug flavor, that your current project is also using that flavor, and that your Linker Inputs dialog references the .dll file that was created in your project. – Botje Jun 21 '21 at 07:24
  • By the way, do you actually *link* with the library? Including a header file isn't enough, there should be a `.lib` file that you need to link with as well. – Some programmer dude Jun 21 '21 at 07:58

0 Answers0