problem with make file and math.h in gcc-arm-none-eabi - gcc

i'm working on arm cortex m4 with make file and gcc-arm-none-eabi on ubuntu. when i add math .h library to my project and try to use log10f , the linker exit with errors.
its be good if help my for solve this problem and suggest source for more study ,thank you.
i used -lm but it didn't has any effect.
make file:
# PROJECT: name of the output file
PROJECT = main
SRCS = $(wildcard src/*.c) \
$(wildcard libs/*.c)
OBJ = obj/
# OBJS: list of object files
OBJS = $(addprefix $(OBJ),$(notdir $(SRCS:.c=.o)))
#Flag points to the INC folder containing header files
INC = -Iinc
# LD_SCRIPT: linker script
LD_SCRIPT = ld/GD32f30x.ld
#UTILITY VARIABLES
CC = arm-none-eabi-gcc #compiler
LD = arm-none-eabi-ld #linker
OBJCOPY =arm-none-eabi-objcopy #final executable builder
RM = rm -rf
MKDIR = #mkdir -p $(#D) #creates folders if not present
#GCC FLAGS
CFLAGS = -ggdb -mthumb -mcpu=cortex-m4 -mfpu=fpv4-sp-d16
CFLAGS += -mfloat-abi=softfp -Os -MD -std=c99 -c
#LINKER FLAGS
LDFLAGS = -T $(LD_SCRIPT) -e Reset_Handler
# Rules to build bin
all: bin/$(PROJECT).bin
$(OBJ)%.o: src/%.c #turns .c source files into object files
$(MKDIR)
$(CC) -o $# $^ $(INC) $(CFLAGS)
$(OBJ)%.o: libs/%.c #turns .c source files into object files
$(MKDIR)
$(CC) -o $# $^ $(INC) $(CFLAGS)
bin/$(PROJECT).elf: $(OBJS) ##contains debug symbols for GNU GDB
$(MKDIR)
$(LD) -o $# $^ $(LDFLAGS)
bin/$(PROJECT).bin: bin/$(PROJECT).elf #debug symbols for GNU GDB stripped by objcopy,finished binary ready for flashing
$(OBJCOPY) -O binary $< $#
#Flashes bin to TM4C
flash:
$(FLASHER) -S $(DEV) bin/$(PROJECT).bin
#remove object and bin files
clean:
-$(RM) obj
-$(RM) bin
.PHONY: all clean
errors:
arm-none-eabi-gcc -o obj/ntc_sensor.o libs/ntc_sensor.c -Iinc -I/usr/lib/arm-none-eabi/include -ggdb -mthumb -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=softfp -Os -MD -std=c99 -c
arm-none-eabi-ld -o bin/main.user obj/main.o obj/gd32f30x_rcu.o obj/gd32f30x_gpio.o obj/ntc_sensor.o obj/HT1621B.o obj/temp_ctrl.o obj/gd32f30x_it.o obj/systick.o obj/gd32f30x_pmu.o obj/system_gd32f30x.o obj/startup.o obj/gd32f30x_adc.o -T ld/GD32f30x.ld -e Reset_Handler
arm-none-eabi-ld: obj/ntc_sensor.o: in function `ln':
/home/user/project/embedded/ARM/GigaDevice/GD32f30x/Termostat/libs/ntc_sensor.c:51: undefined reference to `__aeabi_dsub'
arm-none-eabi-ld: /home/user/project/embedded/ARM/GigaDevice/GD32f30x/Termostat/libs/ntc_sensor.c:51: undefined reference to `__aeabi_dadd'
arm-none-eabi-ld: /home/user/project/embedded/ARM/GigaDevice/GD32f30x/Termostat/libs/ntc_sensor.c:51: undefined reference to `__aeabi_ddiv'
arm-none-eabi-ld: /home/user/project/embedded/ARM/GigaDevice/GD32f30x/Termostat/libs/ntc_sensor.c:56: undefined reference to `__aeabi_dcmpgt'
arm-none-eabi-ld: /home/user/project/embedded/ARM/GigaDevice/GD32f30x/Termostat/libs/ntc_sensor.c:64: undefined reference to `__aeabi_dadd'
arm-none-eabi-ld: /home/user/project/embedded/ARM/GigaDevice/GD32f30x/Termostat/libs/ntc_sensor.c:58: undefined reference to `__aeabi_dadd'
arm-none-eabi-ld: /home/user/project/embedded/ARM/GigaDevice/GD32f30x/Termostat/libs/ntc_sensor.c:60: undefined reference to `__aeabi_dadd'
arm-none-eabi-ld: /home/user/project/embedded/ARM/GigaDevice/GD32f30x/Termostat/libs/ntc_sensor.c:61: undefined reference to `__aeabi_dmul'
arm-none-eabi-ld: /home/user/project/embedded/ARM/GigaDevice/GD32f30x/Termostat/libs/ntc_sensor.c:61: undefined reference to `__aeabi_dmul'
arm-none-eabi-ld: /home/user/project/embedded/ARM/GigaDevice/GD32f30x/Termostat/libs/ntc_sensor.c:62: undefined reference to `__aeabi_ddiv'
arm-none-eabi-ld: obj/ntc_sensor.o: in function `log10':
/home/user/project/embedded/ARM/GigaDevice/GD32f30x/Termostat/libs/ntc_sensor.c:70: undefined reference to `__aeabi_dmul'
arm-none-eabi-ld: obj/ntc_sensor.o: in function `get_ntc_Temperature':
/home/user/project/embedded/ARM/GigaDevice/GD32f30x/Termostat/libs/ntc_sensor.c:121: undefined reference to `__aeabi_f2d'
arm-none-eabi-ld: /home/user/project/embedded/ARM/GigaDevice/GD32f30x/Termostat/libs/ntc_sensor.c:121: undefined reference to `__aeabi_dmul'
arm-none-eabi-ld: /home/user/project/embedded/ARM/GigaDevice/GD32f30x/Termostat/libs/ntc_sensor.c:121: undefined reference to `__aeabi_dadd'
arm-none-eabi-ld: /home/user/project/embedded/ARM/GigaDevice/GD32f30x/Termostat/libs/ntc_sensor.c:121: undefined reference to `__aeabi_d2f'
make: *** [Makefile:51: bin/main.user] Error 1
user#user-PC:~/project/embedded/ARM/GigaDevice/GD32f30x/Termostat$ make
arm-none-eabi-ld -o bin/main.user obj/main.o obj/gd32f30x_rcu.o obj/gd32f30x_gpio.o obj/ntc_sensor.o obj/HT1621B.o obj/temp_ctrl.o obj/gd32f30x_it.o obj/systick.o obj/gd32f30x_pmu.o obj/system_gd32f30x.o obj/startup.o obj/gd32f30x_adc.o -T ld/GD32f30x.ld -e Reset_Handler
arm-none-eabi-ld: obj/ntc_sensor.o: in function `ln':
/home/user/project/embedded/ARM/GigaDevice/GD32f30x/Termostat/libs/ntc_sensor.c:51: undefined reference to `__aeabi_dsub'
arm-none-eabi-ld: /home/user/project/embedded/ARM/GigaDevice/GD32f30x/Termostat/libs/ntc_sensor.c:51: undefined reference to `__aeabi_dadd'
arm-none-eabi-ld: /home/user/project/embedded/ARM/GigaDevice/GD32f30x/Termostat/libs/ntc_sensor.c:51: undefined reference to `__aeabi_ddiv'
arm-none-eabi-ld: /home/user/project/embedded/ARM/GigaDevice/GD32f30x/Termostat/libs/ntc_sensor.c:56: undefined reference to `__aeabi_dcmpgt'
arm-none-eabi-ld: /home/user/project/embedded/ARM/GigaDevice/GD32f30x/Termostat/libs/ntc_sensor.c:64: undefined reference to `__aeabi_dadd'
arm-none-eabi-ld: /home/user/project/embedded/ARM/GigaDevice/GD32f30x/Termostat/libs/ntc_sensor.c:58: undefined reference to `__aeabi_dadd'
arm-none-eabi-ld: /home/user/project/embedded/ARM/GigaDevice/GD32f30x/Termostat/libs/ntc_sensor.c:60: undefined reference to `__aeabi_dadd'
arm-none-eabi-ld: /home/user/project/embedded/ARM/GigaDevice/GD32f30x/Termostat/libs/ntc_sensor.c:61: undefined reference to `__aeabi_dmul'
arm-none-eabi-ld: /home/user/project/embedded/ARM/GigaDevice/GD32f30x/Termostat/libs/ntc_sensor.c:61: undefined reference to `__aeabi_dmul'
arm-none-eabi-ld: /home/user/project/embedded/ARM/GigaDevice/GD32f30x/Termostat/libs/ntc_sensor.c:62: undefined reference to `__aeabi_ddiv'
arm-none-eabi-ld: obj/ntc_sensor.o: in function `log10':
/home/user/project/embedded/ARM/GigaDevice/GD32f30x/Termostat/libs/ntc_sensor.c:70: undefined reference to `__aeabi_dmul'
arm-none-eabi-ld: obj/ntc_sensor.o: in function `get_ntc_Temperature':
/home/user/project/embedded/ARM/GigaDevice/GD32f30x/Termostat/libs/ntc_sensor.c:121: undefined reference to `__aeabi_f2d'
arm-none-eabi-ld: /home/user/project/embedded/ARM/GigaDevice/GD32f30x/Termostat/libs/ntc_sensor.c:121: undefined reference to `__aeabi_dmul'
arm-none-eabi-ld: /home/user/project/embedded/ARM/GigaDevice/GD32f30x/Termostat/libs/ntc_sensor.c:121: undefined reference to `__aeabi_dadd'
arm-none-eabi-ld: /home/user/project/embedded/ARM/GigaDevice/GD32f30x/Termostat/libs/ntc_sensor.c:121: undefined reference to `__aeabi_d2f'
make: *** [Makefile:51: bin/main.user] Error 1

Related

Issue with installing Lua-cURL on LuaRocks

I'm trying to install Lua-cURL on LuaRocks, but get an error.
cURL Version: Windows 64 bit
cURL Download Link: (https://curl.se/windows/dl-7.82.0_1/curl-7.82.0_1-win64-mingw.zip)
Command:
luarocks install lua-curl CURL_DIR=C:\curl-7.82.0_1-win64-mingw
Error:
collect2.exe: error: ld returned 1 exit status
Error: Build error: Failed compiling module lcurl.dll
Command Output:
C:\WINDOWS\system32>luarocks install lua-curl CURL_DIR=C:\curl-7.82.0_1-win64-mingw
Installing https://luarocks.org/lua-curl-0.3.13-1.src.rock
lua-curl 0.3.13-1 depends on lua >= 5.1, < 5.5 (5.1-1 provided by VM)
C:\i686-6.4.0-release-win32-dwarf-rt_v5-rev0\mingw32\bin\gcc.exe -O2 -c -o src/l52util.o -IC:\Program Files (x86)\LuaRocks\include src/l52util.c -IC:\curl-7.82.0_1-win64-mingw/include
C:\i686-6.4.0-release-win32-dwarf-rt_v5-rev0\mingw32\bin\gcc.exe -O2 -c -o src/lceasy.o -IC:\Program Files (x86)\LuaRocks\include src/lceasy.c -IC:\curl-7.82.0_1-win64-mingw/include
C:\i686-6.4.0-release-win32-dwarf-rt_v5-rev0\mingw32\bin\gcc.exe -O2 -c -o src/lcerror.o -IC:\Program Files (x86)\LuaRocks\include src/lcerror.c -IC:\curl-7.82.0_1-win64-mingw/include
C:\i686-6.4.0-release-win32-dwarf-rt_v5-rev0\mingw32\bin\gcc.exe -O2 -c -o src/lchttppost.o -IC:\Program Files (x86)\LuaRocks\include src/lchttppost.c -IC:\curl-7.82.0_1-win64-mingw/include
C:\i686-6.4.0-release-win32-dwarf-rt_v5-rev0\mingw32\bin\gcc.exe -O2 -c -o src/lcurl.o -IC:\Program Files (x86)\LuaRocks\include src/lcurl.c -IC:\curl-7.82.0_1-win64-mingw/include
C:\i686-6.4.0-release-win32-dwarf-rt_v5-rev0\mingw32\bin\gcc.exe -O2 -c -o src/lcutils.o -IC:\Program Files (x86)\LuaRocks\include src/lcutils.c -IC:\curl-7.82.0_1-win64-mingw/include
C:\i686-6.4.0-release-win32-dwarf-rt_v5-rev0\mingw32\bin\gcc.exe -O2 -c -o src/lcmulti.o -IC:\Program Files (x86)\LuaRocks\include src/lcmulti.c -IC:\curl-7.82.0_1-win64-mingw/include
C:\i686-6.4.0-release-win32-dwarf-rt_v5-rev0\mingw32\bin\gcc.exe -O2 -c -o src/lcshare.o -IC:\Program Files (x86)\LuaRocks\include src/lcshare.c -IC:\curl-7.82.0_1-win64-mingw/include
C:\i686-6.4.0-release-win32-dwarf-rt_v5-rev0\mingw32\bin\gcc.exe -O2 -c -o src/lcmime.o -IC:\Program Files (x86)\LuaRocks\include src/lcmime.c -IC:\curl-7.82.0_1-win64-mingw/include
C:\i686-6.4.0-release-win32-dwarf-rt_v5-rev0\mingw32\bin\gcc.exe -O2 -c -o src/lcurlapi.o -IC:\Program Files (x86)\LuaRocks\include src/lcurlapi.c -IC:\curl-7.82.0_1-win64-mingw/include
C:\i686-6.4.0-release-win32-dwarf-rt_v5-rev0\mingw32\bin\gcc.exe -shared -o lcurl.dll src/l52util.o src/lceasy.o src/lcerror.o src/lchttppost.o src/lcurl.o src/lcutils.o src/lcmulti.o src/lcshare.o src/lcmime.o src/lcurlapi.o -LC:\curl-7.82.0_1-win64-mingw/lib -llibcurl -lws2_32 C:\Program Files (x86)\LuaRocks/lua5.1.lib -lMSVCR80
src/lceasy.o:lceasy.c:(.text+0xe2f): undefined reference to `_imp__curl_easy_setopt'
src/lceasy.o:lceasy.c:(.text+0x1ada): undefined reference to `_imp__curl_easy_init'
src/lceasy.o:lceasy.c:(.text+0x1d6d): undefined reference to `_imp__curl_easy_cleanup'
src/lceasy.o:lceasy.c:(.text+0x1de3): undefined reference to `_imp__curl_easy_upkeep'
src/lceasy.o:lceasy.c:(.text+0x1ea2): undefined reference to `_imp__curl_easy_perform'
src/lceasy.o:lceasy.c:(.text+0x1fe0): undefined reference to `_imp__curl_easy_unescape'
src/lceasy.o:lceasy.c:(.text+0x2003): undefined reference to `_imp__curl_free'
src/lceasy.o:lceasy.c:(.text+0x2088): undefined reference to `_imp__curl_easy_escape'
src/lceasy.o:lceasy.c:(.text+0x20a3): undefined reference to `_imp__curl_free'
src/lceasy.o:lceasy.c:(.text+0x2103): undefined reference to `_imp__curl_easy_reset'
src/lceasy.o:lceasy.c:(.text+0x2196): undefined reference to `_imp__curl_easy_pause'
src/lceasy.o:lceasy.c:(.text+0x2270): undefined reference to `_imp__curl_easy_getinfo'
src/lceasy.o:lceasy.c:(.text+0x2450): undefined reference to `_imp__curl_easy_getinfo'
src/lceasy.o:lceasy.c:(.text+0x2560): undefined reference to `_imp__curl_easy_getinfo'
src/lceasy.o:lceasy.c:(.text+0x26e0): undefined reference to `_imp__curl_easy_getinfo'
src/lceasy.o:lceasy.c:(.text+0x2701): undefined reference to `_imp__curl_slist_free_all'
src/lceasy.o:lceasy.c:(.text+0x2790): undefined reference to `_imp__curl_easy_getinfo'
src/lceasy.o:lceasy.c:(.text+0x28e1): undefined reference to `_imp__curl_easy_setopt'
src/lceasy.o:lceasy.c:(.text+0x29d3): undefined reference to `_imp__curl_easy_setopt'
src/lceasy.o:lceasy.c:(.text+0x2a73): undefined reference to `_imp__curl_easy_setopt'
src/lceasy.o:lceasy.c:(.text+0x2b13): undefined reference to `_imp__curl_easy_setopt'
src/lceasy.o:lceasy.c:(.text+0x2bb3): undefined reference to `_imp__curl_easy_setopt'
src/lceasy.o:lceasy.c:(.text+0x2c51): more undefined references to `_imp__curl_easy_setopt' follow
src/lceasy.o:lceasy.c:(.text+0x49a4): undefined reference to `_imp__curl_slist_free_all'
src/lceasy.o:lceasy.c:(.text+0x4ba1): undefined reference to `_imp__curl_easy_setopt'
src/lceasy.o:lceasy.c:(.text+0x4c54): undefined reference to `_imp__curl_easy_setopt'
src/lceasy.o:lceasy.c:(.text+0x4d0f): undefined reference to `_imp__curl_easy_setopt'
src/lceasy.o:lceasy.c:(.text+0x4fe4): undefined reference to `_imp__curl_easy_setopt'
src/lceasy.o:lceasy.c:(.text+0x5141): undefined reference to `_imp__curl_easy_setopt'
src/lceasy.o:lceasy.c:(.text+0x51ec): more undefined references to `_imp__curl_easy_setopt' follow
src/lceasy.o:lceasy.c:(.text+0x5e1f): undefined reference to `_imp__curl_slist_free_all'
src/lceasy.o:lceasy.c:(.text+0x5e3e): undefined reference to `_imp__curl_easy_setopt'
src/lceasy.o:lceasy.c:(.text+0x5e89): undefined reference to `_imp__curl_slist_free_all'
src/lceasy.o:lceasy.c:(.text+0x6077): undefined reference to `_imp__curl_easy_getinfo'
src/lceasy.o:lceasy.c:(.text+0x68e9): undefined reference to `_imp__curl_easy_setopt'
src/lceasy.o:lceasy.c:(.text+0x898d): undefined reference to `_imp__curl_easy_setopt'
src/lceasy.o:lceasy.c:(.text+0x8fae): undefined reference to `_imp__curl_easy_setopt'
src/lcerror.o:lcerror.c:(.text+0x1aa): undefined reference to `_imp__curl_easy_strerror'
src/lcerror.o:lcerror.c:(.text+0x1b7): undefined reference to `_imp__curl_multi_strerror'
src/lcerror.o:lcerror.c:(.text+0x1c5): undefined reference to `_imp__curl_share_strerror'
src/lchttppost.o:lchttppost.c:(.text+0x3a8): undefined reference to `_imp__curl_formfree'
src/lchttppost.o:lchttppost.c:(.text+0x512): undefined reference to `_imp__curl_formget'
src/lchttppost.o:lchttppost.c:(.text+0x5b7): undefined reference to `_imp__curl_formget'
src/lchttppost.o:lchttppost.c:(.text+0x644): undefined reference to `_imp__curl_formget'
src/lchttppost.o:lchttppost.c:(.text+0xa8f): undefined reference to `_imp__curl_formadd'
src/lchttppost.o:lchttppost.c:(.text+0xd99): undefined reference to `_imp__curl_formadd'
src/lchttppost.o:lchttppost.c:(.text+0xf18): undefined reference to `_imp__curl_slist_free_all'
src/lchttppost.o:lchttppost.c:(.text+0x105f): undefined reference to `_imp__curl_formadd'
src/lchttppost.o:lchttppost.c:(.text+0x118a): undefined reference to `_imp__curl_formadd'
src/lchttppost.o:lchttppost.c:(.text+0x1199): undefined reference to `_imp__curl_slist_free_all'
src/lchttppost.o:lchttppost.c:(.text+0x143f): undefined reference to `_imp__curl_formadd'
src/lchttppost.o:lchttppost.c:(.text+0x144e): undefined reference to `_imp__curl_slist_free_all'
src/lchttppost.o:lchttppost.c:(.text+0x154e): undefined reference to `_imp__curl_formadd'
src/lchttppost.o:lchttppost.c:(.text+0x16fb): undefined reference to `_imp__curl_formadd'
src/lchttppost.o:lchttppost.c:(.text+0x170a): undefined reference to `_imp__curl_slist_free_all'
src/lchttppost.o:lchttppost.c:(.text+0x1803): undefined reference to `_imp__curl_formadd'
src/lcurl.o:lcurl.c:(.text+0x358): undefined reference to `_imp__curl_easy_option_by_name'
src/lcurl.o:lcurl.c:(.text+0x3b0): undefined reference to `_imp__curl_easy_option_by_id'
src/lcurl.o:lcurl.c:(.text+0x490): undefined reference to `_imp__curl_easy_option_next'
src/lcurl.o:lcurl.c:(.text+0x4fa): undefined reference to `_imp__curl_version_info'
src/lcurl.o:lcurl.c:(.text+0x1105): undefined reference to `_imp__curl_version'
src/lcurl.o:lcurl.c:(.text+0x1666): undefined reference to `_imp__curl_global_init'
src/lcurl.o:lcurl.c:(.text+0x16e5): undefined reference to `_imp__curl_global_init'
src/lcutils.o:lcutils.c:(.text+0x5fa): undefined reference to `_imp__curl_slist_free_all'
src/lcutils.o:lcutils.c:(.text+0x704): undefined reference to `_imp__curl_slist_append'
src/lcmulti.o:lcmulti.c:(.text+0x43a): undefined reference to `_imp__curl_multi_remove_handle'
src/lcmulti.o:lcmulti.c:(.text+0x4fa): undefined reference to `_imp__curl_multi_init'
src/lcmulti.o:lcmulti.c:(.text+0x686): undefined reference to `_imp__curl_multi_cleanup'
src/lcmulti.o:lcmulti.c:(.text+0x830): undefined reference to `_imp__curl_multi_setopt'
src/lcmulti.o:lcmulti.c:(.text+0x8c0): undefined reference to `_imp__curl_multi_setopt'
src/lcmulti.o:lcmulti.c:(.text+0x981): undefined reference to `_imp__curl_multi_setopt'
src/lcmulti.o:lcmulti.c:(.text+0xab0): undefined reference to `_imp__curl_multi_setopt'
src/lcmulti.o:lcmulti.c:(.text+0xbe5): undefined reference to `_imp__curl_multi_setopt'
src/lcmulti.o:lcmulti.c:(.text+0xcba): undefined reference to `_imp__curl_multi_socket_action'
src/lcmulti.o:lcmulti.c:(.text+0xd7a): undefined reference to `_imp__curl_multi_timeout'
src/lcmulti.o:lcmulti.c:(.text+0xe42): undefined reference to `_imp__curl_multi_wait'
src/lcmulti.o:lcmulti.c:(.text+0xe9f): undefined reference to `_imp__curl_multi_timeout'
src/lcmulti.o:lcmulti.c:(.text+0x1134): undefined reference to `_imp__curl_multi_info_read'
src/lcmulti.o:lcmulti.c:(.text+0x1235): undefined reference to `_imp__curl_multi_remove_handle'
src/lcmulti.o:lcmulti.c:(.text+0x130a): undefined reference to `_imp__curl_multi_perform'
src/lcmulti.o:lcmulti.c:(.text+0x14a7): undefined reference to `_imp__curl_multi_add_handle'
src/lcshare.o:lcshare.c:(.text+0x7a): undefined reference to `_imp__curl_share_init'
src/lcshare.o:lcshare.c:(.text+0x1c5): undefined reference to `_imp__curl_share_cleanup'
src/lcshare.o:lcshare.c:(.text+0x261): undefined reference to `_imp__curl_share_setopt'
src/lcmime.o:lcmime.c:(.text+0x1de): undefined reference to `_imp__curl_mime_init'
src/lcmime.o:lcmime.c:(.text+0x42d): undefined reference to `_imp__curl_mime_subparts'
src/lcmime.o:lcmime.c:(.text+0x639): undefined reference to `_imp__curl_mime_free'
src/lcmime.o:lcmime.c:(.text+0x9bd): undefined reference to `_imp__curl_mime_addpart'
src/lcmime.o:lcmime.c:(.text+0xb06): undefined reference to `_imp__curl_mime_encoder'
src/lcmime.o:lcmime.c:(.text+0xbe6): undefined reference to `_imp__curl_mime_type'
src/lcmime.o:lcmime.c:(.text+0xcc6): undefined reference to `_imp__curl_mime_filename'
src/lcmime.o:lcmime.c:(.text+0xda6): undefined reference to `_imp__curl_mime_name'
src/lcmime.o:lcmime.c:(.text+0xe92): undefined reference to `_imp__curl_mime_headers'
src/lcmime.o:lcmime.c:(.text+0xeea): undefined reference to `_imp__curl_mime_headers'
src/lcmime.o:lcmime.c:(.text+0xef9): undefined reference to `_imp__curl_slist_free_all'
src/lcmime.o:lcmime.c:(.text+0x12b0): undefined reference to `_imp__curl_mime_type'
src/lcmime.o:lcmime.c:(.text+0x12d7): undefined reference to `_imp__curl_mime_name'
src/lcmime.o:lcmime.c:(.text+0x1302): undefined reference to `_imp__curl_mime_filename'
src/lcmime.o:lcmime.c:(.text+0x132f): undefined reference to `_imp__curl_mime_headers'
src/lcmime.o:lcmime.c:(.text+0x161e): undefined reference to `_imp__curl_mime_subparts'
src/lcmime.o:lcmime.c:(.text+0x16f8): undefined reference to `_imp__curl_mime_data'
src/lcmime.o:lcmime.c:(.text+0x17ef): undefined reference to `_imp__curl_mime_filedata'
src/lcurlapi.o:lcurlapi.c:(.text+0x26): undefined reference to `_imp__curl_url'
src/lcurlapi.o:lcurlapi.c:(.text+0x88): undefined reference to `_imp__curl_url_set'
src/lcurlapi.o:lcurlapi.c:(.text+0x190): undefined reference to `_imp__curl_url_get'
src/lcurlapi.o:lcurlapi.c:(.text+0x1a7): undefined reference to `_imp__curl_free'
src/lcurlapi.o:lcurlapi.c:(.text+0x1ed): undefined reference to `_imp__curl_free'
src/lcurlapi.o:lcurlapi.c:(.text+0x245): undefined reference to `_imp__curl_url_cleanup'
src/lcurlapi.o:lcurlapi.c:(.text+0x29d): undefined reference to `_imp__curl_url_dup'
src/lcurlapi.o:lcurlapi.c:(.text+0x34e): undefined reference to `_imp__curl_url_get'
src/lcurlapi.o:lcurlapi.c:(.text+0x367): undefined reference to `_imp__curl_free'
src/lcurlapi.o:lcurlapi.c:(.text+0x3bd): undefined reference to `_imp__curl_free'
src/lcurlapi.o:lcurlapi.c:(.text+0x5b7): undefined reference to `_imp__curl_url_set'
collect2.exe: error: ld returned 1 exit status
Error: Build error: Failed compiling module lcurl.dll
Any help would be highly appreciated, thanks.
I found the issue, I needed the 32 bit cURL instead of the 64 bit.
cURL Windows 32 Bit Download: https://curl.se/windows/dl-7.82.0_1/curl-7.82.0_1-win32-mingw.zip

Error when compiling my fortran code. I believe that error is in cuba library, but i installed the library correctly

I am a beginning in programming and I need help in my code in Fortran. The error displayed when compiling is
joaovitor1729#joao:~/Fortran/centrol-foton$ make teste_intmult
gfortran -O3 -c -o teste_intmult.o teste_intmult.f90
cc -L/home/joaovitor1729/lib teste_intmult.o -o teste_intmult
/usr/bin/ld: teste_intmult.o: in function `MAIN__':
teste_intmult.f90:(.text+0x93): undefined reference to `cuhre_'
/usr/bin/ld: teste_intmult.f90:(.text+0xd3): undefined reference to `_gfortran_st_write'
/usr/bin/ld: teste_intmult.f90:(.text+0xe7): undefined reference to `_gfortran_transfer_character_write'
/usr/bin/ld: teste_intmult.f90:(.text+0x14a): undefined reference to `_gfortran_transfer_array_write'
/usr/bin/ld: teste_intmult.f90:(.text+0x15a): undefined reference to `_gfortran_transfer_integer_write'
/usr/bin/ld: teste_intmult.f90:(.text+0x1b8): undefined reference to `_gfortran_transfer_array_write'
/usr/bin/ld: teste_intmult.f90:(.text+0x211): undefined reference to `_gfortran_transfer_array_write'
/usr/bin/ld: teste_intmult.f90:(.text+0x221): undefined reference to `_gfortran_transfer_integer_write'
/usr/bin/ld: teste_intmult.f90:(.text+0x229): undefined reference to `_gfortran_st_write_done'
/usr/bin/ld: teste_intmult.f90:(.text+0x2b1): undefined reference to `suave_'
/usr/bin/ld: teste_intmult.f90:(.text+0x2ec): undefined reference to `_gfortran_st_write'
/usr/bin/ld: teste_intmult.f90:(.text+0x300): undefined reference to `_gfortran_transfer_character_write'
/usr/bin/ld: teste_intmult.f90:(.text+0x35e): undefined reference to `_gfortran_transfer_array_write'
/usr/bin/ld: teste_intmult.f90:(.text+0x36e): undefined reference to `_gfortran_transfer_integer_write'
/usr/bin/ld: teste_intmult.f90:(.text+0x3cc): undefined reference to `_gfortran_transfer_array_write'
/usr/bin/ld: teste_intmult.f90:(.text+0x427): undefined reference to `_gfortran_transfer_array_write'
/usr/bin/ld: teste_intmult.f90:(.text+0x437): undefined reference to `_gfortran_transfer_integer_write'
/usr/bin/ld: teste_intmult.f90:(.text+0x43f): undefined reference to `_gfortran_st_write_done'
/usr/bin/ld: teste_intmult.o: in function `fx_':
teste_intmult.f90:(.text+0x4cd): undefined reference to `exp'
/usr/bin/ld: teste_intmult.o: in function `main':
teste_intmult.f90:(.text.startup+0x5): undefined reference to `_gfortran_set_args'
/usr/bin/ld: teste_intmult.f90:(.text.startup+0x16): undefined reference to `_gfortran_set_options'
collect2: error: ld returned 1 exit status
make: *** [<builtin>: teste_intmult] Error 1
rm teste_intmult.o
This is my Makefile
...
F90C = gfortran
F90BANDEIRAS = -O3
LDFLAGS = -L${HOME}/lib
LIBS = -ldquadpack -lm
LIBM = -lcuba -lm
OBJC = defaults.o parcom.o
EXEC =
NCLVL = 15
.SUFIXOS: .f90 .f .o
.KEEP_STATE:
#####################################
teste_intmult: ${OBJC} teste_intmult.o ${F90C} -o run.teste_intmult ${F90FLAGS} ${OBJC} teste_intmult.o ${LDFLAGS} ${LIBS}
#####################################
%.o: %.f90 ${F90C} ${F90FLAGS} -c -o $# $<
#####################################
clean: -rm -vf run.* . ~ *~ *.o a.out *.mod genmod
veryclean: -rm -vf *.o .mod . ~ ~ .exe .sh.o a.out run . genmod . *.run ############### o fim ###############

Undefined references in hand-built Makefile

I have a problem with this Makefile, I get a strange gtkmm error.
CXX=g++
MYSQL_DIR=C:/Program\ Files/MySQL/Connector\ C++\ 1.1/
# -W -Wall -Wextra -Werror
CXXFLAGS=-Wall -std=c++11 $(shell pkg-config --cflags gtkmm-3.0) -I$(MYSQL_DIR)/include -IC:/local/boost_1_72_0
OBJECTS= main.o
LDLIBS=$(shell pkg-config --libs gtkmm-3.0) -LC:/local/boost_1_72_0/libs -L$(MYSQL_DIR)/lib -LC:/Program\ Files/MySQL/Connector\ C++\ 1.1/lib/opt -lmysqlcppconn -lmysqlcppconn-static
AffittiApp: $(OBJECTS)
$(CXX) $(OBJECTS) -o AffittiApp
main.o: MainWindow.h MainWindow.cpp Affitto.h Affitto.cpp Conguaglio.h Conguaglio.cpp Inquilino.h Inquilino.cpp Stabile.h Stabile.cpp
$(CXX) $(CXXFLAGS) $(LDLIBS) -c main.cpp MainWindow.cpp Affitto.cpp Conguaglio.cpp Inquilino.cpp Stabile.cpp
clean :
rm -f AffittiApp
rm *.o
echo "pulizia completata"
With this g++ command all works fine
g++ -Wall -std=c++11 Conguaglio.h Conguaglio.cpp Stabile.h Stabile.cpp Inquilino.h Inquilino.cpp Affitto.h Affitto.cpp MainWindow.h MainWindow.cpp main.cpp `pkg-config gtkmm-3.0 --cflags --libs` -IC:/Program\ Files/MySQL/Connector\ C++\ 1.1/include -LC:/Program\ Files/MySQL/Connector\ C++\ 1.1/lib -IC:/local/boost_1_72_0 -LC:/local/boost_1_72_0/libs -LC:/Program\ Files/MySQL/Connector\ C++\ 1.1/lib/opt -lmysqlcppconn -lmysqlcppconn-static
The errors that I get are those:
main.o:main.cpp:(.text+0x35): undefined reference to `Glib::ustring::ustring(char const*)'
main.o:main.cpp:(.text+0x67): undefined reference to `Gtk::Application::create(int&, char**&, Glib::ustring const&, Gio::ApplicationFlags)'
main.o:main.cpp:(.text+0x76): undefined reference to `Glib::ustring::~ustring()'
main.o:main.cpp:(.text+0x82): undefined reference to `MainWindow::MainWindow()'
main.o:main.cpp:(.text+0xa0): undefined reference to `Gtk::Application::run(Gtk::Window&)'
main.o:main.cpp:(.text+0xb1): undefined reference to `MainWindow::~MainWindow()'
main.o:main.cpp:(.text+0xd6): undefined reference to `Glib::ustring::~ustring()'
main.o:main.cpp:(.text+0xf0): undefined reference to `MainWindow::~MainWindow()'
exe: error: ld returned 1 exit status
make: *** [Makefile:11: AffittiApp] Error 1
What I wrong in the Makefile? Can somebody help me please? Thanks!
So, I found the problem...I have to put $(LDLIBS) in the AffittiApp section. Like this (the complete code)
CXX=g++
MYSQL_DIR=C:/Program\ Files/MySQL/Connector\ C++\ 1.1/
CXXFLAGS=-Wall -std=c++11 $(shell pkg-config --cflags gtkmm-3.0) -I$(MYSQL_DIR)/include -IC:/local/boost_1_72_0
OBJECTS= main.o MainWindow.o Affitto.o Inquilino.o Stabile.o Conguaglio.o
LDLIBS=$(shell pkg-config --libs gtkmm-3.0) -LC:/local/boost_1_72_0/libs -L$(MYSQL_DIR)/lib -L$(MYSQL_DIR)/lib/opt -lmysqlcppconn -lmysqlcppconn-static
AffittiApp: $(OBJECTS)
$(CXX) $(OBJECTS) $(LDLIBS) -o AffittiApp
main.o: MainWindow.h MainWindow.cpp Affitto.h Affitto.cpp Conguaglio.h Conguaglio.cpp Inquilino.h Inquilino.cpp Stabile.h Stabile.cpp
$(CXX) $(CXXFLAGS) -c main.cpp
I wrote this answer in case somebody have the same problem.

makefile undefined reference error

I'm having trouble compiling my project I am coding files wordbench2.h, wordbench2.cpp, makefile.wb2, oaa_bst.h for the main file I was given (main_wb2.cpp) I was wondering if anyone sees something wrong in my makefile
LIB = /home/courses/cop4530p/LIB
CPP = $(LIB)/cpp
TCPP = $(LIB)/tcpp
PROJ = .
INCPATH = -I$(PROJ)-I$(CPP)-I$(TCPP)
CC = g++ -std=c++11 -Wall -Wextra -I. -I$(CPP)
#target:
all: wb2.x foaa.x moaa.x
#foaa+.x
main_wb2.o: wordbench2.h main_wb2.cpp
$(CC) -c main_wb2.cpp
foaa.o: wordbench2.h foaa.cpp
$(CC) -c foaa.cpp
moaa.o: wordbench2.h moaa.cpp
$(CC) -c moaa.cpp
wordbench2.o: wordbench2.h wordbench2.cpp wordify.cpp
$(CC) -c wordbench2.cpp
xstring.o: $(CPP)/xstring.h $(CPP)/xstring.cpp
$(CC) $(INCPATH) -c $(CPP)/xstring.cpp
wb2.x: main_wb2.o wordbench2.o xstring.o
$(CC) -o wb2.x main_wb2.o
foaa.x: foaa.o wordbench2.o xstring.o
$(CC) -o foaa.x foaa.o
moaa.x: moaa.o wordbench2.o xstring.o
$(CC) -o moaa.x moaa.o
Error
g++ -std=c++11 -Wall -Wextra -I. -I/home/courses/cop4530p/LIB/cpp -o wb2.x main_wb2.o
main_wb2.o: In function `main':
main_wb2.cpp:(.text+0xfd): undefined reference to `WordBench::WordBench()'
main_wb2.cpp:(.text+0x109): undefined reference to `fsu::String::String()'
main_wb2.cpp:(.text+0x115): undefined reference to `fsu::String::String()'
main_wb2.cpp:(.text+0x1ad): undefined reference to `fsu::operator>>(std::istream&, fsu::String&)'
main_wb2.cpp:(.text+0x1c4): undefined reference to `fsu::operator<<(std::ostream&, fsu::String const&)'
main_wb2.cpp:(.text+0x1f1): undefined reference to `fsu::operator<<(std::ostream&, fsu::String const&)'
main_wb2.cpp:(.text+0x21e): undefined reference to `fsu::operator>>(std::istream&, fsu::String&)'
main_wb2.cpp:(.text+0x235): undefined reference to `fsu::operator<<(std::ostream&, fsu::String const&)'
main_wb2.cpp:(.text+0x25d): undefined reference to `WordBench::ReadText(fsu::String const&, bool)'
main_wb2.cpp:(.text+0x28f): undefined reference to `fsu::operator>>(std::istream&, fsu::String&)'
main_wb2.cpp:(.text+0x2a6): undefined reference to `fsu::operator<<(std::ostream&, fsu::String const&)'
main_wb2.cpp:(.text+0x2d3): undefined reference to `fsu::operator<<(std::ostream&, fsu::String const&)'
main_wb2.cpp:(.text+0x300): undefined reference to `fsu::operator>>(std::istream&, fsu::String&)'
main_wb2.cpp:(.text+0x317): undefined reference to `fsu::operator<<(std::ostream&, fsu::String const&)'
main_wb2.cpp:(.text+0x33f): undefined reference to `WordBench::ReadText(fsu::String const&, bool)'
main_wb2.cpp:(.text+0x371): undefined reference to `fsu::operator>>(std::istream&, fsu::String&)'
main_wb2.cpp:(.text+0x388): undefined reference to `fsu::operator<<(std::ostream&, fsu::String const&)'
main_wb2.cpp:(.text+0x3b5): undefined reference to `fsu::operator<<(std::ostream&, fsu::String const&)'
main_wb2.cpp:(.text+0x3e2): undefined reference to `fsu::operator>>(std::istream&, fsu::String&)'
main_wb2.cpp:(.text+0x3f9): undefined reference to `fsu::operator<<(std::ostream&, fsu::String const&)'
main_wb2.cpp:(.text+0x42f): undefined reference to `WordBench::WriteReport(fsu::String const&, unsigned short, unsigned short, std::_Ios_Fmtflags, std::_Ios_Fmtflags) const'
main_wb2.cpp:(.text+0x44d): undefined reference to `fsu::String::operator=(fsu::String const&)'
main_wb2.cpp:(.text+0x45e): undefined reference to `fsu::String::Size() const'
main_wb2.cpp:(.text+0x488): undefined reference to `fsu::String::Cstr() const'
main_wb2.cpp:(.text+0x4d9): undefined reference to `fsu::operator<<(std::ostream&, fsu::String const&)'
main_wb2.cpp:(.text+0x572): undefined reference to `WordBench::ClearData()'
main_wb2.cpp:(.text+0x595): undefined reference to `WordBench::ShowSummary() const'
main_wb2.cpp:(.text+0x67a): undefined reference to `fsu::String::~String()'
main_wb2.cpp:(.text+0x686): undefined reference to `fsu::String::~String()'
main_wb2.cpp:(.text+0x695): undefined reference to `WordBench::~WordBench()'
main_wb2.cpp:(.text+0x6cb): undefined reference to `fsu::String::~String()'
main_wb2.cpp:(.text+0x6dc): undefined reference to `fsu::String::~String()'
main_wb2.cpp:(.text+0x6f0): undefined reference to `WordBench::~WordBench()'
collect2: error: ld returned 1 exit status
make: *** [wb2.x] Error 1
In this rule:
wb2.x: main_wb2.o wordbench2.o xstring.o
$(CC) -o wb2.x main_wb2.o
you list wordbench2.o and xstring.o in your prerequisites list, but you didn't put them onto the compile line.
Why are you rewriting the same things over and over? That just leads to silly errors like this. Use automatic variables to avoid retyping and getting things wrong:
wb2.x: main_wb2.o wordbench2.o xstring.o
$(CC) -o $# $^
Ditto for your other linker rules.

makefile for cppunit

this is my makefile :
#Makefile
CC=g++
CFLAGS=-lcppunit
OBJS=Money.o MoneyTest.o
all : $(OBJS)
$(CC) $(OBJS) -o TestUnitaire
#création des objets
Money.o: Money.cpp Money.hpp
$(CC) -c Money.cpp $(CFLAGS)
MoneyTest.o: MoneyTest.cpp Money.hpp MoneyTest.hpp
$(CC) -c MoneyTest.cpp $(CFLAGS)
clean:
rm *.o $(EXEC)
when i run this makefile, i get errors like those :
g++ Money.o MoneyTest.o -o TestUnitaire
Money.o: In function main':
Money.cpp:(.text+0x3c): undefined reference toCppUnit::TestFactoryRegistry::getRegistry(std::basic_string, std::allocator > const&)'
Money.cpp:(.text+0x78): undefined reference to CppUnit::TextTestRunner::TextTestRunner(CppUnit::Outputter*)'
Money.cpp:(.text+0x8c): undefined reference toCppUnit::TestRunner::addTest(CppUnit::Test*)'
Money.cpp:(.text+0x98): undefined reference to CppUnit::TextTestRunner::result() const'
Money.cpp:(.text+0xec): undefined reference toCppUnit::CompilerOutputter::CompilerOutputter(CppUnit::TestResultCollector*, std::basic_ostream >&, std::basic_string, std::allocator > const&)'
Money.cpp:(.text+0xfc): undefined reference to CppUnit::TextTestRunner::setOutputter(CppUnit::Outputter*)'
Money.cpp:(.text+0x168): undefined reference toCppUnit::TextTestRunner::run(std::basic_string, std::allocator >, bool, bool, bool)'
Money.cpp:(.text+0x1a5): undefined reference to CppUnit::TextTestRunner::~TextTestRunner()'
Money.cpp:(.text+0x233): undefined reference toCppUnit::TextTestRunner::~TextTestRunner()'
It's seems to be that there no link between my class. What's the trouble ?
The -lcppunit flag is not correct in CFLAGS, which is where you put C compiler flags. You are (a) compiling C++ programs, not C programs, and (b) the -l flag is a linker flag, not a compiler flag. Also, the CC variable holds the C compiler. You should use the CXX variable for the C++ compiler. Your makefile should look something like:
#Makefile
CXX = g++
LDLIBS = -lcppunit
OBJS = Money.o MoneyTest.o
all : TestUnitaire
TestUnitaire: $(OBJS)
$(CXX) $^ -o $# $(LDFLAGS) $(LDLIBS)
#création des objets
%.o : %.cpp
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -o $# -c $<
Money.o: Money.hpp
MoneyTest.o: Money.hpp MoneyTest.hpp
clean:
rm *.o $(EXEC)

Resources