2

Take the following error:

Error   2   error LNK1120: 1 unresolved externals   c:\users\james\documents\visual studio 2013\Projects\PlatformGameEngine\Debug\PlatformGameEngine.exe    1   1   PlatformGameEngine
Error   1   error LNK2001: unresolved external symbol "public: virtual void __thiscall PlatformGameEngine::IOS::CreateWindow(class PlatformGameEngine::WindowProperties)" (?CreateWindow@IOS@PlatformGameEngine@@UAEXVWindowProperties@2@@Z)    c:\Users\James\documents\visual studio 2013\Projects\PlatformGameEngine\PlatformGameEngine\App.obj  PlatformGameEngine

What are the ? and @ signs demonstrating in this compiler error?

Jimmyt1988
  • 20,466
  • 41
  • 133
  • 233
  • I am finding that this error is not helping me much to find out where I have missed the cpp file... Any pro tips? – Jimmyt1988 Apr 17 '15 at 00:09
  • 3
    @Jimmyt1988: So you're really asking us how to fix your undefined reference lol. Not sure what you mean by "where". It's _nowhere_. That's the problem. You did not define `PlatformGameEngine::IOS::CreateWindow` in a C++ source file linked into your project. – Lightness Races in Orbit Apr 17 '15 at 00:11
  • My problem is i have been spoilt with c# errors.. it's going to take me some time to adjust. Thanks for your help! Ohhhhhh yesss of courseee... Thank you very much!!! Noted for future expected errors. Cheers dudette! – Jimmyt1988 Apr 17 '15 at 00:12
  • Obviously not a duplicate of that. Not in its current form, anyway. I did try to find a decent name mangling dupe but there wasn't one. – Lightness Races in Orbit Apr 17 '15 at 00:16
  • @LightningRacisinObrit: Even you obviously know it's really about the unresolved external, as made clear your earlier comment: "So you're really asking us how to fix your undefined reference". – Jerry Coffin Apr 17 '15 at 00:34
  • 2
    To clarify, this question is specifically to do with the ? and @. I wanted to know what they were for as they come up alot and i never understood their meaning. – Jimmyt1988 Apr 17 '15 at 00:36
  • 1
    This [tool](http://d.fuqu.jp/c++filtjs/) might be helpful in the future. – Rapptz Apr 17 '15 at 00:44

1 Answers1

2

That is the internal, or "mangled", name for your function. It is written in an unambiguous language that your computer uses to uniquely identify the function within your program, and across any libraries that may be linked in at build-time or at run-time.

Lightness Races in Orbit
  • 378,754
  • 76
  • 643
  • 1,055
  • Ah i see! I was wondering if it was going to help me out more with my error, good to know what they mean finally! – Jimmyt1988 Apr 17 '15 at 00:15
  • Not "your computer", but compiler and linker. "Computer" (that is, CPU) couldn't care less about how functions are called, it deals with addresses. – n0rd Apr 17 '15 at 00:50
  • @n0rd: The computer executes the compiler, and it executes the linker. Your pedantry is amusing but ill-placed. – Lightness Races in Orbit Apr 17 '15 at 10:30
  • Computer executes a lot of things. It does not mean it "wants" whatever those things "want". There is a clear distinction between hardware and software and for software developer it is dangerous to mix it up. – n0rd Apr 17 '15 at 17:24
  • @n0rd: What the heck mate – Lightness Races in Orbit Apr 17 '15 at 17:26