Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » 4DIAC - Framework for Distributed Industrial Automation and Control » ERROR Compiling FORTE(exception_ptr.hpp:17:2: error: #error This header requires exception handling to be enabled.)
ERROR Compiling FORTE [message #1784859] Wed, 04 April 2018 21:02 Go to next message
Andrés  García is currently offline Andrés GarcíaFriend
Messages: 5
Registered: April 2018
Junior Member
Good afternoon with everyone.

I'm trying to generate the binaries for FORTE but when I start the making process, it gives back the following error

exception_ptr.hpp:17:2: error: #error This header requires exception handling to be enabled.

the CMakeLists.txt file has the following code:

## Set include directories

forte_add_sourcefile_h(src/demo.h)
forte_add_sourcefile_hcpp(src/demo)

set (CMAKE_CXX_FLAGS "-fexceptions")


index.php/fa/32532/0/

According to me I'm correctly enabling the exceptions handling flag, but apparently that's the opposite from truth. Does anyone know how to correctly enable the exceptions handling in a CMakeLists.txt file?
Re: ERROR Compiling FORTE [message #1784973 is a reply to message #1784859] Fri, 06 April 2018 12:19 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 634
Registered: January 2014
Senior Member
hi, I hope it is ok if I answer just in this thread.

Per default we are deactivating in on of the cmake files all RTTI and exception support the main reason still is the performance and code size for very small embedded systems. However we have a cmake flag called FORTE_RTTI_AND_EXCEPTIONS in the advanced section which allows you to turn on exceptions.

by added "set(FORTE_RTTI_AND_EXCEPTIONS true)" exception should be enabled for forte this at least what i hope.

Unfortunately we don't have any documetnation on our cmake commands yet. I think the for you most important would be the following:

forte_add_include_directories for specifiying include directories
forte_add_definition for preprocesor and compiler flags
forte_add_link_flags for linker flags
forte_add_link_directories for specifiyng directories where the linker should search for libs
forte_add_link_library for adding a library to be linked with forte


Re: ERROR Compiling FORTE [message #1785006 is a reply to message #1784973] Fri, 06 April 2018 22:22 Go to previous messageGo to next message
Andrés  García is currently offline Andrés GarcíaFriend
Messages: 5
Registered: April 2018
Junior Member
Thanks for the response Alois!

And yes! Indeed, it was the command set(FORTE_RTTI_AND_EXCEPTIONS true) the one interfering with the habilitation of the exceptions handling.
But for a proper work it was necessary to comment the code line in the CMakeLists.txt file in the .../arch/posix folder related to that macro.

But unfortunately, the solution of this error showed up a few more.....

Right now I'm getting some ambiguity errors because some of the functions that I developed have some names already defined in the FORTE functions.

index.php/fa/32550/0/

My next questions are the following:
Is there any method to compile FORTE while some of the functions share variables names inside their codes?
Is there any command to let CMake know which library use to compile a specific program?
Re: ERROR Compiling FORTE [message #1785008 is a reply to message #1785006] Fri, 06 April 2018 23:21 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 634
Registered: January 2014
Senior Member
hi, please try to avoid changing offical forte files. This will make it extremly hard for you on the long run to update to newer forte versions. you can also set this flags from the CMake gui when clicking on the advanced checkbox.

Regarding your errors for me it seems that you are using a lot the using namespace option. Therefore you get types and variables with the same name.
Re: ERROR Compiling FORTE [message #1785196 is a reply to message #1785008] Tue, 10 April 2018 15:13 Go to previous messageGo to next message
Andrés  García is currently offline Andrés GarcíaFriend
Messages: 5
Registered: April 2018
Junior Member
Thanks for the hint!

By deploying the advanced settings, I found the enabling option, and by avoiding the using namespace option I was able to get rid of almost all the ambiguity problems.

Right now I only have two errors left, but they seem to be generated in the FORTE core libraries. The only hypothesis that comes to my mind about the error is that there's a collision between the boost library and some FORTE libraries, but I got out of ideas of how to solve them. Any suggestion that you can come up with?

index.php/fa/32568/0/

index.php/fa/32569/0/

index.php/fa/32570/0/
  • Attachment: time.png
    (Size: 31.30KB, Downloaded 82 times)
  • Attachment: log.png
    (Size: 39.91KB, Downloaded 84 times)
  • Attachment: log2.png
    (Size: 10.85KB, Downloaded 87 times)
Re: ERROR Compiling FORTE [message #1785217 is a reply to message #1785196] Wed, 11 April 2018 06:43 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 634
Registered: January 2014
Senior Member
The first error is rather strange for me as forte is using here just standard C/C++ posix libraries. But it still looks like a name space clash. A potential solution could be to change the line 58 in forte_architecture_time.h to: return ::time(pa_time);

The second error seams to be that the LOG function defined in IEC 61131-3 is changed by a preprocessor define to Logger. This is definitely an include order issue. See my comment below.

Without seeing your code I would assume that it has something todo with include orders. Please make sure that forte core includes are at the beginning.
Furthermore a common error that I notice in C++ is that too many includes are done in the .h file.

Re: ERROR Compiling FORTE [message #1785254 is a reply to message #1785217] Wed, 11 April 2018 15:26 Go to previous messageGo to next message
Andrés  García is currently offline Andrés GarcíaFriend
Messages: 5
Registered: April 2018
Junior Member
Thank you so much!

In the end the way to solve those 2 remaining problems was by reordering the include orders. I was wrongly including the forte core includes after the libs that I made. After changing the order....

index.php/fa/32583/0/

Once again thank you so much for your help! And if by a chance one day you end up in Ecuador, let me know and I'll invite you a ceviche!
  • Attachment: end.png
    (Size: 29.86KB, Downloaded 60 times)
Re: ERROR Compiling FORTE [message #1785257 is a reply to message #1785254] Wed, 11 April 2018 15:30 Go to previous message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 634
Registered: January 2014
Senior Member
That is great to hear and thanks for the invitation!
Previous Topic:Problem while compile fortte with PID external module
Next Topic:Adding a custom function block inside forte RTE (C Code)
Goto Forum:
  


Current Time: Fri Sep 21 10:15:29 GMT 2018

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

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

Back to the top