2

I've been trying to compile tulip using cmake to generate visual studio 2012 project files. It's giving me lots of trouble. I don't know how to get this to build. I've been trying to get visual studio to build this for 4 days now, and I'm extremely frustrated. Essentially, I follow the steps here, and then set the variables CMAKE_LIBRARY_PATH AND CMAKE_INCLUDE_PATH according to these instructions.

To get to where I'm at, all you have to do is download tulip, and:

  1. Unzip it, create a separate build directory outside of this source directory
  2. Open CMake-gui to the source and build directories
  3. Hit configure. Check use qt5, tell it where qmake is (make sure it's qt5)
  4. You need some dependencies as described in The Independent CMake tutorial. Grab all those dependencies
  5. As you continue to hit configure, specify each of the directories that it asks for as it errors out. It should ask for freetype, glew, zlib and sphinx. It shouldn't ask for where libxml or libpng, or libjpeg are. I don't know why it doesn't ask for those.
  6. Generate, and then browse to the ALL_BUILD that you've generated. Open it with visual studio
  7. try to build it with visual studio.

In those instructions and in the process of getting CMake to generate the visual studio build files, it specifically asks for freetype's location. But in my build, it doesn't have a clue how to link the freetype library.

Here are the errors that I get

Here is my CMakeCached.txt

I know that many people aren't going to want to exactly try and go about replicating the build environment, so I've uploaded my build directory to dropbox. You can pull the entire thing down, and then open it in cmake gui and open the visual studio files in there too. https://www.dropbox.com/sh/qsvukh9t5gb6bvt/tOfOBxWgd0

Adam Miller
  • 1,756
  • 1
  • 25
  • 44
  • Can't seem to download the zip file (Get a 'Failed to download zip file' error message). Do I need dropbox for this? – Patrik Svensson Sep 16 '13 at 09:55
  • Well I don't know why you would get that error. When I click the tulip_src.zip link it downloads fine... here's another link: http://sourceforge.net/projects/auber/files/tulip/tulip_4.3.0/ – Adam Miller Sep 16 '13 at 10:13

2 Answers2

1

The linker errors you point to (mostly "unresolved external" errors) indicate that there are missing libraries on the link command line.

That is most likely happening because target_link_libraries calls in the tulip project are either being skipped or being called with library names that do not match the library names on disk.

Open up the solution in Visual Studio and right click the project and choose "Properties" -- look at the "Linker > Input" panel at the "Additional Dependencies" field. That should list all the libraries it wants to link to. Is there a freetype library listed there? Does that library exist in the referenced location on your disk?

There could be a mistake in the tulip project, or there could just be something wrong with your build/install of freetype...

UPDATE AFTER SOME CHAT:

Or it may be that you have some libraries built for x86 and some for x64... or maybe some for Debug and some for Release... or maybe even some with the MinGW compiler and some with the Visual Studio compiler. If that's the case, start over, from a clean slate, and build everything with a consistent compiler, configuration type and architecture. Then report back again with an update and see if the problems still remain.

DLRdave
  • 13,876
  • 4
  • 53
  • 70
  • Are you doing everything as the same user, in a directory of your own? Or are there some things that are trying to "install" under "C:\Program Files" or something? You didn't mention ACCESS_DENIED in your question here... Usually, it's best to try to simplify things and start with the very first error message you see. Get rid of that one, and try again. What's the very first error you encounter in this whole process? – DLRdave Sep 16 '13 at 16:17
  • Yes, it's all as the same user. And you can see a list of all my errors in the post as a link. Here's the link again: http://codepad.org/jH2mm0Ar – Adam Miller Sep 16 '13 at 16:42
  • http://stackoverflow.com/questions/4256524/lnk1318-unexpected-pdb-error-ok-0 or http://social.msdn.microsoft.com/Forums/vstudio/en-US/9e58b7d1-a47d-4a76-943a-4f35090616e8/link-fatal-error-lnk1318 ? Or some other Google hit? – DLRdave Sep 16 '13 at 16:56
  • Sorry for missing the ACCESS_DENIED in there on my first pass. I would fix the first errors first, and then see if those remain before worrying about them..... – DLRdave Sep 16 '13 at 16:57
  • Actually, now that I'm at my workstation where I do this, I'm finding that the exact set of steps you described don't give me a Linker > input" panel or an additional dependencies. Here's what I see: http://imgur.com/VmVYE7U, and then http://imgur.com/oejjMpn – Adam Miller Sep 16 '13 at 18:40
  • Also, my build properties is kind of messed up: http://imgur.com/V3gMe3N there's no linker portion... – Adam Miller Sep 16 '13 at 18:48
  • let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/37486/discussion-between-dlrdave-and-adam-miller) – DLRdave Sep 16 '13 at 22:50
0

I do with Dave,

You should try to fix your error 1 by 1. The first error seems to be a link error:

Error   1   error LNK2019: unresolved external symbol gzread referenced in function "public: virtual int __cdecl gzstreambuf::underflow(void)" (?underflow@gzstreambuf@@UEAAHXZ)    C:\Users\kenne_000\tulip-build\tulip-build-debug\thirdparty\gzstream\gzstream.obj   gzstream

gzstream is a third party lib included with tulip source in:

thirdparty\gzstream

from

thirdparty\gzstream\CMakeLists.txt

you can see that the missing symbols should be coming from ZLIB. However your CMakeCache.txt indicate that

ZLIB_LIBRARY:FILEPATH=C:/Users/kenne_000/dependencies/zlib128-dll/lib/zdll.lib

is found.

So the question may be, was this dependency compiled with the same compiler? Don't you have compiler-specific name mangling issue ?

Erk
  • 66
  • 1
  • 3
  • You may be right. I accepted the one that was already compiled, and I can't know what it was compiled with. Some of the locations I specified, like freetype, have directories indicating they're compiled with VS 2010. Indeed, I even recompiled freetype with VS 2010. It still doesn't work. On another note, some of the directories make it seem that some libraries are 32 bit. I'm trying to compile it at 64 bit. I'm not sure what does and doesn't affect things. – Adam Miller Sep 16 '13 at 20:36
  • I now found that if I open the freetype solution file, I can build it with VS 2012. It built with 2012. Then I went back to building the original project, and it stil misses Freetype. – Adam Miller Sep 16 '13 at 20:57