Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Make Error
Make Error [message #1738701] Fri, 22 July 2016 12:18 Go to next message
Ciocan Cosmin is currently offline Ciocan CosminFriend
Messages: 3
Registered: July 2016
Junior Member
Hello guys. I need some help with solving an error. I was trying to create a simple bluetooth server using the library bluez-5.31 . I am using eclipse on Raspbian Jessie which is similar to Debian but I have little to no experience with either one. I tried fixing it for a couple days now and nothing seems to be working so i really need some help...
This is the error description:
error 1:	make:*** [Bluetooth Server 2]Error 1         		Resource: Bluetooth Server 2		
error 2: 	recipe for target 'Bluetooth Server 2' failed		Resource: makefile          		Path: /Bluetooth Server 2/Debug		Location: line 45

where "Bluetooth Server 2" is the name of the project


This is main:
#include "/usr/include/stdint.h"
#include "/usr/include/bluez-5.31/lib/bluetooth.h"
#include "/usr/include/bluez-5.31/lib/hci.h"
#include "/usr/include/bluez-5.31/lib/hci_lib.h"
#include "/usr/include/bluez-5.31/lib/rfcomm.h"

int main(int argc, char **argv)
{
	struct sockaddr_rc loc_addr = { 0 }, rem_addr = { 0 };
	char buf[1024] = { 0 };
	int s, client, bytes_read;
	unsigned int opt = sizeof(rem_addr);

	//allocate socket
	s = socket(AF_BLUETOOTH, SOCK_STREAM, BTPROTO_RFCOMM);

	//bind socket to port 1 of the first available adapter

	bdaddr_t tmp = {0,0,0,0,0,0};

	loc_addr.rc_family = AF_BLUETOOTH;
	loc_addr.rc_bdaddr = tmp;
	loc_addr.rc_channel = 1;
	bind(s, (struct sockaddr* )&loc_addr, sizeof(loc_addr));

	//put socket into listening mode
	listen(s, 1);

	//accept one connection
	client = accept(s, (struct sockaddr *)&rem_addr, &opt);

	ba2str( &rem_addr.rc_bdaddr, buf );
	fprintf( stderr, "accepter connection from %s\n", buf);
	memset( buf, 0, sizeof(buf));

	//read data from the client
	bytes_read = recv(client, buf, sizeof(buf), 0);
	if( bytes_read > 0 )
	{
		printf("received [%s]\n", buf);
	}

	//close connection
	//close(client);
	//close(s);
	return 0;
}


This is the make file:
################################################################################
# Automatically-generated file. Do not edit!
################################################################################

-include ../makefile.init

RM := rm -rf

# All of the sources participating in the build are defined here
-include sources.mk
-include src/subdir.mk
-include subdir.mk
-include objects.mk

ifneq ($(MAKECMDGOALS),clean)
ifneq ($(strip $(C++_DEPS)),)
-include $(C++_DEPS)
endif
ifneq ($(strip $(C_DEPS)),)
-include $(C_DEPS)
endif
ifneq ($(strip $(CC_DEPS)),)
-include $(CC_DEPS)
endif
ifneq ($(strip $(CPP_DEPS)),)
-include $(CPP_DEPS)
endif
ifneq ($(strip $(CXX_DEPS)),)
-include $(CXX_DEPS)
endif
ifneq ($(strip $(C_UPPER_DEPS)),)
-include $(C_UPPER_DEPS)
endif
endif

-include ../makefile.defs

# Add inputs and outputs from these tool invocations to the build variables 

# All Target
all: Bluetooth\ Server\ 2

# Tool invocations
Bluetooth\ Server\ 2: $(OBJS) $(USER_OBJS)
	@echo 'Building target: $@'
	@echo 'Invoking: GCC C++ Linker'
	g++ -L/usr/include/ -bluez-5.31 -o "Bluetooth Server 2" $(OBJS) $(USER_OBJS) $(LIBS)
	@echo 'Finished building target: $@'
	@echo ' '

# Other Targets
clean:
	-$(RM) $(OBJS)$(C++_DEPS)$(C_DEPS)$(CC_DEPS)$(CPP_DEPS)$(EXECUTABLES)$(CXX_DEPS)$(C_UPPER_DEPS) "Bluetooth Server 2"
	-@echo ' '

.PHONY: all clean dependents
.SECONDARY:

-include ../makefile.targets


And this is what changes i made to project properties
- C/C++ Build >> Settings >> Tool Settings >> GCC C++ Linker >> Miscellaneous: In the linker flags box i wrote: "-bluez-5.31"
- C/C++ Build >> Settings >> Tool Settings >> GCC C++ Linker >> Libraries: Added " "bluez-5.31" " in -l
- C/C++ Build >> Settings >> Tool Settings >> GCC C++ Linker >> Libraries: Added " /usr/include " in -L
Re: Make Error [message #1738771 is a reply to message #1738701] Sat, 23 July 2016 17:12 Go to previous message
Ciocan Cosmin is currently offline Ciocan CosminFriend
Messages: 3
Registered: July 2016
Junior Member
What seems to have caused the problem is the space in the project name. Made a new project that did not have an empty space in its name and everything works fine.
Previous Topic:Arduino CDT IDE changing AVR gcc compile options
Next Topic:files in the project does not get compiled
Goto Forum:
  


Current Time: Fri Apr 26 13:09:18 GMT 2024

Powered by FUDForum. Page generated in 0.03151 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top