Domanda

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

È stato utile?

Soluzione

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.

Altri suggerimenti

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 ?

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top