Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make fails #4

Open
ThePowerTool opened this issue Jun 25, 2022 · 3 comments
Open

make fails #4

ThePowerTool opened this issue Jun 25, 2022 · 3 comments

Comments

@ThePowerTool
Copy link

ThePowerTool commented Jun 25, 2022

I am using Fedora 32 and ran into the following:
]$ make
cc -Wall -g -c pkg-config libusb-1.0 --cflags -I/usr/include/postgresql/ -Ihidapi/hidapi hidapi/linux/hid-libusb.c -o hidapi/linux/hid-libusb.o
hidapi/linux/hid-libusb.c: In function ‘hid_open_path’:
hidapi/linux/hid-libusb.c:746:10: warning: variable ‘num_devs’ set but not used [-Wunused-but-set-variable]
746 | ssize_t num_devs;
| ^~~~~~~~
cc -Wall -g -c pkg-config libusb-1.0 --cflags -I/usr/include/postgresql/ -Ihidapi/hidapi src/polar.c -o src/polar.o
src/polar.c: In function ‘main’:
src/polar.c:30:8: warning: unknown escape sequence: '\040'
30 | printf("polar -- simple polar FT60 HRM FlowLink transfer into database and basic html analysis\n\n
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
31 | Copyright (C) 2012 Samo Penic [email protected]\n\n\
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
32 |
| ~
33 | This program is free software: you can redistribute it and/or modify\n
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
34 | it under the terms of the GNU General Public License as published by\n
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
35 | the Free Software Foundation, either version 3 of the License, or\n
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
36 | (at your option) any later version.\n\n
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
37 |
| ~
38 | This program is distributed in the hope that it will be useful,\n
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
39 | but WITHOUT ANY WARRANTY; without even the implied warranty of\n
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
40 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
41 | GNU General Public License for more details.\n\n
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
42 |
| ~
43 | You should have received a copy of the GNU General Public License\n
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
44 | along with this program. If not, see http://www.gnu.org/licenses/.\n\n\n
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
45 | ");
| ~
src/polar.c:49:4: warning: assignment to ‘PGconn *’ {aka ‘struct pg_conn *’} from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
49 | db=1;
| ^
src/polar.c:27:16: warning: unused variable ‘cmd7’ [-Wunused-variable]
27 | unsigned char cmd7[256]={0x01,0x00,0x02,0x14,0x30};
| ^~~~
cc -Wall -g -c pkg-config libusb-1.0 --cflags -I/usr/include/postgresql/ -Ihidapi/hidapi src/protocol.c -o src/protocol.o
cc -Wall -g -c pkg-config libusb-1.0 --cflags -I/usr/include/postgresql/ -Ihidapi/hidapi src/parse_data.c -o src/parse_data.o
src/parse_data.c: In function ‘parseTrainingData’:
src/parse_data.c:117:34: warning: unknown conversion type character ‘\x0a’ in format [-Wformat=]
117 | printf("Fat burn percentage=%d %\n",buf[33]);
| ^~
cc -Wall -g -c pkg-config libusb-1.0 --cflags -I/usr/include/postgresql/ -Ihidapi/hidapi src/database.c -o src/database.o
g++ -Wall -g hidapi/linux/hid-libusb.o src/polar.o src/protocol.o src/parse_data.o src/database.o pkg-config libusb-1.0 libudev --libs -lpq -o ./bin/polar
/usr/bin/ld: hidapi/linux/hid-libusb.o: undefined reference to symbol 'pthread_join@@GLIBC_2.2.5'
/usr/bin/ld: /usr/lib64/libpthread.so.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make: *** [Makefile:17: polar] Error 1

@ThePowerTool
Copy link
Author

OK, I played around with it a little. I think I solved the "space" error. Now I have it down to just:

]$ make
cc -Wall -g -c pkg-config libusb-1.0 --cflags -I/usr/include/postgresql/ -Ihidapi/hidapi hidapi/linux/hid-libusb.c -o hidapi/linux/hid-libusb.o
hidapi/linux/hid-libusb.c: In function ‘hid_open_path’:
hidapi/linux/hid-libusb.c:746:10: warning: variable ‘num_devs’ set but not used [-Wunused-but-set-variable]
746 | ssize_t num_devs;
| ^~~~~~~~
g++ -Wall -g hidapi/linux/hid-libusb.o src/polar.o src/protocol.o src/parse_data.o src/database.o pkg-config libusb-1.0 libudev --libs -lpq -o ./bin/polar
/usr/bin/ld: hidapi/linux/hid-libusb.o: undefined reference to symbol 'pthread_join@@GLIBC_2.2.5'
/usr/bin/ld: /usr/lib64/libpthread.so.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make: *** [Makefile:17: polar] Error 1

@ThePowerTool
Copy link
Author

OK, I updated the Makefile to include -libpthread:
LIBS = pkg-config libusb-1.0 libudev --libs -lpthread -lpq
This seems to have gotten me to a clean build.
I'll let you know how it goes.

@linas
Copy link

linas commented Jun 28, 2022

You should create a pull request with your changes in it! (they seem correct to me)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants