ELF failes but no errors

ulaoulao
Posts: 21
Joined: Thu Jun 13, 2024 6:25 pm

ELF failes but no errors

Postby ulaoulao » Mon Jun 17, 2024 11:49 am

What does it mean when the ELF fails to build but there are no errors?

under problems is says there are none.
under Terminal is says FAILED: usb2llapi.elf
under that I get I few errors saying already defined. for example

Code: Select all

cmd.exe /C "cd . && C:\Users\Administrator\.espressif\tools\xtensa-esp-elf\esp-13.2.0_20240530\xtensa-esp-elf\bin\xtensa-esp32s3-elf-g++.exe -mlongcalls  -fno-builtin-memcpy -fno-builtin-memset -fno-builtin-bzero -fno-builtin-stpcpy -fno-builtin-strncpy -Wl,--cref -Wl,--defsym=IDF_TARGET_ESP32S3=0 -Wl,--Map=C:/Users/Administrator/Desktop/usb2llapi/usb_host_lib/build/usb2llapi.map -Wl,--no-warn-rwx-segments -fno-rtti -fno-lto -Wl,--gc-sections -Wl,--warn-common -T esp32s3.peripherals.ld -T esp32s3.rom.ld -T esp32s3.rom.api.ld -T esp32s3.rom.libgcc.ld -T esp32s3.rom.wdt.ld -T esp32s3.rom.version.ld -T esp32s3.rom.newlib.ld -T memory.ld -T sections.ld @CMakeFiles\usb2llapi.elf.rsp -o usb2llapi.elf  && cd ."

I’m pretty sure the issue is this h file. Because I was working in it when the issue popped up. but I have the ifdef in there?

Code: Select all

#ifndef _USB2LLAPI_H_
#define _USB2LLAPI_H_

 


#include <stdbool.h> //bug fix I guess?
#define _delay_ms(t) vTaskDelay(t / portTICK_PERIOD_MS);

unsigned char psx_pressure_data[12];
unsigned char mapper[24];

struct ControlData
{
	unsigned char ButtonRow1;
	unsigned char ButtonRow2;
	unsigned char ButtonRow3;
	unsigned char MainStickX;
	unsigned char MainStickY;
	unsigned char Zaxis1;
	unsigned char SecondaryStickX;
	unsigned char SecondaryStickY;
	unsigned char Zaxis2;
	unsigned char Slider;
	unsigned char Dial;
	unsigned char POV;
	unsigned char BUTTON_LAYOUT;
	bool RumbleCapable;
	bool SmallRumbling;
	bool LargeRumbling;
	bool Busy;
	bool AutoPause;
	bool DoNotReport;
	bool PSX;
	bool DDREV;
	bool DPAD_ONLY;
	bool Sensitive;
	unsigned char Type;
} ; 
struct ControlData padData; 



struct ModesStates
{
//do not make bool or eeprom of a FF state will be lost. 
	unsigned char UDLR;
	unsigned char HOTSWAP_DISABLED;
	unsigned char AUTO_PAUSE_DIABLED;
	unsigned char DISABLE_COMBOS;
	unsigned char HOTKEY;
	unsigned int  TURBO_SPEED;
	unsigned int  TURBO_MASKED_BUTTONS_;
	unsigned char MAPPING_SELECTION; 
	unsigned char SWAP_BUTTONS1;
	unsigned char SWAP_BUTTONS2;
	unsigned char ROTATION_SHIFT;
	unsigned char RANGE_SELECTION;
	unsigned char LATENCY;
} ;
struct ModesStates modes; 



typedef struct 
{
	bool          ( *init)	    (void);
	unsigned char ( *getCommand)(void);

} LLAPIDevice; 

#endif

MicroController
Posts: 1759
Joined: Mon Oct 17, 2022 7:38 pm
Location: Europe, Germany

Re: ELF failes but no errors

Postby MicroController » Tue Jun 18, 2024 10:26 am

ulaoulao wrote:
Mon Jun 17, 2024 11:49 am
under that I get I few errors saying already defined. for example
Would be helpful if you'd share the actual error messages...
I’m pretty sure the issue is this h file. Because I was working in it when the issue popped up. but I have the ifdef in there?
In the header file, you're defining two things:
1. #define _delay_ms(t) - which can make the preprocessor error out if _delay_ms(...) is also #defined at another place,
2. unsigned char psx_pressure_data[12]; ... - defines a variable named psx_pressure_data. You usually don't want to define global variables (and non-static functions) inside a header file because the header file may be included in multiple C files resulting in multiple definitions of the same named entity which is at least problematic. See also https://www.cprogramming.com/declare_vs_define.html

ulaoulao
Posts: 21
Joined: Thu Jun 13, 2024 6:25 pm

Re: ELF failes but no errors

Postby ulaoulao » Thu Jun 20, 2024 2:32 pm

I was able to figure it out the error was not in the problems tab it was hidden in the output.

Who is online

Users browsing this forum: Baidu [Spider] and 69 guests