Strava build dependencies?

509 views
Skip to first unread message

Stefan Lorenz

unread,
Dec 15, 2014, 1:02:56 PM12/15/14
to golden-che...@googlegroups.com
Hi, 

I compiled GC with OAuth support but I can't use the Strava upload feature.
Are there other build dependencies?


Christian Charette

unread,
Dec 15, 2014, 7:19:15 PM12/15/14
to golden-che...@googlegroups.com
In Strava go > setting > My API application

Apply for API development account, once you have a client ID and the client secret go in Settings.h find the Strava section and add:

#define GC_STRAVA_CLIENT_ID    "12345"
#define GC_STRAVA_CLIENT_SECRET "abcdef"

hope that helps...
Christin

Mark Liversedge

unread,
Dec 16, 2014, 1:54:20 AM12/16/14
to golden-che...@googlegroups.com
You do not need to edit the code.
You can add:

DEFINES += GC_STRAVA_CLIENT_ID = "12345"
DEFINES += GC_STRAVA_CLIENT_SECRET = "abcdef"

to your gcconfig.pri

Mark

Christian Charette

unread,
Dec 16, 2014, 7:10:27 AM12/16/14
to golden-che...@googlegroups.com
well that's good to know :)

Aaron Hershberger

unread,
Jan 19, 2015, 7:43:08 PM1/19/15
to golden-che...@googlegroups.com
Is this still the current method?  I tried editing the gcconfig.pri with my client id and secret, but I get an error about a redefinition.  I also tried modifying the Settings.h, but still with errors.
Here is what the compiler spat out.

<command-line>:0:2: error: no macro name given in #define directive
<command-line>:0:1: error: macro names must be identifiers
<command-line>:0:2: error: no macro name given in #define directive
In file included from LibUsb.cpp:26:0:
Settings.h:184:0: warning: "GC_STRAVA_CLIENT_ID" redefined [enabled by default]
 #define GC_STRAVA_CLIENT_ID    "83" // client id
 ^
<command-line>:0:0: note: this is the location of the previous definition
make[1]: *** [LibUsb.o] Error 1

And the relevant portion of the gcconfig.pri with the id and secret removed

DEFINES += GC_STRAVA_CLIENT_ID = "my id here"
DEFINES += GC_STRAVA_CLIENT_SECRET = "my secret here"

LIBOAUTH_INSTALL = /usr/local
LIBOAUTH_LIBS = -loauth
PKGCONFIG = oauth

Jörn R.

unread,
Jan 20, 2015, 4:52:44 AM1/20/15
to golden-che...@googlegroups.com
Since the move from LibOAUTH to QT based KQOauth - https://groups.google.com/forum/?hl=de#!topic/golden-cheetah-developers/9zTES4mEV3M dependencies have changed - got less/easier.

- For Strava/Cyclinganalytics KQOauth is not required - it's only used Twitter authorization (since Twitter uses OAUTH 1.0) - Strava,... follow an OAUTH 2.0 approach - which is easier to implement :-)

Settings.h contains definition of CLIENT_ID for Strava and Cyclinganalytics (but not the secret) - that why you get the error.
According to error CLIENT_ID is not removed from Settings.h.

What you also need to have - not change to past - is SSL -  QT is supporting/using OpenSSL to be able to do https request - which is the request method to authorize Strava, ...

Joern
Message has been deleted

Aaron Hershberger

unread,
Jan 23, 2015, 9:07:50 AM1/23/15
to golden-che...@googlegroups.com
Jorn,
So let me make sure of what you're saying. I should
1. remove the CLIENT_ID line from settings.h

2. leave the following in gcconfig.pri
DEFINES += GC_STRAVA_CLIENT_ID = "my id here"
DEFINES += GC_STRAVA_CLIENT_SECRET = "my secret here"

3. Remove my liboath lines from gcconfig.PRI

4. Make sure I have libssl-dev installed

Is that correct?
I'll try this out when I get home.
Thanks
Aaron

Jörn R.

unread,
Jan 23, 2015, 11:21:21 AM1/23/15
to golden-che...@googlegroups.com
Basically Yes - see my comments below.

And please use the latest code - commits of today - since a few correction have
been made in this area.

Joern


Am Freitag, 23. Januar 2015 15:07:50 UTC+1 schrieb Aaron Hershberger:
Jorn,
So let me make sure of what you're saying.  I should
1. remove the CLIENT_ID line from settings.h
yes - GC_STRAVA_CLIENT_ID for sure / or put your ""my id here" id in here and remove it from gcconfig.pri (you must only define it once) 

2.  leave the following in gcconfig.pri
DEFINES += GC_STRAVA_CLIENT_ID = "my id here"
DEFINES += GC_STRAVA_CLIENT_SECRET = "my secret here"

yes - see 1. 

3. Remove my liboath lines from gcconfig.PRI

yes - not needed for Strava 
 
4. Make sure I have libssl-dev installed

Not quite sure - I am not a Linux guy. But we just added a feature to send a message if SSL is missing
by using a QT function which checks it. So give it a try.

Aaron Hershberger

unread,
Jan 24, 2015, 5:25:03 PM1/24/15
to golden-che...@googlegroups.com
I was able to build successfully with the latest code available today.

When I go to authorize Strava in the options>passwords section, GC kicks out the following error in a separate window titled OAuth.

{"message":"Bad Request","errors":[{"resource":"Application","field":"redirect_uri","code":"invalid"}]}

I'll search around the google group.  Maybe I left some OAuth reference in the config files?

Aaron

Aaron Hershberger

unread,
Jan 24, 2015, 5:25:43 PM1/24/15
to golden-che...@googlegroups.com
By the way, I'm REALLY impressed with the support here as well as the great program.  Thank you all!

Jörn R.

unread,
Jan 25, 2015, 4:32:00 AM1/25/15
to golden-che...@googlegroups.com
Your configuration / redirect - URI in your Strava Account API setup is wrong.

See here:


The re-direct URI we are using for authorization is redirect_uri=http://www.goldencheetah.org/

Joern

Aaron Hershberger

unread,
Jan 25, 2015, 8:44:49 PM1/25/15
to golden-che...@googlegroups.com
That did it! Many thanks Joern.

Torbjorn Jansson

unread,
Jul 8, 2015, 10:59:42 AM7/8/15
to golden-che...@googlegroups.com
Hello.

I had similar trouble, and can't follow the instructions here. I tried various variants, but in the end, the following is what should work:

1) I added to my gcconfig.pri (with real codes for aaa and nnn).
#Strava support
DEFINES += GC_STRAVA_CLIENT_ID = "nnn"
DEFINES += GC_STRAVA_CLIENT_SECRET = "aaa"

2) I commented out the line defining GC_STRAVA_CLIENT_ID in settings.h.

3) I executed
make clean
qmake -recursive
make

I get the following compilation errors

g++ -c -m64 -pipe -O2 -Wall -W -D_REENTRANT -fPIE -DGC_STRAVA_CLIENT_ID -D= -Dnnn -DGC_STRAVA_CLIENT_SECRET -D= -Daaa -DGC_VIDEO_NONE -DQXT_STATIC -DGC_HAVE_SOAP -DQT_NO_DEBUG -DQT_SVG_LIB -DQT_WEBKITWIDGETS_LIB -DQT_MULTIMEDIAWIDGETS_LIB -DQT_WIDGETS_LIB -DQT_WEBKIT_LIB -DQT_MULTIMEDIA_LIB -DQT_GUI_LIB -DQT_XML_LIB -DQT_SQL_LIB -DQT_NETWORK_LIB -DQT_SCRIPT_LIB -DQT_CONCURRENT_LIB -DQT_CORE_LIB -I. -I../qwt/src -I../qxt/src -I../qtsolutions/json -I../qtsolutions/soap -isystem /usr/include/x86_64-linux-gnu/qt5 -isystem /usr/include/x86_64-linux-gnu/qt5/QtSvg -isystem /usr/include/x86_64-linux-gnu/qt5/QtWebKitWidgets -isystem /usr/include/x86_64-linux-gnu/qt5/QtMultimediaWidgets -isystem /usr/include/x86_64-linux-gnu/qt5/QtWidgets -isystem /usr/include/x86_64-linux-gnu/qt5/QtWebKit -isystem /usr/include/x86_64-linux-gnu/qt5/QtMultimedia -isystem /usr/include/x86_64-linux-gnu/qt5/QtGui -isystem /usr/include/x86_64-linux-gnu/qt5/QtXml -isystem /usr/include/x86_64-linux-gnu/qt5/QtSql -isystem /usr/include/x86_64-linux-gnu/qt5/QtNetwork -isystem /usr/include/x86_64-linux-gnu/qt5/QtScript -isystem /usr/include/x86_64-linux-gnu/qt5/QtConcurrent -isystem /usr/include/x86_64-linux-gnu/qt5/QtCore -I. -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++-64 -o DataFilter.o DataFilter.cpp

<command-line>:0:2: error: no macro name given in #define directive
<command-line>:0:1: error: macro names must be identifiers
<command-line>:0:2: error: no macro name given in #define directive
<command-line>:0:1: error: macro names must be identifiers
Makefile:5430: receptet för målet ”DataFilter.o” misslyckades

I am tearing off my precious remaining hair here, and wasting valuable bike riding time... Could anybody suggest what is wrong?

Cheers,

Torbjörn Jansson, Uppsala, Sweden


Jan de Visser

unread,
Jul 8, 2015, 11:55:30 AM7/8/15
to golden-che...@googlegroups.com, Torbjorn Jansson

On July 8, 2015 07:59:41 AM Torbjorn Jansson wrote:

Hello.

I had similar trouble, and can't follow the instructions here. I tried various variants, but in the end, the following is what should work:

1) I added to my gcconfig.pri (with real codes for aaa and nnn).
#Strava support
DEFINES += GC_STRAVA_CLIENT_ID = "nnn"
DEFINES += GC_STRAVA_CLIENT_SECRET = "aaa"

 

Get rid of the spaces surrounding the "="-sign, so

 

DEFINES += GC_STRAVA_CLIENT_ID="nnn"
DEFINES += GC_STRAVA_CLIENT_SECRET="aaa"

 

 

 

 

 



2) I commented out the line defining GC_STRAVA_CLIENT_ID in settings.h.

3) I executed
make clean
qmake -recursive
make

I get the following compilation errors

g++ -c -m64 -pipe -O2 -Wall -W -D_REENTRANT -fPIE -DGC_STRAVA_CLIENT_ID -D= -Dnnn -DGC_STRAVA_CLIENT_SECRET -D= -Daaa -DGC_VIDEO_NONE -DQXT_STATIC -DGC_HAVE_SOAP -DQT_NO_DEBUG -DQT_SVG_LIB -DQT_WEBKITWIDGETS_LIB -DQT_MULTIMEDIAWIDGETS_LIB -DQT_WIDGETS_LIB -DQT_WEBKIT_LIB -DQT_MULTIMEDIA_LIB -DQT_GUI_LIB -DQT_XML_LIB -DQT_SQL_LIB -DQT_NETWORK_LIB -DQT_SCRIPT_LIB -DQT_CONCURRENT_LIB -DQT_CORE_LIB -I. -I../qwt/src -I../qxt/src -I../qtsolutions/json -I../qtsolutions/soap -isystem /usr/include/x86_64-linux-gnu/qt5 -isystem /usr/include/x86_64-linux-gnu/qt5/QtSvg -isystem /usr/include/x86_64-linux-gnu/qt5/QtWebKitWidgets -isystem /usr/include/x86_64-linux-gnu/qt5/QtMultimediaWidgets -isystem /usr/include/x86_64-linux-gnu/qt5/QtWidgets -isystem /usr/include/x86_64-linux-gnu/qt5/QtWebKit -isystem /usr/include/x86_64-linux-gnu/qt5/QtMultimedia -isystem /usr/include/x86_64-linux-gnu/qt5/QtGui -isystem /usr/include/x86_64-linux-gnu/qt5/QtXml -isystem /usr/include/x86_64-linux-gnu/qt5/QtSql -isystem /usr/include/x86_64-linux-gnu/qt5/QtNetwork -isystem /usr/include/x86_64-linux-gnu/qt5/QtScript -isystem /usr/include/x86_64-linux-gnu/qt5/QtConcurrent -isystem /usr/include/x86_64-linux-gnu/qt5/QtCore -I. -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++-64 -o DataFilter.o DataFilter.cpp
<command-line>:0:2: error: no macro name given in #define directive
<command-line>:0:1: error: macro names must be identifiers
<command-line>:0:2: error: no macro name given in #define directive
<command-line>:0:1: error: macro names must be identifiers
Makefile:5430: receptet för målet ”DataFilter.o” misslyckades

I am tearing off my precious remaining hair here, and wasting valuable bike riding time... Could anybody suggest what is wrong?

Cheers,

Torbjörn Jansson, Uppsala, Sweden


--
_______________________________________________
Golden-Cheetah-Users mailing list
golden-che...@googlegroups.com
http://groups.google.com/group/golden-cheetah-users?hl=en
---
You received this message because you are subscribed to the Google Groups "golden-cheetah-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golden-cheetah-u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



Torbjorn Jansson

unread,
Jul 8, 2015, 3:02:33 PM7/8/15
to golden-che...@googlegroups.com, herr_...@hotmail.com, jhde...@uwaterloo.ca
I still can't get this right.

Thanks to Jan de Visser, I also entered escape characters for the quotation marks:
DEFINES += GC_STRAVA_CLIENT_ID=\"nnn\"
DEFINES += GC_STRAVA_CLIENT_SECRET=\"aaa\"

Below some compilation output, indicating that quotation marks do get passed through, and also an error complaining about illegal type conversion in the OAuthDialog



g++ -c -m64 -pipe -O2 -Wall -W -D_REENTRANT -fPIE -DGC_STRAVA_CLIENT_ID="nnn" -DGC_STRAVA_CLIENT_SECRET="aaa" -DGC_VIDEO_NONE -DQXT_STATIC -DGC_HAVE_SOAP -DQT_NO_DEBUG -DQT_SVG_LIB -DQT_WEBKITWIDGETS_LIB -DQT_MULTIMEDIAWIDGETS_LIB -DQT_WIDGETS_LIB -DQT_WEBKIT_LIB -DQT_MULTIMEDIA_LIB -DQT_GUI_LIB -DQT_XML_LIB -DQT_SQL_LIB -DQT_NETWORK_LIB -DQT_SCRIPT_LIB -DQT_CONCURRENT_LIB -DQT_CORE_LIB -I. -I../qwt/src -I../qxt/src -I../qtsolutions/json -I../qtsolutions/soap -isystem /usr/include/x86_64-linux-gnu/qt5 -isystem /usr/include/x86_64-linux-gnu/qt5/QtSvg -isystem /usr/include/x86_64-linux-gnu/qt5/QtWebKitWidgets -isystem /usr/include/x86_64-linux-gnu/qt5/QtMultimediaWidgets -isystem /usr/include/x86_64-linux-gnu/qt5/QtWidgets -isystem /usr/include/x86_64-linux-gnu/qt5/QtWebKit -isystem /usr/include/x86_64-linux-gnu/qt5/QtMultimedia -isystem /usr/include/x86_64-linux-gnu/qt5/QtGui -isystem /usr/include/x86_64-linux-gnu/qt5/QtXml -isystem /usr/include/x86_64-linux-gnu/qt5/QtSql -isystem /usr/include/x86_64-linux-gnu/qt5/QtNetwork -isystem /usr/include/x86_64-linux-gnu/qt5/QtScript -isystem /usr/include/x86_64-linux-gnu/qt5/QtConcurrent -isystem /usr/include/x86_64-linux-gnu/qt5/QtCore -I. -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++-64 -o OAuthDialog.o OAuthDialog.cpp
<command-line>:0:25: error: invalid suffix "aaa" on integer constant
OAuthDialog.cpp:216:54: note: in expansion of macro ‘GC_STRAVA_CLIENT_SECRET’
                 params.addQueryItem("client_secret", GC_STRAVA_CLIENT_SECRET);
                                                      ^

OAuthDialog.cpp: In member function ‘void OAuthDialog::urlChanged(const QUrl&)’:
OAuthDialog.cpp:214:69: error: invalid user-defined conversion from ‘int’ to ‘const QString&’ [-fpermissive]
                 params.addQueryItem("client_id", GC_STRAVA_CLIENT_ID);
                                                                     ^

... and some more similar items.

Torbjorn Jansson

unread,
Jul 8, 2015, 5:13:14 PM7/8/15
to golden-che...@googlegroups.com, herr_...@hotmail.com
...

I can alternatively add the following lines to settings.h (as before with nnn my ID and aaa my SECRET)

#define GC_STRAVA_CLIENT_ID     "nnn"
#define GC_STRAVA_CLIENT_SECRET "aaa"
#define GC_STRAVA_TOKEN         "strava_token"

It builds without complaints, but when I start GC the Strava options are disabled (greyed out). Why?

Karl Billeter

unread,
Jul 8, 2015, 8:35:06 PM7/8/15
to Torbjorn Jansson, golden-che...@googlegroups.com
You probably still need to "Authorise" it in the "Passwords" tab under
Options.

Karl

Torbjorn Jansson

unread,
Jul 9, 2015, 3:23:07 AM7/9/15
to golden-che...@googlegroups.com, herr_...@hotmail.com
I made an embarrassing error, but I mention it anyway since I am old enought to have lost all pride anyway - perhaps it helps somebody:

I built successfully, but then started the wrong version of GC. Instead of running the freshly built version, I tested the old version without Strava credentials. No wonder nothing changed.

Related issue, then, albeit this may be a general Linux issue: When I execute
make install
- where does the program put the compiled files? I cannot find them anywhere except in my source code directory. I would like them to end up in /usr/bin or similar. How do I obtain that with my build?

Cheers,

Torbjörn

G Coco

unread,
Jul 9, 2015, 6:04:07 PM7/9/15
to golden-che...@googlegroups.com, herr_...@hotmail.com
Hi,

In gcconfig.pri you need to have \\\" to escape the ".

DEFINES += GC_STRAVA_CLIENT_SECRET=\\\"key\\\"

If you do this then the define is added.

Sorry for the delay in getting this out there.

Or add to settings.h as already listed.
Reply all
Reply to author
Forward
0 new messages