0

I have a large amount of code, so I have tried to only include the relevant parts of the code here

I have another file called "P.cpp". This compiled fine before, until I tried to include the new files. Now I get undefined reference errors.

I have included the relevant parts of the CMakeLists to see if anyone can help

in arthur/CMakeLists.txt:

SET(NLL
  NE
  ..
  s
  L
)

SET(NLL ${NLL}
  B
  ..
)

ADD_EXECUTABLE (NE MACOSX_BUNDLE ${SOURCE_FILES} ${INCLUDE_FILES})
TARGET_LINK_LIBRARIES(NE${NLL})

and in /arthur/CMakeLists.txt:

ADD_SUBDIRECTORY (U)
ADD_SUBDIRECTORY (s)
ADD_SUBDIRECTORY (LB)
...
ADD_SUBDIRECTORY(NE)

I just modified the CMakeLists so that it ordered directories based on the order they should be compiled. I was able to get rid of most of the "undefined reference errors" this way, but have one left. The undefined reference message is referring to a function that has an undefined reference to another function.

However, since I can't open that cpp.o file, how can I know what is wrong?

user4352158
  • 731
  • 4
  • 13
  • 24
  • 1
    The error isn't with any object file symbols but it is an error in the cmake files resulting from a dependency not being available. I'm certainly not an cmake expert (I barely managed to get my own library to compile and link cmake) but it seesm you'll missing the library definition for `split`. – Dietmar Kühl Dec 15 '14 at 23:23
  • Something like this looks plausible. As I said, I'm not a cmake expert, though: it is merely what I would try. – Dietmar Kühl Dec 15 '14 at 23:49
  • when I tried that, i got the same error messages that I already listed – user4352158 Dec 16 '14 at 00:37
  • It seems you have two `add_library()` calls for `PourBowl2` target. Could you post whole `CMakeLists.txt` source? – arrowd Dec 16 '14 at 08:34

0 Answers0