Jump to content

[Solved] Properly Linking Files In Visual Studio


Shard
 Share

Recommended Posts

Hey guys, I've got a question for something that I should have done a long time ago.

 

I need to link the required engine, framewerk and leo files so that Visual Studio knows where it is.

 

So far, I've been copying those files over to my project directory but every time the engine updates, everything breaks and I get several errors in my code.

 

Previously I've been told that I can fix this by linking my core files in the Leadwerks Directory, but I don't know exactly how to so if someone could show me it would be great.

simpleSigPNG.png

 

Programmer/Engineer/Student

www.reikumar.com

 

2.6 GHz Intel Core Duo - nVidia GeForce 8600 GT - Windows 7 64-bit - 4 Gigs RAM

C++ - Visual Studio Express - Dark GDK - Leadwerks SDK

Link to comment
Share on other sites

Add the patha of <le root>/cpp and <le root>/cpp/leo to the VC++ include directories.

Described here for example.

 

 

Thank you, works perfectly.

 

Although, I still do have to copy over the dll's for engine, newton and jointlibrary.

simpleSigPNG.png

 

Programmer/Engineer/Student

www.reikumar.com

 

2.6 GHz Intel Core Duo - nVidia GeForce 8600 GT - Windows 7 64-bit - 4 Gigs RAM

C++ - Visual Studio Express - Dark GDK - Leadwerks SDK

Link to comment
Share on other sites

Although, I still do have to copy over the dll's for engine, newton and jointlibrary.
No you don't. See the "Shared LE Setup" on Wiki front page.

Ryzen 9 RX 6800M ■ 16GB XF8 Windows 11 ■
Ultra ■ LE 2.53DWS 5.6  Reaper ■ C/C++ C# ■ Fortran 2008 ■ Story ■
■ Homepage: https://canardia.com ■

Link to comment
Share on other sites

Turns out that it that it didn't actually work.

 

When I compile every is fine, but when it goes to link, everything goes to hell.

 

I have several messages like this:

 

1>------ Build started: Project: MyGame, Configuration: Debug Win32 ------
1>Linking...
1>Main.obj : error LNK2019: unresolved external symbol "void __cdecl Flip(int)" (?Flip@@YAXH@Z) referenced in function _WinMain@16
1>Main.obj : error LNK2019: unresolved external symbol "void __cdecl SetBlend(int)" (?SetBlend@@YAXH@Z) referenced in function _WinMain@16
1>Main.obj : error LNK2019: unresolved external symbol "int __cdecl AppSuspended(void)" (?AppSuspended@@YAHXZ) referenced in function _WinMain@16
1>Main.obj : error LNK2019: unresolved external symbol "int __cdecl KeyHit(int)" (?KeyHit@@YAHH@Z) referenced in function _WinMain@16
1>Controls.obj : error LNK2001: unresolved external symbol "int __cdecl KeyHit(int)" (?KeyHit@@YAHH@Z)
1>KeyMouse.obj : error LNK2001: unresolved external symbol "int __cdecl KeyHit(int)" (?KeyHit@@YAHH@Z)
1>Main.obj : error LNK2019: unresolved external symbol "int __cdecl Terminate(void)" (?Terminate@@YAHXZ) referenced in function "public: int __thiscall LEO::Engine::Free(void)" (?Free@Engine@LEO@@QAEHXZ)
1>Main.obj : error LNK2001: unresolved external symbol "private: static int LEO::Engine::instances" (?instances@Engine@LEO@@0HA)
1>Main.obj : error LNK2001: unresolved external symbol "bool LEO::g_engineLoaded" (?g_engineLoaded@LEO@@3_NA)
1>Main.obj : error LNK2019: unresolved external symbol "public: void __thiscall leadwerks::Framewerk::SetStats(int)" (?SetStats@Framewerk@leadwerks@@QAEXH@Z) referenced in function "void __cdecl SetPointers(void)" (?SetPointers@@YAXXZ)
1>Main.obj : error LNK2019: unresolved external symbol "int __cdecl Graphics(int,int,int,int,int)" (?Graphics@@YAHHHHHH@Z) referenced in function "public: void __thiscall LEO::Engine::InitGraphics(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,int,int,int,int,int)" (?InitGraphics@Engine@LEO@@QAEXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@HHHHH@Z)
1>Main.obj : error LNK2019: unresolved external symbol "void __cdecl SetAppTitle(char *)" (?SetAppTitle@@YAXPAD@Z) referenced in function "public: void __thiscall LEO::Engine::InitGraphics(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,int,int,int,int,int)" (?InitGraphics@Engine@LEO@@QAEXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@HHHHH@Z)
1>Main.obj : error LNK2019: unresolved external symbol "int __cdecl Initialize(int)" (?Initialize@@YAHH@Z) referenced in function "private: bool __thiscall LEO::Engine::LoadFunctions(int)" (?LoadFunctions@Engine@LEO@@AAE_NH@Z)
1>Main.obj : error LNK2019: unresolved external symbol "public: __thiscall leadwerks::Framewerk::Framewerk(void)" (??0Framewerk@leadwerks@@QAE@XZ) referenced in function "void __cdecl `dynamic initializer for 'frameWerk''(void)" (??__EframeWerk@@YAXXZ)
1>Controls.obj : error LNK2019: unresolved external symbol "public: unsigned char * __thiscall leadwerks::Layer::GetCamera(void)" (?GetCamera@Layer@leadwerks@@QAEPAEXZ) referenced in function "public: void __thiscall Controls::UpdatePlayerControls(void)" (?UpdatePlayerControls@Controls@@QAEXXZ)
1>Player.obj : error LNK2001: unresolved external symbol "public: unsigned char * __thiscall leadwerks::Layer::GetCamera(void)" (?GetCamera@Layer@leadwerks@@QAEPAEXZ)

 

 

Attached are the pictures of how I linked the files. Can anyone tell me what I did wrong?

post-26-12731717563165_thumb.jpg

simpleSigPNG.png

 

Programmer/Engineer/Student

www.reikumar.com

 

2.6 GHz Intel Core Duo - nVidia GeForce 8600 GT - Windows 7 64-bit - 4 Gigs RAM

C++ - Visual Studio Express - Dark GDK - Leadwerks SDK

Link to comment
Share on other sites

You didn't add the cpp files to your project (where main.cpp also is).

 

 

I just added it to the project via the Solution Explorer which worked.

 

This would be the best way right? So that when I update, all the files are auto updated and I don't have to move them.

simpleSigPNG.png

 

Programmer/Engineer/Student

www.reikumar.com

 

2.6 GHz Intel Core Duo - nVidia GeForce 8600 GT - Windows 7 64-bit - 4 Gigs RAM

C++ - Visual Studio Express - Dark GDK - Leadwerks SDK

Link to comment
Share on other sites

The files are on disk, you only see links to them in the project.

 

 

Sweet thanks.

simpleSigPNG.png

 

Programmer/Engineer/Student

www.reikumar.com

 

2.6 GHz Intel Core Duo - nVidia GeForce 8600 GT - Windows 7 64-bit - 4 Gigs RAM

C++ - Visual Studio Express - Dark GDK - Leadwerks SDK

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...