Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to use Rcpp in Qt (with Mac) [Almost Solved]?
Servers for Qt installer are currently down

How to use Rcpp in Qt (with Mac) [Almost Solved]?

Scheduled Pinned Locked Moved General and Desktop
rcpp qt mac
25 Posts 3 Posters 8.0k Views 3 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • ? A Former User
    15 May 2015, 22:05

    Hallo :-)

    -o Rcpp.so Date.o Module.o Rcpp_init.o api.o attributes.o

    I see that some object code files have been installed. But are you really sure that the file "Rcpp.h" exists in "/Users/xy/Library/Frameworks/R.framework/Versions/3.1/Resources/library/Rcpp/include" ? Maybe the Rcpp project has been split in two separate packages: One package only for software that uses Rcpp binaries and a second package for developers that includes all the header files (so called "-dev" package)?

    N Offline
    N Offline
    newe12
    wrote on 15 May 2015, 22:09 last edited by newe12
    #21

    Hi Wieland!

    Thanks! Yes it exists!

    I checked (in the Terminal): cd /Library/Frameworks/R.framework/Resources/library
    and then "ls"

    And it is there: Rcpp

    Then i changed to: cd Rcpp and "ls" gave me:
    CITATION NAMESPACE THANKS examples libs
    DESCRIPTION NEWS.Rd announce help prompt
    INDEX R discovery html skeleton
    Meta README doc

    This was initially downloaded from: http://cran.r-project.org/web/packages/Rcpp/index.html

    And I changed:
    INCLUDEPATH += /Users/xy/Library/Frameworks/R.framework/Resources/library/Rcpp/include
    LIBS += -I/Users/xy/Library/ -framework R
    in the .Pro-file.

    Any ideas?

    1 Reply Last reply
    0
    • ? Offline
      ? Offline
      A Former User
      wrote on 15 May 2015, 23:01 last edited by A Former User
      #22

      Sorry for being pedantic on this (I'm only as pedantic as the compiler is ;-) ). You said:

      cd /Library/Frameworks/R.framework/Resources/library
      And it is there: Rcpp

      That is a directory. Where exactly is the file Rcpp.h?

      1 Reply Last reply
      1
      • N Offline
        N Offline
        newe12
        wrote on 17 May 2015, 16:04 last edited by newe12
        #23

        Hi Wieland, thanks for your hint!

        Finally, I found Rcpp.h and I managed to include it with the correct path and now Rcpp.h is found!
        Here the two steps, which helped me to solve it:

        1. QMAKE_LFLAGS += -I /Library/Frameworks/R.framework/Resources/library/Rcpp/ # use qmake and then uncomment it
        2. INCLUDEPATH += -I /Library/Frameworks/R.framework/Resources/library/Rcpp/include
          Remark: Very important was to change the path directly to /Library/... and include "-I".

        This first part of the problem is solved!

        But now, i get the new error message: framework not found R.

        I use: LIBS += -framework R
        in the .Pro-file (as suggested here: http://doc.qt.io/qt-4.8/qmake-platform-notes.html).
        I also tried: LIBS += -framework -lR
        it also did not work.

        Here is the error message:

        ld: framework not found R
        clang: error: linker command failed with exit code 1 (use -v to see invocation)
        make: *** [xy.app/Contents/MacOS/xy] Error 1
        19:13:17: Der Prozess "/usr/bin/make" wurde mit dem Rückgabewert 2 beendet.
        Fehler beim Erstellen/Deployment des Projekts xy (Kit: Desktop Qt 5.4.1 clang 64bit)
        Bei der Ausführung von Schritt "Make"

        I hope this second part can also be solved. Then it should work! Any suggestions?

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 17 May 2015, 19:50 last edited by
          #24

          Hi,

          Did you add -F/Library/Frameworks to your pro file ? It's the equivalent to -L for libraries

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          1
          • N Offline
            N Offline
            newe12
            wrote on 17 May 2015, 22:02 last edited by
            #25

            Yes!

            Well, the problem removed, but this came up:
            Undefined symbols for architecture x86_64:
            "_REprintf", referenced from:
            Rcpp::Rstreambuf<false>::xsputn(char const*, long) in mainwindow.o
            Rcpp::Rstreambuf<false>::overflow(int) in mainwindow.o
            "_R_FlushConsole", referenced from:
            Rcpp::Rstreambuf<false>::sync() in mainwindow.o
            Rcpp::Rstreambuf<true>::sync() in mainwindow.o
            "_Rprintf", referenced from:
            Rcpp::Rstreambuf<true>::xsputn(char const*, long) in mainwindow.o
            Rcpp::Rstreambuf<true>::overflow(int) in mainwindow.o
            ld: symbol(s) not found for architecture x86_64
            clang: error: linker command failed with exit code 1 (use -v to see invocation)
            make: *** [xy.app/Contents/MacOS/xy] Error 1
            23:51:38: Der Prozess "/usr/bin/make" wurde mit dem Rückgabewert 2 beendet.
            Fehler beim Erstellen/Deployment des Projekts xy (Kit: Desktop Qt 5.4.1 clang 64bit)
            Bei der Ausführung von Schritt "Make"

            Especially: symbol(s) not found for architecture x86_64
            does not disappear after several tries.

            Here: https://forum.qt.io/topic/35065/solved-qt5-1-qt5-2-xcode-5-0-2-mac-os-10-9-mavericks-can-t-link-to-the-libraries-undefined-symbols-for-architecture-x86_64/11
            it was described that Xcode and Mac Os were not linked properly.

            Here: http://stackoverflow.com/questions/25940368/qt5-target-conditionals-not-found
            QMAKE_MAC_SDK = macosx10.9
            was suggested. Either it failed, or: Project ERROR: Could not resolve SDK path for 'macosx10.xy'
            was displayed!

            Well yet not solved... :-)

            1 Reply Last reply
            0

            21/25

            15 May 2015, 22:09

            • Login

            • Login or register to search.
            21 out of 25
            • First post
              21/25
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved