Menu

#5 Compile issues on Mac OSX

open
nobody
None
5
2013-11-28
2012-03-07
Bret Jordan
No

I am having problems getting crrcsim 0.9.12 to compile on my Mac Book Pro (10.7.3 Intel). I have installed plib, jpeg, and portaudio via macports. It is important to note that I can get crrcsim 0.9.9 to compile but that version does not have support for the CT6A input device which I need.

When I run the following configure (0.9.12) script everything works fine.
./configure CPPFLAGS=-I/opt/local/include LDFLAGS="-L/opt/local/lib -framework OpenGL"

But when I run:
make

I get the following errors.

mv -f .deps/crrcsim-filesystools.Tpo .deps/crrcsim-filesystools.Po
g++ -DHAVE_CONFIG_H -I. -I/opt/local/include -D_THREAD_SAFE -I/usr/local/include/SDL -D_GNU_SOURCE=1 -D_THREAD_SAFE -DPU_USE_SDL -DCRRC_DATA_PATH="\"/usr/local/share/crrcsim\"" -g -O2 -DMACOSX -Wall -MT crrcsim-SimpleXMLTransfer.o -MD -MP -MF .deps/crrcsim-SimpleXMLTransfer.Tpo -c -o crrcsim-SimpleXMLTransfer.o `test -f 'src/mod_misc/SimpleXMLTransfer.cpp' || echo './'`src/mod_misc/SimpleXMLTransfer.cpp
mv -f .deps/crrcsim-SimpleXMLTransfer.Tpo .deps/crrcsim-SimpleXMLTransfer.Po
g++ -DHAVE_CONFIG_H -I. -I/opt/local/include -D_THREAD_SAFE -I/usr/local/include/SDL -D_GNU_SOURCE=1 -D_THREAD_SAFE -DPU_USE_SDL -DCRRC_DATA_PATH="\"/usr/local/share/crrcsim\"" -g -O2 -DMACOSX -Wall -MT crrcsim-airplane_vis.o -MD -MP -MF .deps/crrcsim-airplane_vis.Tpo -c -o crrcsim-airplane_vis.o `test -f 'src/mod_video/airplane_vis.cpp' || echo './'`src/mod_video/airplane_vis.cpp
In file included from src/mod_video/airplane_vis.cpp:30:
src/mod_video/shadow.h:55: error: ISO C++ forbids declaration of 'APIENTRY' with no type
src/mod_video/shadow.h:55: error: 'APIENTRY' is neither function nor member function; cannot be declared friend
src/mod_video/shadow.h:55: error: expected ';' before 'void'
src/mod_video/shadow.h:56: error: ISO C++ forbids declaration of 'APIENTRY' with no type
src/mod_video/shadow.h:56: error: 'APIENTRY' is neither function nor member function; cannot be declared friend
src/mod_video/shadow.h:56: error: expected ';' before 'void'
src/mod_video/shadow.h:57: error: ISO C++ forbids declaration of 'APIENTRY' with no type
src/mod_video/shadow.h:57: error: 'APIENTRY' is neither function nor member function; cannot be declared friend
src/mod_video/shadow.h:57: error: expected ';' before 'void'
src/mod_video/shadow.h:58: error: ISO C++ forbids declaration of 'APIENTRY' with no type
src/mod_video/shadow.h:58: error: 'APIENTRY' is neither function nor member function; cannot be declared friend
src/mod_video/shadow.h:58: error: expected ';' before 'void'
src/mod_video/shadow.h:59: error: ISO C++ forbids declaration of 'APIENTRY' with no type
src/mod_video/shadow.h:59: error: 'APIENTRY' is neither function nor member function; cannot be declared friend
src/mod_video/shadow.h:59: error: expected ';' before 'void'
make[2]: *** [crrcsim-airplane_vis.o] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

Thoughts? Suggestions?

Thanks in advance.

Discussion

  • Johannes

    Johannes - 2013-11-28

    This issue is more than a year old, but I thought I would still contribute my two cents: I am also trying to compile CRRCSim on Mac OS, using OSX 10.9 (Mavericks) and either MacPorts or homebrew for installing dependencies.

    I have been running into other problems and cannot confirm / reproduce the problem that you are experiencing.

    Note: I have yesterday been able to successfully compile CRRCSim using the following build instructions. (When I execute the binary, it crashes, probably because PortAudio v19 is incompatible with CRRCSim <= 0.9.12. But hey, being able to compile without errors is one step forwards!).

    One key to getting around "implicit instantiation of template" compile errors is to use the correct compiler. You need to compile using gcc instead of clang by prefixing the ./configure command with e.g., CC=gcc-4.7 CXX=g++-4.7 as seen in the below instructions.

    Instructions heavily inspired by:
    http://blog.mywarwithentropy.com/2012/03/how-to-compile-crrcsim-v0912-for-mac.html

     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    #!/usr/bin/env bash
    # install macports, then
    sudo port install plib
    sudo port install jpeg
    sudo port install portaudio
    sudo port install libsdl
    
    # download crrcsim source code
    # simply download the .tar.gz from sourceforge, extract it to ~/repos/crrcsim
    
    # apply the patch to crrcsim/src/mod_misc/filesystools.cpp as indicated in
    # http://blog.mywarwithentropy.com/2012/03/how-to-compile-crrcsim-v0912-for-mac.html
    
    # compile
    # note: make sure to configure the build so it uses gcc instead of clang, because you will otherwise get "implicit instantiation of undefined template" errors, compare http://stackoverflow.com/questions/19719684/how-do-you-fix-implicit-instantiation-errors-when-compiling-mesos-on-os-x-10-9
    cd ~/repos/crrcsim
    CC=gcc-4.7 CXX=g++-4.7 ./configure CPPFLAGS="-I/opt/local/include -DAPIENTRY=" LDFLAGS="-L/opt/local/lib -lintl -framework OpenGL" --prefix=$HOME/crrcsim.app
    make
    make install
    
    # assemble the application
    cd $HOME/crrcsim.app
    mkdir Contents
    cd Contents
    mkdir Frameworks PlugIns Resources SharedFrameworksmv ../bin MacOS
    mv ../share/crrcsim/* Resources/
    mv ../share Resources/
    rmdir Resources/share/crrcsim/
    mv Resources/share/doc/crrcsim/* Resources/share/doc/
    rmdir Resources/share/doc/crrcsim/
    curl https://sourceforge.net/p/crrcsim/code/ci/default/tree/macosx/crrcsim.icns?format=raw > Resources/crrcsim.icns
    cat << 'EOF' > Info.plist
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
            <key>CFBundleDisplayName</key>
            <string>CRRC Simulator</string>
            <key>CFBundleName</key>
            <string>crrcsim</string>
            <key>CFBundlePackageType</key>
            <string>APPL</string>
            <key>CFBundleExecutable</key>
            <string>crrcsim</string>
            <key>CFBundleVersion</key>
            <string>0.9.12</string>
            <key>CFBundleShortVersionString</key>
            <string>0.9.12</string>
            <key>CFBundleDevelopmentRegion</key>
            <string>English</string>
            <key>CFBundleHelpBookFolder</key>
            <string>share/doc/</string>
            <key>CFAppleHelpAnchor</key>
            <string>index.html</string>
            <key>CFBundleIconFile</key>
            <string>crrcsim.icns</string>
            <key>CFBundleIdentifier</key>
            <string>http://crrcsim.sourceforge.net</string>
            <key>CFBundleInfoDictionaryVersion</key>
            <string>6.0</string>
            <key>CFBundleSignature</key>
            <string>JORD</string>
            <key>NSPrincipalClass</key>
            <string>SDLApplication</string>
            <key>NSHumanReadableCopyright</key>
            <string>Copyright 2006 GNU General Public License</string>
            <key>crrcsim</key>
            <string>SDL Cocoa App</string>
    </dict>
    </plist>
    EOF
    

    Result: An app is produced that I can open from Finder. But it crashes upon launch, probably because of Portaudio, but I need to further investigate this.

     
  • Johannes

    Johannes - 2013-11-28

    Note: If I compile without portaudio, it works!! yeah!!! (put more precisely: crrcsim 0.9.12 compiles and executes correctly)

    sudo port uninstall portaudio
    

    ...otherwise follow build instructions as described above.

     

Log in to post a comment.