Arx Libertatis Bug Tracker
star_faded.png
Please log in to bookmark issues
bug_report_small.png
CLOSED  Bug report #620  -  Fatal compiling errors on Mac OS X 10.9.2
Posted Mar 16, 2014 - updated Jan 03, 2017   Shortlink: http://arx.vg/620
action_vote_minus_faded.png
0
Votes
action_vote_plus_faded.png
icon_info.png This issue has been closed with status "Not a bug" and resolution "CAN'T REPRODUCE".
Issue details
  • Type of issue
    Bug report
  • Status
     
    Not a bug
  • Assigned to
    Not assigned to anyone
  • Type of bug
    Not triaged
  • Likelihood
    Not triaged
  • Effect
    Not triaged
  • Posted by
     Guest user
  • Owned by
    Not owned by anyone
  • Estimated time
    Not estimated
  • Category
    Not determined
  • Resolution
    CAN'T REPRODUCE
  • Priority
    Not determined
  • Reproducability
    Always
  • Severity
    Not determined
  • Targetted for
    icon_milestones.png Not determined
  • OS
    icon_customdatatype.png Not determined
  • Architecture
    icon_customdatatype.png Not determined
  • Fixed in
    icon_customdatatype.png Not determined
Issue description
While compiling Arc Libertatis on my mid-2011 iMac running OS X 10.9.2, I run into a number of problems. The first problem is that it can't detect my installation of SDL2, but it's not a fatal error. The first three fatal errors I can fix pretty easily (Dialog.mm enum DialogType & SDL2Window.h and SDL2InputBackend.h #include <SDL/SDL.h>), but the last one I can't. The fatal error is "Linking CXX executable arx" "Undefined symbols for architecture x86_64". I believe it has something to do with my GLEW, SDL, or SDL2 libraries, but I'm not advanced enough of a coder to know for sure. Specifics of the issue can be found in the Reproduction steps section.
Steps to reproduce this issue
Compile Arc Libertatis as it appears in the GitHub repository on March 15, 2014 on a Mac running Mavericks with all the required libraries installed, cd to the ArcLibertatis directory, run cmake.., then run sudo make and follow the following steps: The first problem is that, no matter how much I install SDL2, it always gives me the following message after running cmake .. :
  1. -- checking for module 'sdl2'
  2. -- package 'sdl2' not found


Also, it gives me a number of fatal errors during the build process (using the command sudo make), the first of which is:
  1. [ 9%] Building CXX object CMakeFiles/common.dir/src/platform/Dialog.mm.o
  2. /Users/Shared/ArxLibertatis/src/platform/Dialog.mm:28:17: error: unknown type name
  3. 'DialogType'; did you mean 'DialogTPtr'?


I was able to rectify this by adding the following code to line 27 of Dialog.mm:
  1. enum DialogType {
  2. DialogInfo,
  3. DialogWarning,
  4. DialogError,
  5. DialogYesNo,
  6. DialogOkCancel
  7. };
After building again I received a number of fatal errors starting with:
  1. [ 20%] Building CXX object CMakeFiles/arx.dir/src/core/ArxGame.cpp.o
  2. In file included from /Users/Shared/ArxLibertatis/src/core/ArxGame.cpp:143:
  3. /Users/Shared/ArxLibertatis/src/window/SDL2Window.h:57:2: error: unknown type name
  4. 'SDL_Window'; did you mean 'SDL2Window'?


Which I was able to rectify by changing line 23 of SDL2Window.h and SDL2InputBackend.h from #include <SDL.h> to #include <SDL/SDL.h>.

After this, I get the following fatal error which I have not been able to rectify:

  1. [ 7%] Built target ArxIO
  2. [ 9%] Built target _arx_arxsavetool_common
  3. [ 20%] Built target common
  4. Scanning dependencies of target arx
  5. [ 20%] Building CXX object CMakeFiles/arx.dir/src/core/ArxGame.cpp.o
  6. [ 20%] Building CXX object CMakeFiles/arx.dir/src/input/SDL2InputBackend.cpp.o
  7. [ 21%] Building CXX object CMakeFiles/arx.dir/src/window/SDL2Window.cpp.o
  8. Linking CXX executable arx
  9. Undefined symbols for architecture x86_64:
  10. "_main", referenced from:
  11. implicit entry/start for main executable
  12. (maybe you meant: __ZN10SDL2Window12s_mainWindowE, _SDL_main , _main_conversation , _mainApp )
  13. ld: symbol(s) not found for architecture x86_64
  14. clang: error: linker command failed with exit code 1 (use -v to see invocation)
  15. make[2]: *** [arx] Error 1
  16. make[1]: *** [CMakeFiles/arx.dir/all] Error 2
  17. make: *** [all] Error 2

#1
icon_reply.pngReply
Comment posted by
 Guest user
Mar 16, 18:33
Please post the cmake output when it is run for the first time on a clean build directory.
#4
icon_reply.pngReply
Comment posted by
 Daniel Scharrer
Mar 16, 18:42
Arc Libertatis


"Arx Libertatis" ;-)

using the command sudo make


Why are you compiling as the super user? At most the make install part should be done with elevated privileges.

DialogType


Fixed, thanks for reporting.

Which I was able to rectify by changing line 23 of SDL2Window.h and SDL2InputBackend.h from #include <SDL.h> to #include <SDL/SDL.h>.


That's a workaround, not a fix. We should figure out why CMake didn't find your SDL 2 install. The complete cmake output will hopefully help here. What is the exact SDL version and package type (binaries from libsdl.org, macports, ...) you are using? Where are the libraries and headers installed?
#5
icon_reply.pngReply
Comment posted by
 Guest user
icon_reply.pngMar 16, 21:36, in reply to comment #1
Guest user wrote:
Please post the cmake output when it is run for the first time on a clean
build directory.


  1. cmake ..
  2. -- The C compiler identification is Clang 5.1.0
  3. -- The CXX compiler identification is Clang 5.1.0
  4. -- Check for working C compiler: /usr/bin/cc
  5. -- Check for working C compiler: /usr/bin/cc -- works
  6. -- Detecting C compiler ABI info
  7. -- Detecting C compiler ABI info - done
  8. -- Check for working CXX compiler: /usr/bin/c++
  9. -- Check for working CXX compiler: /usr/bin/c++ -- works
  10. -- Detecting CXX compiler ABI info
  11. -- Detecting CXX compiler ABI info - done
  12. -- Checking compiler flag: -Wall
  13. -- Checking compiler flag: -Wextra
  14. -- Checking compiler flag: -Wformat=2
  15. -- Checking compiler flag: -Wundef
  16. -- Checking compiler flag: -Wpointer-arith
  17. -- Checking compiler flag: -Wcast-qual
  18. -- Checking compiler flag: -Woverloaded-virtual
  19. -- Checking compiler flag: -Wlogical-op - unsupported (warning)
  20. -- Checking compiler flag: -Woverflow
  21. -- Checking compiler flag: -Wliteral-conversion
  22. -- Checking compiler flag: -Wshift-overflow
  23. -- Checking compiler flag: -Wbool-conversions
  24. -- Checking compiler flag: -Wno-uninitialized
  25. -- Checking compiler flag: -Wno-constant-logical-operand
  26. -- Checking compiler flag: -Wno-undef
  27. -- Checking compiler flag: -g2
  28. -- Found PythonInterp: /usr/bin/python (found version "2.7.5")
  29. -- Looking for include file pthread.h
  30. -- Looking for include file pthread.h - found
  31. -- Looking for pthread_create
  32. -- Looking for pthread_create - found
  33. -- Found Threads: TRUE
  34. -- Found Freetype: /opt/local/lib/libfreetype.dylib (found version "2.5.3")
  35. -- Checking Freetype: /opt/local/lib/libfreetype.dylib
  36. -- Found ZLIB: /usr/local/lib/libz.dylib (found version "1.2.5")
  37. -- Checking ZLIB: /usr/local/lib/libz.dylib
  38. -- Found OpenGL: /System/Library/Frameworks/OpenGL.framework
  39. -- checking for module 'glew'
  40. -- found glew, version 1.10.0
  41. -- Found GLEW: /opt/local/lib/libGLEW.dylib
  42. -- Checking OpenGL: /System/Library/Frameworks/OpenGL.framework
  43. -- Checking GLEW: /opt/local/lib/libGLEW.dylib
  44. -- Found OpenAL: /System/Library/Frameworks/OpenAL.framework (Required is at least version "1.1")
  45. -- Found OpenALEFX: /usr/local/include/AL
  46. -- Checking OpenAL: /System/Library/Frameworks/OpenAL.framework
  47. -- checking for module 'sdl2'
  48. -- package 'sdl2' not found
  49. -- Found SDL2: /Library/Frameworks/SDL2.framework
  50. -- Checking SDL2: /Library/Frameworks/SDL2.framework;-framework Cocoa
  51. -- Boost version: 1.55.0
  52. -- Found GLM: /opt/local/include
  53. -- Found Doxygen: /opt/local/bin/doxygen (found version "1.8.5")
  54. -- Checking compiler flag: -std=c++11
  55. -- Checking compiler flag: -fvisibility=hidden
  56. -- Checking compiler flag: -fvisibility-inlines-hidden
  57. -- Checking compiler feature: __builtin_trap
  58. -- Checking compiler feature: __attribute__((format(printf, i, j)))
  59. -- Looking for nanosleep
  60. -- Looking for nanosleep - found
  61. -- Looking for pthread_setname_np
  62. -- Looking for pthread_setname_np - found
  63. -- Looking for prctl
  64. -- Looking for prctl - not found
  65. -- Looking for uname
  66. -- Looking for uname - found
  67. -- Looking for getrusage
  68. -- Looking for getrusage - found
  69. -- Looking for popen
  70. -- Looking for popen - found
  71. -- Looking for pclose
  72. -- Looking for pclose - found
  73. -- Looking for getexecname
  74. -- Looking for getexecname - not found
  75. -- Looking for setenv
  76. -- Looking for setenv - found
  77. -- Looking for clock_gettime
  78. -- Looking for clock_gettime - not found
  79. -- Looking for 3 include files mach/clock.h, ..., mach/mach_host.h
  80. -- Looking for 3 include files mach/clock.h, ..., mach/mach_host.h - found
  81. -- Looking for wordexp
  82. -- Looking for wordexp - found
  83. -- Looking for open
  84. -- Looking for open - found
  85. -- Looking for fork
  86. -- Looking for fork - found
  87. -- Looking for readlink
  88. -- Looking for readlink - found
  89. -- Looking for dup2
  90. -- Looking for dup2 - found
  91. -- Looking for pipe
  92. -- Looking for pipe - found
  93. -- Looking for read
  94. -- Looking for read - found
  95. -- Looking for close
  96. -- Looking for close - found
  97. -- Looking for setpgid
  98. -- Looking for setpgid - found
  99. -- Looking for execvp
  100. -- Looking for execvp - found
  101. -- Looking for posix_spawnp
  102. -- Looking for posix_spawnp - found
  103. -- Looking for isatty
  104. -- Looking for isatty - found
  105. -- Looking for waitpid
  106. -- Looking for waitpid - found
  107. -- Looking for sched_getscheduler
  108. -- Looking for sched_getscheduler - not found
  109. -- Looking for kill
  110. -- Looking for kill - found
  111. -- Looking for backtrace
  112. -- Looking for backtrace - found
  113. -- Looking for sys/types.h
  114. -- Looking for sys/types.h - found
  115. -- Looking for getpid
  116. -- Looking for getpid - found
  117. -- Looking for sysconf
  118. -- Looking for sysconf - found
  119. -- Looking for sigaction
  120. -- Looking for sigaction - found
  121. -- Looking for sysctl
  122. -- Looking for sysctl - found
  123. -- Looking for sys/stat.h
  124. -- Looking for sys/stat.h - found
  125. -- Looking for sys/errno.h
  126. -- Looking for sys/errno.h - found
  127. -- Looking for dirent.h
  128. -- Looking for dirent.h - found
  129. -- Looking for readdir_r
  130. -- Looking for readdir_r - found
  131. -- Looking for getcwd
  132. -- Looking for getcwd - found
  133. -- Looking for fpathconf
  134. -- Looking for fpathconf - found
  135. -- Looking for pathconf
  136. -- Looking for pathconf - found
  137. -- Looking for _PC_NAME_MAX
  138. -- Looking for _PC_NAME_MAX - found
  139. -- Looking for _PC_CASE_SENSITIVE
  140. -- Looking for _PC_CASE_SENSITIVE - found
  141. -- Looking for dirfd
  142. -- Looking for dirfd - found
  143. -- Looking for fstatat
  144. -- Looking for fstatat - not found
  145. -- Looking for NAME_MAX
  146. -- Looking for NAME_MAX - not found
  147.  
  148. Configuration:
  149. - Build type: Release
  150. - Filesystem backend: POSIX
  151. - Renderer: OpenGL
  152. - Audio backend: OpenAL
  153. - Windowing: SDL 2
  154. - Crash handler: (none)
  155. - Crash reporter: disabled
  156. - Tools: enabled
  157.  
  158. -- Configuring done
  159. -- Generating done
  160. -- Build files have been written to: /Users/Shared/ArxLibertatis/build
#6
icon_reply.pngReply
Comment posted by
 Daniel Scharrer
icon_reply.pngMar 16, 21:56, in reply to comment #5
Hm, that looks like it found SDL 2 just fine :S

Can you check what SDL2_INCLUDE_DIR is set to CMakeCache.txt (you can use ccmake or cmake-gui if you pass the same arguments as you did to cmake)? I'm guessing that's just /Library/Frameworks/SDL2.framework as well? Where is SDL.h located under that path?
#7
icon_reply.pngReply
Comment posted by
 Guest user
icon_reply.pngMar 16, 21:57, in reply to comment #4
I'm using sudo make because there were one or two incidents where it wouldn't build in a non-empty directory. I could probably use make without sudo just as easily. The SDL2 framework cmake detected was the one I installed from the dmg on libsdl.org/download-2.0.php, which I keep installed as the /Library/Frameworks/SDL2.framework directory. At the time I reported the error, this dmg was SDL2 2.0.2, but in the last 24 hours they've updated the framework to version 2.0.3, which is the version I now have installed. I tried building it cleanly again with 2.0.3, but the fatal outcome was the same. The clean cmake output can be found in the previous post.

Daniel Scharrer wrote:
Arc Libertatis

"Arx Libertatis" ;-)

using the command sudo make

Why are you compiling as the super user? At most the make install part
should be done with elevated privileges.

DialogType

Fixed, thanks for reporting.

Which I was able to rectify by changing line 23 of SDL2Window.h and
SDL2InputBackend.h from #include <SDL.h> to #include <SDL/SDL.h>.

That's a workaround, not a fix. We should figure out why CMake didn't find
your SDL 2 install. The complete cmake output will hopefully help here.
What is the exact SDL version and package type (binaries from libsdl.org,
macports, ...) you are using? Where are the libraries and headers
installed?


#8
icon_reply.pngReply
Comment posted by
 Guest user
icon_reply.pngMar 16, 22:03, in reply to comment #7
I checked with both ccmake and cmake-gui, and there is no mention of SDL2_INCLUDE_DIR, or any such cmake flag name with SDL2 in it at all. The only mention of SDL2_INCLUDE_DIR is in CMakeCache.txt, which contains the following lines:

  1. //Missing description
  2. SDL2_INCLUDE_DIR:PATH=/Library/Frameworks/SDL.framework/Headers
  3.  
  4. //Missing description
  5. SDL2_LIBRARY:FILEPATH=/Library/Frameworks/SDL2.framework


and further down it says

  1. //ADVANCED property for variable: SDL2_INCLUDE_DIR
  2. SDL2_INCLUDE_DIR-ADVANCED:INTERNAL=1
  3. //ADVANCED property for variable: SDL2_LIBRARY
  4. SDL2_LIBRARY-ADVANCED:INTERNAL=1


Guest user wrote:
I'm using sudo make because there were one or two incidents where it
wouldn't build in a non-empty directory. I could probably use make without
sudo just as easily. The SDL2 framework cmake detected was the one I
installed from the dmg on libsdl.org/download-2.0.php, which I keep
installed as the /Library/Frameworks/SDL2.framework directory. At the time
I reported the error, this dmg was SDL2 2.0.2, but in the last 24 hours
they've updated the framework to version 2.0.3, which is the version I now
have installed. I tried building it cleanly again with 2.0.3, but the fatal
outcome was the same. The clean cmake output can be found in the previous
post.

Daniel Scharrer wrote:
Arc Libertatis


"Arx Libertatis" ;-)

using the command sudo make


Why are you compiling as the super user? At most the make install part
should be done with elevated privileges.

DialogType


Fixed, thanks for reporting.

Which I was able to rectify by changing line 23 of SDL2Window.h and
SDL2InputBackend.h from #include <SDL.h> to #include <SDL/SDL.h>.


That's a workaround, not a fix. We should figure out why CMake didn't find
your SDL 2 install. The complete cmake output will hopefully help here.
What is the exact SDL version and package type (binaries from libsdl.org,
macports, ...) you are using? Where are the libraries and headers
installed?




#9
icon_reply.pngReply
Comment posted by
 Daniel Scharrer
icon_reply.pngMar 16, 22:14, in reply to comment #8
Ok then, what's under /Library/Frameworks/SDL.framework/Headers? There should be an SDL.h there directly without any sub directories, otherwise I don't see why cmake would have chosen that path. But then #include <SDL.h> should have worked…

Btw, you can put &lt;source&gt;&lt/source&gt; around code/text fragments so the formatting here won't mess it up (like I have edited your posts).

Also, please don't top-post.
#10
icon_reply.pngReply
Comment posted by
 Guest user
icon_reply.pngMar 16, 22:59, in reply to comment #9
Daniel Scharrer wrote:
Ok then, what's under /Library/Frameworks/SDL.framework/Headers? There
should be an SDL.h there directly without any sub directories, otherwise I
don't see why cmake would have chosen that path. But then #include <SDL.h>
should have worked…

Btw, you can put &lt;source&gt;&lt/source&gt; around code/text fragments so
the formatting here won't mess it up (like I have edited your posts).

Also, please don't top-post.
There is a SDL.h file at /Library/Frameworks/SDL2.framework/Versions/A/Headers/SDL.h
#11
icon_reply.pngReply
Comment posted by
 Daniel Scharrer
icon_reply.pngMar 16, 23:03, in reply to comment #10
Ind I assume /Library/Frameworks/SDL.framework/Headers (without the Versions/A part) links there? - but then why did you run into problems with SDL_Window?

Can you compile (without the include changes) and when you run into compile errors switch to
  1. VERBOSE=1 make
to get the complete compiler command-line - thanks.
#12
icon_reply.pngReply
Comment posted by
 Guest user
icon_reply.pngMar 16, 23:12, in reply to comment #11
Daniel Scharrer wrote:
Ind I assume /Library/Frameworks/SDL.framework/Headers (without the
Versions/A part) links there? - but then why did you run into problems with
SDL_Window?

Can you compile (without the include changes) and when you run into compile
errors switch to VERBOSE=1 make to get the complete compiler command-line -
thanks.
I tried it, but I still got the same SDL error:
  1. In file included from /Users/Shared/ArxLibertatis/src/core/ArxGame.cpp:143:
  2. /Users/Shared/ArxLibertatis/src/window/SDL2Window.h:57:2: error: unknown type name
  3. 'SDL_Window'; did you mean 'SDL2Window'?
  4. SDL_Window * m_window;
  5. ^~~~~~~~~~
  6. SDL2Window
  7. /Users/Shared/ArxLibertatis/src/window/SDL2Window.h:29:7: note: 'SDL2Window' declared
  8. here
  9. class SDL2Window : public RenderWindow {
  10. ^
  11. /Users/Shared/ArxLibertatis/src/window/SDL2Window.h:58:2: error: unknown type name
  12. 'SDL_GLContext'
  13. SDL_GLContext m_glcontext;
  14. ^
  15. /Users/Shared/ArxLibertatis/src/core/ArxGame.cpp:340:19: error: cannot initialize a
  16. variable of type 'RenderWindow *' with an rvalue of type 'SDL2Window *'
  17. RenderWindow * window = new SDL2Window;
  18. ^ ~~~~~~~~~~~~~~
#13
icon_reply.pngReply
Comment posted by
 Daniel Scharrer
icon_reply.pngMar 16, 23:13, in reply to comment #12
Yes, please run
  1. VERBOSE=1 make
and post the *full* output, including the compiler command that is executed.
#14
icon_reply.pngReply
Comment posted by
 Daniel Scharrer
Jan 03, 10:22
We need further user input to triage this issue.

The issue was updated with the following change(s):
  • The status has been updated, from New to Not a bug.
  • This issue has been closed
  • The resolution has been updated, from Not determined to CAN'T REPRODUCE.