Not able to link gcc against libbluetooth library

PSatishKR

I am using BlueZ library for developing bluetooth based application for linux using C. I am trying to link libbluetooth-dev to my C file but it is not working.

/usr/bin/ld: cannot find -libbluetooth-dev
collect2: error: ld returned 1 exit status

My project directory is bluez-5.45, i am trying to build the project from this folder and added my .C file in this main folder

I installed libbluetooth-dev library and tryed that linking but not able to do that. Command for linking: gcc -o output myfile.c -libbluetooth

please let me know the mistake done by me.

Trevor Keller

The "lib" is implied, so link against "bluetooth" instead of "libbluetooth":

$ gcc -o output myfile.c -lbluetooth

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How to force cmake link against custom gcc libraries

Does gcc link program with static or dynamic library by default?

Force to link against unused shared library

Static link of shared library function in gcc

How do you link to a specific version of a shared library in GCC

Telling gcc directly to link a library statically

Cannot link against core library when cross compiling

How to get clang to link against a library without the "lib" prefix?

How to compile and link against cddlib library?

How do I link against libtool static la library?

Link a static library in gcc without having to specify the 'lib' prefix

How can I link with gcc and SDL_image library?

gcc link the math library by default in C on mac OS X?

Link a library as last against all targets

Which OSX library to link against (command line) to use NSLog?

Autotools: Optionally compile and link against a third-party library

Patches to statically link gcc-8.2.0 against musl

Python3 shared extension doesn't link against library dependency

Can't link against static library with Mingw on Linux

What's the order for gcc to link unresolved symbol in static library

Link error adding library built with Clang to iOS app built with GCC

How can I link my C program against the Arb library?

Link against two versions of the same library (same symbols)

How to link to my own library in gcc?

link against a legacy library: -lgfortranbegin from a premade makefile

How to link a program in GCC to prelinked library?

Can't link custom shared library with gcc

Why does GCC require "-lpthread" to link against pthread functions but doesn't require arguments to link against other functions?

gcc, how to force the final executable link a unused shared library?