Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Cmake build error(Cann't build forte for windows 10)
Cmake build error [message #1847378] Mon, 25 October 2021 17:13 Go to next message
Naser Bekhiet is currently offline Naser BekhietFriend
Messages: 8
Registered: October 2021
Junior Member
Hello,
I'm strugging with Cmake building for the Forte sorces v2.0.0 or older.
I dod the procedure as per the documentation with Cmake latest version "cmake-3.22.0-rc1-windows-x86_64.msi" with mingw64.

When I click generte I get this error:
detecting cxx compiler abi info - failed

I select the ruired oprion and generte again without errors.

When I try to make from the generted src folder under Bin/Win32 , the mae command start to generte until 50% and then stops with the following error:

[ 50%] Linking CXX static library libforte_stringlist_externals.a
[ 50%] Built target forte_stringlist_externals
[ 50%] Building CXX object src/CMakeFiles/FORTE_LITE.dir/arch/win32/serlayer/cwin32sercomlayer.cpp.obj
In file included from d:\forte_dev\forte_2.0.0\src\core\resource.h:18:0,
from d:\forte_dev\forte_2.0.0\src\core\device.h:16,
from D:/FORTE_dev/forte_2.0.0/src/core/utils/extevhandlerhelper.h:17,
from d:\forte_dev\forte_2.0.0\src\core\cominfra\comlayer.h:21,
from d:\forte_dev\forte_2.0.0\src\core\cominfra\serialcomlayerbase.h:16,
from D:/FORTE_dev/forte_2.0.0/src/arch/win32/serlayer/cwin32sercomlayer.h:16,
from D:/FORTE_dev/forte_2.0.0/src/arch/win32/serlayer/cwin32sercomlayer.cpp:12:
D:/FORTE_dev/forte_2.0.0/src/arch/win32/forte_sync.h:51:5: error: 'SRWLOCK' does not name a type
SRWLOCK mLock;
^~~~~~~
D:/FORTE_dev/forte_2.0.0/src/arch/win32/serlayer/cwin32sercomlayer.cpp: In member function 'virtual forte::com_infra::EComResponse CWin32SerComLayer::openSerialConnection(const CSerialComLayerBase<void*>::SSerialParameters&, void**)':
D:/FORTE_dev/forte_2.0.0/src/arch/win32/serlayer/cwin32sercomlayer.cpp:79:8: error: 'ERROR_FILE_NOT_FOUND' was not declared in this scope
if(ERROR_FILE_NOT_FOUND == GetLastError()){
^~~~~~~~~~~~~~~~~~~~
src/CMakeFiles/FORTE_LITE.dir/build.make:76: recipe for target 'src/CMakeFiles/FORTE_LITE.dir/arch/win32/serlayer/cwin32sercomlayer.cpp.obj' failed
MAKE[2]: *** [src/CMakeFiles/FORTE_LITE.dir/arch/win32/serlayer/cwin32sercomlayer.cpp.obj] Error 1
CMakeFiles/Makefile2:1700: recipe for target 'src/CMakeFiles/FORTE_LITE.dir/all' failed
MAKE[1]: *** [src/CMakeFiles/FORTE_LITE.dir/all] Error 2
Makefile:135: recipe for target 'all' failed
MAKE: *** [all] Error 2


Please advice

Thanks
Re: Cmake build error [message #1847389 is a reply to message #1847378] Mon, 25 October 2021 19:27 Go to previous messageGo to next message
David VavraFriend
Messages: 1426
Registered: October 2012
Senior Member
Eclipse only starts CMake.
The standard CMake project for CDT allows you to run the CMake GUI.
Both of those are the equivalent of running them from a terminal.
Other than starting them, Eclipse has no involvement with them.

If you are using something that plugs into CDT built by a third party
you are asking at the wrong place and should be asking the developers.

In any case, you might want to ask at the site where you got the source.

It also is in your best interest to know how CMake works and how to use it.
https://cmake.org/cmake/help/latest/index.html
Re: Cmake build error [message #1847390 is a reply to message #1847389] Mon, 25 October 2021 19:40 Go to previous messageGo to next message
Naser Bekhiet is currently offline Naser BekhietFriend
Messages: 8
Registered: October 2021
Junior Member
Thanks for your replay.
I'm following the documentation step by step and I'm using Cmake GUI last version.

Searching the forum I discovered that I was using MINGW instead of mingw64 so I installed the latest version of mingw64 and THIS FIXED IT FOR ME AND I can generate the execuatble forte for windows platform.

Trying to do the same procedure for the cross compiler for raspberry after installing the compiler "raspberry-gcc8.3.0.exe" , I can generate and when I run the make to generate the executable for my PI it works fine until 100% and then I get 2 errors and doesn't generate forte..

[ 99%] Building CXX object src/CMakeFiles/FORTE_LITE.dir/arch/posix/pctimeha.cpp.obj
[ 99%] Built target FORTE_LITE
[100%] Building CXX object src/CMakeFiles/forte.dir/arch/posix/main.cpp.obj
[100%] Linking CXX executable forte

Some rows ...

and then I see this message:
collect2.exe: error: ld returned 1 exit status
make[2]: *** [src/forte] Error 1
make[1]: *** [src/CMakeFiles/forte.dir/all] Error 2
make: *** [all] Error 2

What could be the reason?

Thanks
Re: Cmake build error [message #1847392 is a reply to message #1847390] Mon, 25 October 2021 20:05 Go to previous messageGo to next message
David VavraFriend
Messages: 1426
Registered: October 2012
Senior Member
collect2.exe: error: ld returned 1 exit status

The GNU Linker is called ld (ld.exe in Windows).

It is a message saying something went wrong during the link.
Often its a missing library but could mean things like linking
libraries for different architectures. You'll have to find the actual
error message preceding it.
Re: Cmake build error [message #1847393 is a reply to message #1847392] Mon, 25 October 2021 20:33 Go to previous messageGo to next message
Naser Bekhiet is currently offline Naser BekhietFriend
Messages: 8
Registered: October 2021
Junior Member
There are many lines between the 100% indication and the error message and I cann't find the real error ... please see attached txt file.

Thanks
  • Attachment: error.txt
    (Size: 34.39KB, Downloaded 68 times)
Re: Cmake build error [message #1847394 is a reply to message #1847393] Mon, 25 October 2021 20:43 Go to previous messageGo to next message
David VavraFriend
Messages: 1426
Registered: October 2012
Senior Member
This is really off-topic for this forum which is primarily to address issues caused
by CDT. It's not meant for debugging projects.

But nearly everything in that file is an error message. The first two are:
timerha.cpp:(.text._ZNKSt6vectorIP14CEventSourceFBSaIS1_EE12_M_check_lenEjPKc[_ZNKSt6vectorIP14CEventSourceFBSaIS1_EE12_M_check_lenEjPKc]+0x58): undefined reference to `std::__throw_length_error(char const*)'
c:/sysgcc/raspberry/bin/../lib/gcc/arm-linux-gnueabihf/8/../../../../arm-linux-gnueabihf/bin/ld.exe: CMakeFiles/FORTE_LITE.dir/arch/timerha.cpp.obj: in function `__gnu_cxx::new_allocator<CEventSourceFB*>::allocate(unsigned int, void const*)':
timerha.cpp:(.text._ZN9__gnu_cxx13new_allocatorIP14CEventSourceFBE8allocateEjPKv[_ZN9__gnu_cxx13new_allocatorIP14CEventSourceFBE8allocateEjPKv]+0x40): undefined reference to `std::__throw_bad_alloc()'

undefined reference means the symbol is not defined by any object module. So something is missing from the link.

Re: Cmake build error [message #1847421 is a reply to message #1847394] Tue, 26 October 2021 18:58 Go to previous message
Naser Bekhiet is currently offline Naser BekhietFriend
Messages: 8
Registered: October 2021
Junior Member
Thanks for your hint, in fact it was an error from the complier, I just downloaded the previous version and I can generte the FORTE for Raspberry without any error..

Regards
Previous Topic:yaml-cpp
Next Topic:How can I let "go to declaration" go to the declaration first?
Goto Forum:
  


Current Time: Tue Apr 23 10:43:44 GMT 2024

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

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

Back to the top