g++: error: +: No such file or directory when building custom dll
-
Good morning,
some time ago I experimented with Windows API and it, in the end, worked fine.Then I got a moment of enlightenment and kicked myself - upon investigating MinGW delivered with Qt I found the includes and everything so I decided to rebuild parts. Finally I decided to wrap up all the WinAPI routines in the library, so the includes don't mess much with my main project.
And here is the problem. I named small boilerplate code of the library icmp, so the result is simple icmp.dll file (all it does is ping hosts after all). But when I try to compile subproject, I get this error:
g++: error: +: No such file or directory mingw32-make[1]: *** [Makefile.Debug:69: ../../../libs/icmp/icmp.dll] Error 1
like it can't find the library it is supposed to build?
I searched the forum, checked for extra spaces and all, to no avail. I don't know where to search further...
All the paths and files and includes are correct, as far as I can tell.
.pro file:QT -= gui TEMPLATE = lib CONFIG += c++11 SOURCES += \ icmp.cpp HEADERS += \ icmp.h INCLUDEPATH += c:/Qt/Tools/mingw810_64/x86_64-w64-mingw32/include/ DEPENDPATH += c:/Qt/Tools/mingw810_64/x86_64-w64-mingw32/lib/ LIBS =+ -LC:/Qt/Tools/mingw810_64/x86_64-w64-mingw32/lib/ -liphlpapi LIBS =+ -LC:/Qt/Tools/mingw810_64/x86_64-w64-mingw32/lib/ -lws2_32 DESTDIR = ../../../libs/icmp
Full compile output:
11:27:57: Starting: "C:\Qt\Tools\mingw810_64\bin\mingw32-make.exe" -j4 C:/Qt/Tools/mingw810_64/bin/mingw32-make -f Makefile.Debug mingw32-make[1]: Entering directory 'Z:/cpp/build-OCT-Desktop_Qt_5_15_2_MinGW_64_bit-Debug/icmp' g++ -c -fno-keep-inline-dllexport -g -std=gnu++11 -Wall -Wextra -Wextra -fexceptions -mthreads -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -DQT_QML_DEBUG -DQT_CORE_LIB -I..\..\OCT\icmp -I. -Ic:\Qt\Tools\mingw810_64\x86_64-w64-mingw32\include -IC:\Qt\5.15.2\mingw81_64\include -IC:\Qt\5.15.2\mingw81_64\include\QtCore -Idebug -IC:\Qt\5.15.2\mingw81_64\mkspecs\win32-g++ -o debug\icmp.o ..\..\OCT\icmp\icmp.cpp g++ -fno-keep-inline-dllexport -g -std=gnu++11 -Wall -Wextra -Wextra -dM -E -o debug\moc_predefs.h C:\Qt\5.15.2\mingw81_64\mkspecs\features\data\dummy.cpp C:\Qt\5.15.2\mingw81_64\bin\moc.exe -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -DQT_QML_DEBUG -DQT_CORE_LIB --include Z:/cpp/build-OCT-Desktop_Qt_5_15_2_MinGW_64_bit-Debug/icmp/debug/moc_predefs.h -IC:/Qt/5.15.2/mingw81_64/mkspecs/win32-g++ -IZ:/cpp/OCT/icmp -Ic:/Qt/Tools/mingw810_64/x86_64-w64-mingw32/include -IC:/Qt/5.15.2/mingw81_64/include -IC:/Qt/5.15.2/mingw81_64/include/QtCore -I. -IC:/Qt/Tools/mingw810_64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++ -IC:/Qt/Tools/mingw810_64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/x86_64-w64-mingw32 -IC:/Qt/Tools/mingw810_64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/backward -IC:/Qt/Tools/mingw810_64/lib/gcc/x86_64-w64-mingw32/8.1.0/include -IC:/Qt/Tools/mingw810_64/lib/gcc/x86_64-w64-mingw32/8.1.0/include-fixed -IC:/Qt/Tools/mingw810_64/x86_64-w64-mingw32/include ..\..\OCT\icmp\icmp.h -o debug\moc_icmp.cpp g++ -c -fno-keep-inline-dllexport -g -std=gnu++11 -Wall -Wextra -Wextra -fexceptions -mthreads -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -DQT_QML_DEBUG -DQT_CORE_LIB -I..\..\OCT\icmp -I. -Ic:\Qt\Tools\mingw810_64\x86_64-w64-mingw32\include -IC:\Qt\5.15.2\mingw81_64\include -IC:\Qt\5.15.2\mingw81_64\include\QtCore -Idebug -IC:\Qt\5.15.2\mingw81_64\mkspecs\win32-g++ -o debug\moc_icmp.o debug\moc_icmp.cpp ..\..\OCT\icmp\icmp.cpp: In member function 'bool ICMP::runTest(const QString&)': ..\..\OCT\icmp\icmp.cpp:28:24: warning: variable 'ReplyAddr' set but not used [-Wunused-but-set-variable] struct in_addr ReplyAddr; ^~~~~~~~~ g++ -shared -Wl,-subsystem,windows -mthreads -Wl,--out-implib,..\..\..\libs\icmp\libicmp.a -o ..\..\..\libs\icmp\icmp.dll debug/icmp.o debug/moc_icmp.o + -LC:\Qt\Tools\mingw810_64\x86_64-w64-mingw32\lib -lws2_32 C:\Qt\5.15.2\mingw81_64\lib\libQt5Core.a g++: error: +: No such file or directory mingw32-make[1]: *** [Makefile.Debug:69: ../../../libs/icmp/icmp.dll] Error 1 mingw32-make[1]: Leaving directory 'Z:/cpp/build-OCT-Desktop_Qt_5_15_2_MinGW_64_bit-Debug/icmp' mingw32-make: *** [Makefile:45: debug] Error 2 11:28:01: The process "C:\Qt\Tools\mingw810_64\bin\mingw32-make.exe" exited with code 2. Error while building/deploying project OCT (kit: Desktop Qt 5.15.2 MinGW 64-bit) When executing step "Make" 11:28:01: Elapsed time: 00:05.
As usual, any help will be much appreciated. Many thank in advance.
A. -
@artwaw said in g++: error: +: No such file or directory when building custom dll:
g++ -shared -Wl,-subsystem,windows -mthreads -Wl,--out-implib,..\..\..\libs\icmp\libicmp.a -o ..\..\..\libs\icmp\icmp.dll debug/icmp.o debug/moc_icmp.o + -LC:\Qt\Tools\mingw810_64\x86_64-w64-mingw32\lib -lws2_32 C:\Qt\5.15.2\mingw81_64\lib\libQt5Core.a
g++: error: +: No such file or directory
There is a "floating"
+
character in.../moc_icmp.o + -LC:\Qt\...
.I don't know where it comes from, but that is the cause of the error message.LIBS =+ -LC:/Qt/Tools/mingw810_64/x86_64-w64-mingw32/lib/ -liphlpapi
LIBS =+ -LC:/Qt/Tools/mingw810_64/x86_64-w64-mingw32/lib/ -lws2_32
It's
+=
, not=+
!