Page 1 of 2

Minetest-C55 :: fatal error LNK1120: 15 unresolved externals

Posted: Tue Apr 12, 2011 9:34 am
by owen_a
Hello all.

I didn't know where to post my thread, since it was about Minetest. But I hope it is ok here since this can be a general programming error as well.

OK, basically I have downloaded Minetest from: http://celeron.55.lt/~celeron55/minetes ... -win32.zip

Website: http://celeron.55.lt/~celeron55/minetest/index

I have read the README.txt to set everything up correctly. Now, when I come to compile it everytime, I get this error when it tries and links, and make the .exe:

Code: Select all

fatal error LNK1120: 15 unresolved externals
My BuildLog is hosted on my server. You can view the buildlog by going here: http://94.170.202.56/BuildLog.htm

I am using MSVC C++ 2005, since this was the application what the minecraft.sln brought me to when I opened it.

Can anyone help me?

Thanks!

- Owen

EDIT: I have just compiled it again, and i cannot remember what i did, but i get this new error now:

Code: Select all

Linking...
LINK : fatal error LNK1104: cannot open file 'zlibwapi.lib'
EDIT: After setting the path to zlibwapi.lib I get the same 15 unresolved external errors as before.

Posted: Tue Apr 12, 2011 1:08 pm
by CuteAlien
Unresolved externals is a linker error and means you didn't link to some needed library (or object files). But unless you show us _which_ externals are missing we can't really tell you which library that is :-)

Posted: Tue Apr 12, 2011 1:33 pm
by Sylence
There is a link to the BuildLog: http://94.170.202.56/BuildLog.htm ;)

Posted: Tue Apr 12, 2011 2:02 pm
by owen_a
I gave you the BuildLog though. It should be at the bottom which tells you the externals.

EDIT:you beat me to it Sylence :D

Posted: Tue Apr 12, 2011 2:52 pm
by CuteAlien
Ok, did overlook that. Not sure if that is a library, rather looks like there's a cpp-file missing in the project file. Check if those functions are in some .cpp files and if so add them to the project file.

Posted: Tue Apr 12, 2011 4:06 pm
by owen_a
I don't understand :?:

Posted: Tue Apr 12, 2011 4:11 pm
by serengeor
owen_a wrote:I don't understand :?:
He said it clearly enough..
The project has header file which has function declarations but their definitions are missing because some *.cpp file is not included into project. This could cause unresolved externals error.

Posted: Tue Apr 12, 2011 6:09 pm
by owen_a
Does this game compile fine for you? (i'm checking for any missing .cpp files now)

Posted: Tue Apr 12, 2011 6:24 pm
by serengeor
owen_a wrote:Does this game compile fine for you? (i'm checking for any missing .cpp files now)
I haven't really tried to compile it, though i have downloaded the sources, but only to see how it does some things, and still didn't have much time to look at them.

Posted: Tue Apr 12, 2011 6:58 pm
by owen_a
I've included alot of header file (.h) to the project which where inside the project folder and wernt in the project solution. I still get the same ammount of errors and the same external errors. Time to see if there are any .cpp files which might fix the problem.

Posted: Wed Apr 13, 2011 3:10 am
by owen_a
Ok. I've finished adding in all the missing Header and Source Files. Now when I added the missing source files which weren't inside of the solution to begin with, I now have 11 errors and 8 warnings.

Build Log is here: http://94.170.202.56/BuildLog.htm

I don't know if you know this, but in order to compile minetest, you have to have some third party sources. For this, I had to download zlib125dll, and zlib-1.2.5, and irrlicht-1.7.2. With all the include, library directory's inside MSVC itself.

I've ran out of ideas now. Any Ideas? :?

Posted: Wed Apr 13, 2011 8:23 am
by CuteAlien
You seem to have 2 main functions now. I don't know the project at all, but I guess it uses some client/server model so you would have 2 executables. Which means you also have 2 project files. So you shouldn't have servermain and main in the same project file.

But why don't you ask the author of that project? He can probably help you faster.

Posted: Wed Apr 13, 2011 10:15 pm
by owen_a
I already ave. I gave him the latest buildlog, and explained like i did in this thread. I know Celeron-55 has an account here. Should I PM him? or wait for the email I sent him? (Google Mail wise)

Posted: Wed Apr 13, 2011 10:26 pm
by CuteAlien
Well, it's as serengeor described. Unresolved externals means that a function is declared in a header, but the corresponding function definition itself is missing. So go back to what you had originally. And this time just add the .cpp files which contain functions with exactly those names which are mentioned as unresolved externals.

Posted: Thu Apr 14, 2011 12:39 am
by owen_a
So could the header files be causing this problem?