Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LNK2019 / LNK2001 / LNK1120 Error [VS2017] #206

Closed
Raigiku opened this issue Mar 11, 2018 · 8 comments
Closed

LNK2019 / LNK2001 / LNK1120 Error [VS2017] #206

Raigiku opened this issue Mar 11, 2018 · 8 comments

Comments

@Raigiku
Copy link

Raigiku commented Mar 11, 2018

After installing entityx and adding the SFML sample file found here: https://github.com/alecthomas/entityx/blob/master/examples/example.cc
I get this error:
image
When I double click it, it leads me to the Entity.h file and to line 464:
image

@alecthomas
Copy link
Owner

I don't have VS, and an internal compiler error isn't something I can do a lot about...

@alecthomas
Copy link
Owner

Have you installed all of the latest SV updates, including spot patches?

@Raigiku
Copy link
Author

Raigiku commented Mar 11, 2018

Ok that fixed it but now I have these problems:
image
I think it has to do with linking libs but I don't really know how should I do it with the ones from entiyx or how they work. Those aren't .lib like in SFML. I have libentityx.dll.a / entityx.pc / libentityx.dll. Sorry for being a noob in this lol

@v7medz
Copy link

v7medz commented Mar 12, 2018

It looks like you don't have EntityX .cpp files (all those functions are defined in them).

@Raigiku
Copy link
Author

Raigiku commented Mar 12, 2018

Well, when I finished installing it with CMake and make I get 3 folders and no .cpp files:
bin
--libentityx.dll
include
--entityx
image
lib
--pkgconfig
----entityx.pc
--libentityx.dll.a
I've only added the include folder to the Additional Include Directories of my Visual Studio project. I've also added the lib folder to the Additional Library Directories and the libentityx.dll to the path where the .exe is suppose to be generated. The folder (.zip) that I downloaded is the one from the github repository.

@Raigiku Raigiku changed the title An internal error has ocurred in the compiler [VS2017] LNK2019 / LNK2001 / LNK1120 Error [VS2017] Mar 12, 2018
@gale93
Copy link

gale93 commented Mar 13, 2018

If you want the .lib files, build with cmake ENTITYX_BUILD_SHARED disabled
Then you go build the entityx.sln and generating the lib ( You found them in Release and Debug folder )

So now you go back in your project and:

[All Configuration] C/C++ / Additional Include Directories entityx folder where .h files are.
[All Configuration] Linker / Additional Library Directories create a folder "lib" and put the 2 libs u got from generating ( entityx.lib, entityx-d.lib ) and set that path

[DEBUG] Linker / input add entityx-d.lib
[RELEASE] Linker / input add entityx.lib

And there you go.

I can attach mine here but are compiled with /MT and /MTd because i need the project work with RakNet files, so if you want to use them you have to change these flag under C/C++ / Code generation / runetime lib. lib.zip

P.s.: No need to define M_PI, just #define _USE_MATH_DEFINES before include cmath.

@Raigiku
Copy link
Author

Raigiku commented Mar 18, 2018

Thanks, that worked!

@alecthomas
Copy link
Owner

Thanks @gale93 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants