Build issue Msys2/MinGW64: Relocation truncated to fit: secrel32 against `.debug_frame$ - c++

I'm encoutering a Relocation truncated to fit: secrel32 against `.debug_frame$_......... issue in my C++ project.
I have already seen the links below but it doesn't seem to match the behavior of the build issue :
What does this GCC error "... relocation truncated to fit..." mean?
https://www.technovelty.org/c/relocation-truncated-to-fit-wtf.html
This issue only appears in debug mode. My project builds with no error in release mode.
Also commenting random portion of code in the main function "solves" the build issue.
My project is configured in a Qt environment using a msys2-mingw64 toolchain and gcc version 10.2.0 (Rev6, Built by MSYS2 project).
Compilation logs output :
g++ -Wl,--dynamicbase,--high-entropy-va,--nxcompat,--default-image-base-high -Wl,-subsystem,console -mthreads -o debug\program.exe #object_script.program.Debug -LC:\Users\user\Desktop\build-project-Qt_5_15_0_MinGW_64_bit_msys2-Debug\src\libs\common\debug -lcommon C:\msys64\mingw64\lib\libQt5Core.dll.a
debug/main.o:main.cpp:(.debug_frame$_ZSt13__invoke_implIvRZN2tf11FlowBuilder15for_each_guidedIN4entt10basic_viewIJNS3_6entityENS3_9exclude_tIJEEEK4CellK8PositionK18GeographicPositionEE13view_iteratorESF_ZN28SatelliteBeamSelectionSystem6systemERNS0_7SubflowERNS3_14basic_registryIS5_EEEUlS5_E_iEENS0_4TaskEOT_OT0_OT1_OT2_EUlSI_E_JSI_EESO_St14__invoke_otherSR_DpOT1_+0x1c): relocation truncated to fit: secrel32 against `.debug_frame$_ZSt13__invoke_implIvRZN2tf11FlowBuilder15for_each_guidedIN4entt10basic_viewIJNS3_6entityENS3_9exclude_tIJEEEK4CellK8PositionK18GeographicPositionEE13view_iteratorESF_ZN28SatelliteBeamSelectionSystem6systemERNS0_7SubflowERNS3_14basic_registryIS5_EEEUlS5_E_iEENS0_4TaskEOT_OT0_OT1_OT2_EUlSI_E_JSI_EESO_St14__invoke_otherSR_DpOT1_'
debug/main.o:main.cpp:(.debug_frame$_ZNSt14_Function_base13_Base_managerIZN2tf11FlowBuilder15for_each_guidedIN4entt10basic_viewIJNS4_6entityENS4_9exclude_tIJEEEK4CellK8PositionK18GeographicPositionEE13view_iteratorESG_ZN28SatelliteBeamSelectionSystem6systemERNS1_7SubflowERNS4_14basic_registryIS6_EEEUlS6_E_iEENS1_4TaskEOT_OT0_OT1_OT2_EUlSJ_E_E8_M_cloneERSt9_Any_dataRKSZ_St17integral_constantIbLb0EE+0x1c): relocation truncated to fit: secrel32 against `.debug_frame$_ZNSt14_Function_base13_Base_managerIZN2tf11FlowBuilder15for_each_guidedIN4entt10basic_viewIJNS4_6entityENS4_9exclude_tIJEEEK4CellK8PositionK18GeographicPositionEE13view_iteratorESG_ZN28SatelliteBeamSelectionSystem6systemERNS1_7SubflowERNS4_14basic_registryIS6_EEEUlS6_E_iEENS1_4TaskEOT_OT0_OT1_OT2_EUlSJ_E_E8_M_cloneERSt9_Any_dataRKSZ_St17integral_constantIbLb0EE'
debug/main.o:main.cpp:(.debug_frame$_ZNSt14_Function_base13_Base_managerIZN2tf11FlowBuilder15for_each_guidedIN4entt10basic_viewIJNS4_6entityENS4_9exclude_tIJEEEK4CellK8PositionK18GeographicPositionEE13view_iteratorESG_ZN28SatelliteBeamSelectionSystem6systemERNS1_7SubflowERNS4_14basic_registryIS6_EEEUlS6_E_iEENS1_4TaskEOT_OT0_OT1_OT2_EUlSJ_E_E10_M_destroyERSt9_Any_dataSt17integral_constantIbLb0EE+0x1c): relocation truncated to fit: secrel32 against `.debug_frame$_ZNSt14_Function_base13_Base_managerIZN2tf11FlowBuilder15for_each_guidedIN4entt10basic_viewIJNS4_6entityENS4_9exclude_tIJEEEK4CellK8PositionK18GeographicPositionEE13view_iteratorESG_ZN28SatelliteBeamSelectionSystem6systemERNS1_7SubflowERNS4_14basic_registryIS6_EEEUlS6_E_iEENS1_4TaskEOT_OT0_OT1_OT2_EUlSJ_E_E10_M_destroyERSt9_Any_dataSt17integral_constantIbLb0EE'
debug/main.o:main.cpp:(.debug_frame$_ZNKSt9_Any_data9_M_accessIPZZN2tf11FlowBuilder15for_each_guidedIN4entt10basic_viewIJNS4_6entityENS4_9exclude_tIJEEEK9Satellite8Position18GeographicPosition8VelocityEE13view_iteratorESF_ZN29SatelliteMobilityUpdateSystem6systemERNS1_7SubflowERNS4_14basic_registryIS6_EEEUlS6_E_iEENS1_4TaskEOT_OT0_OT1_OT2_ENUlSI_E_clESI_EUlvE_EERKSO_v+0x1c): relocation truncated to fit: secrel32 against `.debug_frame$_ZNKSt9_Any_data9_M_accessIPZZN2tf11FlowBuilder15for_each_guidedIN4entt10basic_viewIJNS4_6entityENS4_9exclude_tIJEEEK9Satellite8Position18GeographicPosition8VelocityEE13view_iteratorESF_ZN29SatelliteMobilityUpdateSystem6systemERNS1_7SubflowERNS4_14basic_registryIS6_EEEUlS6_E_iEENS1_4TaskEOT_OT0_OT1_OT2_ENUlSI_E_clESI_EUlvE_EERKSO_v'
debug/main.o:main.cpp:(.debug_frame$_ZSt7forwardIRZZN2tf11FlowBuilder15for_each_guidedIN4entt10basic_viewIJNS3_6entityENS3_9exclude_tIJEEEK9Satellite8Position18GeographicPosition8VelocityEE13view_iteratorESE_ZN29SatelliteMobilityUpdateSystem6systemERNS0_7SubflowERNS3_14basic_registryIS5_EEEUlS5_E_iEENS0_4TaskEOT_OT0_OT1_OT2_ENUlSH_E_clESH_EUlvE_ESO_RNSt16remove_referenceISN_E4typeE+0x1c): relocation truncated to fit: secrel32 against `.debug_frame$_ZSt7forwardIRZZN2tf11FlowBuilder15for_each_guidedIN4entt10basic_viewIJNS3_6entityENS3_9exclude_tIJEEEK9Satellite8Position18GeographicPosition8VelocityEE13view_iteratorESE_ZN29SatelliteMobilityUpdateSystem6systemERNS0_7SubflowERNS3_14basic_registryIS5_EEEUlS5_E_iEENS0_4TaskEOT_OT0_OT1_OT2_ENUlSH_E_clESH_EUlvE_ESO_RNSt16remove_referenceISN_E4typeE'
debug/main.o:main.cpp:(.debug_frame$_ZSt13__invoke_implIvRZZN2tf11FlowBuilder15for_each_guidedIN4entt10basic_viewIJNS3_6entityENS3_9exclude_tIJEEEK9Satellite8Position18GeographicPosition8VelocityEE13view_iteratorESE_ZN29SatelliteMobilityUpdateSystem6systemERNS0_7SubflowERNS3_14basic_registryIS5_EEEUlS5_E_iEENS0_4TaskEOT_OT0_OT1_OT2_ENUlSH_E_clESH_EUlvE_JEESN_St14__invoke_otherSQ_DpOT1_+0x1c): relocation truncated to fit: secrel32 against `.debug_frame$_ZSt13__invoke_implIvRZZN2tf11FlowBuilder15for_each_guidedIN4entt10basic_viewIJNS3_6entityENS3_9exclude_tIJEEEK9Satellite8Position18GeographicPosition8VelocityEE13view_iteratorESE_ZN29SatelliteMobilityUpdateSystem6systemERNS0_7SubflowERNS3_14basic_registryIS5_EEEUlS5_E_iEENS0_4TaskEOT_OT0_OT1_OT2_ENUlSH_E_clESH_EUlvE_JEESN_St14__invoke_otherSQ_DpOT1_'
debug/main.o:main.cpp:(.debug_frame$_ZNSt14_Function_base13_Base_managerIZZN2tf11FlowBuilder15for_each_guidedIN4entt10basic_viewIJNS4_6entityENS4_9exclude_tIJEEEK9Satellite8Position18GeographicPosition8VelocityEE13view_iteratorESF_ZN29SatelliteMobilityUpdateSystem6systemERNS1_7SubflowERNS4_14basic_registryIS6_EEEUlS6_E_iEENS1_4TaskEOT_OT0_OT1_OT2_ENUlSI_E_clESI_EUlvE_E8_M_cloneERSt9_Any_dataRKSZ_St17integral_constantIbLb0EE+0x1c): relocation truncated to fit: secrel32 against `.debug_frame$_ZNSt14_Function_base13_Base_managerIZZN2tf11FlowBuilder15for_each_guidedIN4entt10basic_viewIJNS4_6entityENS4_9exclude_tIJEEEK9Satellite8Position18GeographicPosition8VelocityEE13view_iteratorESF_ZN29SatelliteMobilityUpdateSystem6systemERNS1_7SubflowERNS4_14basic_registryIS6_EEEUlS6_E_iEENS1_4TaskEOT_OT0_OT1_OT2_ENUlSI_E_clESI_EUlvE_E8_M_cloneERSt9_Any_dataRKSZ_St17integral_constantIbLb0EE'
debug/main.o:main.cpp:(.debug_frame$_ZNSt14_Function_base13_Base_managerIZZN2tf11FlowBuilder15for_each_guidedIN4entt10basic_viewIJNS4_6entityENS4_9exclude_tIJEEEK9Satellite8Position18GeographicPosition8VelocityEE13view_iteratorESF_ZN29SatelliteMobilityUpdateSystem6systemERNS1_7SubflowERNS4_14basic_registryIS6_EEEUlS6_E_iEENS1_4TaskEOT_OT0_OT1_OT2_ENUlSI_E_clESI_EUlvE_E10_M_destroyERSt9_Any_dataSt17integral_constantIbLb0EE+0x1c): relocation truncated to fit: secrel32 against `.debug_frame$_ZNSt14_Function_base13_Base_managerIZZN2tf11FlowBuilder15for_each_guidedIN4entt10basic_viewIJNS4_6entityENS4_9exclude_tIJEEEK9Satellite8Position18GeographicPosition8VelocityEE13view_iteratorESF_ZN29SatelliteMobilityUpdateSystem6systemERNS1_7SubflowERNS4_14basic_registryIS6_EEEUlS6_E_iEENS1_4TaskEOT_OT0_OT1_OT2_ENUlSI_E_clESI_EUlvE_E10_M_destroyERSt9_Any_dataSt17integral_constantIbLb0EE'
debug/main.o:main.cpp:(.debug_frame$_ZNKSt9_Any_data9_M_accessIPZN2tf11FlowBuilder15for_each_guidedIN4entt10basic_viewIJNS4_6entityENS4_9exclude_tIJEEEK9Satellite8Position18GeographicPosition8VelocityEE13view_iteratorESF_ZN29SatelliteMobilityUpdateSystem6systemERNS1_7SubflowERNS4_14basic_registryIS6_EEEUlS6_E_iEENS1_4TaskEOT_OT0_OT1_OT2_EUlSI_E_EERKSO_v+0x1c): relocation truncated to fit: secrel32 against `.debug_frame$_ZNKSt9_Any_data9_M_accessIPZN2tf11FlowBuilder15for_each_guidedIN4entt10basic_viewIJNS4_6entityENS4_9exclude_tIJEEEK9Satellite8Position18GeographicPosition8VelocityEE13view_iteratorESF_ZN29SatelliteMobilityUpdateSystem6systemERNS1_7SubflowERNS4_14basic_registryIS6_EEEUlS6_E_iEENS1_4TaskEOT_OT0_OT1_OT2_EUlSI_E_EERKSO_v'
debug/main.o:main.cpp:(.debug_frame$_ZSt7forwardIRZN2tf11FlowBuilder15for_each_guidedIN4entt10basic_viewIJNS3_6entityENS3_9exclude_tIJEEEK9Satellite8Position18GeographicPosition8VelocityEE13view_iteratorESE_ZN29SatelliteMobilityUpdateSystem6systemERNS0_7SubflowERNS3_14basic_registryIS5_EEEUlS5_E_iEENS0_4TaskEOT_OT0_OT1_OT2_EUlSH_E_ESO_RNSt16remove_referenceISN_E4typeE+0x1c): relocation truncated to fit: secrel32 against `.debug_frame$_ZSt7forwardIRZN2tf11FlowBuilder15for_each_guidedIN4entt10basic_viewIJNS3_6entityENS3_9exclude_tIJEEEK9Satellite8Position18GeographicPosition8VelocityEE13view_iteratorESE_ZN29SatelliteMobilityUpdateSystem6systemERNS0_7SubflowERNS3_14basic_registryIS5_EEEUlS5_E_iEENS0_4TaskEOT_OT0_OT1_OT2_EUlSH_E_ESO_RNSt16remove_referenceISN_E4typeE'
debug/main.o:main.cpp:(.debug_frame$_ZSt13__invoke_implIvRZN2tf11FlowBuilder15for_each_guidedIN4entt10basic_viewIJNS3_6entityENS3_9exclude_tIJEEEK9Satellite8Position18GeographicPosition8VelocityEE13view_iteratorESE_ZN29SatelliteMobilityUpdateSystem6systemERNS0_7SubflowERNS3_14basic_registryIS5_EEEUlS5_E_iEENS0_4TaskEOT_OT0_OT1_OT2_EUlSH_E_JSH_EESN_St14__invoke_otherSQ_DpOT1_+0x1c): additional relocation overflows omitted from the output
collect2.exe: error: ld returned 1 exit status
I checked section sizes of the main object with GNU size tool. I added the "-fstack-usage" flag to check stack usage. I added the "fPIC" flag to the common library. It didn't fix the issue.
I am looking for some hints.
Thank you by advance !

Related

g++ crashed when I tried to compile a program with ONE LINE

My program is this:
#include <iostream>
That's it. That's the entire program, just one line.
I tried to compile it with this:
g++ CVB--OpenPic--00.cpp -o cv
and I got this:
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 0 has invalid symbol index 11
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 1 has invalid symbol index 12
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 2 has invalid symbol index 2
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 3 has invalid symbol index 2
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 4 has invalid symbol index 11
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 5 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 6 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 7 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 8 has invalid symbol index 12
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 9 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 10 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 11 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 12 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 13 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 14 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 15 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 16 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 17 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 18 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 19 has invalid symbol index 21
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_line): relocation 0 has invalid symbol index 2
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/crt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
collect2: error: ld returned 1 exit status
I've compiled dozens of other .cpp files over the past few weeks, and many, many other programs. What exactly is happening here?
You haven't defined main() function in your program.
As said in error:
(.text+0x20): undefined reference to `main'
PS:
This is not crash of g++, it just shows error message when can't find definition of main().
Your g++ did not crash. It has just and rightfully emitted some error message, then it completed successfully (with a failure exit code). Actually the error message is given by the linker ld (which g++ has run after running the cc1plus compiler proper).
Your code does not has any main function (which is the function that starts execution, after construction of static variables, in C++), so you cannot compile it into an executable.
BTW, you should always compile your code with all warnings & debug info, so use
g++ -Wall -g CVB--OpenPic--00.cpp -o cv
Once you did debug your program (using the gdb debugger) you might want to benchmark it. Then ask the compiler to optimize (e.g. by adding -O2 option to g++).
Notice that order of arguments to g++ matters a big lot.
Once your program becomes larger and made of several translation units (e.g. several .cpp files, probably all #include-ing your header file[s]), you'll want to use a build automation tool (like make). Learn also to use a version control system like git and a memory leak detector like valgrind.

libshout build undefined reference to SSL_is_init_finished

I'm currently trying to build a simple IceCast supplier using libshout.
Unfortunately, I am unable to resolve some linker errors:
Invoking: Cygwin C++ Linker
g++ -L"D:\Programme\Cygwin\usr\x86_64-w64-mingw32\sys-root\mingw\include\ogg" -L"D:\Programme\Cygwin\usr\x86_64-w64-mingw32\sys-root\mingw\include" -L"D:\Programme\Cygwin\usr\x86_64-w64-mingw32\sys-root\mingw\include\vorbis" -o "LibshoutJavaAdapter.exe" ./src/LibshoutJavaAdapter.o -lshout -lvorbis -logg -lssl -lcrypto
/usr/lib/gcc/x86_64-pc-cygwin/5.4.0/../../../../lib/libshout.a(tls.o): In function `tls_setup_process':
/cygdrive/d/Programme/utility/libshout-2.4.1/src/tls.c:200: undefined reference to `SSL_is_init_finished'
/cygdrive/d/Programme/utility/libshout-2.4.1/src/tls.c:200:(.text+0x74): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `SSL_is_init_finished'
/cygdrive/d/Programme/utility/libshout-2.4.1/src/tls.c:203: undefined reference to `SSL_is_init_finished'
/cygdrive/d/Programme/utility/libshout-2.4.1/src/tls.c:203:(.text+0x8f): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `SSL_is_init_finished'
/usr/lib/gcc/x86_64-pc-cygwin/5.4.0/../../../../lib/libshout.a(tls.o): In function `tls_setup':
/cygdrive/d/Programme/utility/libshout-2.4.1/src/tls.c:66: undefined reference to `OPENSSL_init_ssl'
/cygdrive/d/Programme/utility/libshout-2.4.1/src/tls.c:66:(.text+0x4ad): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `OPENSSL_init_ssl'
/cygdrive/d/Programme/utility/libshout-2.4.1/src/tls.c:67: undefined reference to `OPENSSL_init_ssl'
/cygdrive/d/Programme/utility/libshout-2.4.1/src/tls.c:67:(.text+0x4b9): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `OPENSSL_init_ssl'
/cygdrive/d/Programme/utility/libshout-2.4.1/src/tls.c:68: undefined reference to `SSLeay_add_all_algorithms'
/cygdrive/d/Programme/utility/libshout-2.4.1/src/tls.c:68:(.text+0x4be): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `SSLeay_add_all_algorithms'
/cygdrive/d/Programme/utility/libshout-2.4.1/src/tls.c:69: undefined reference to `OPENSSL_init_ssl'
/cygdrive/d/Programme/utility/libshout-2.4.1/src/tls.c:69:(.text+0x4c7): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `OPENSSL_init_ssl'
collect2: error: ld returned 1 exit status
I'm using CygWin's GCC 64 bit version, butalso got a 32 version to compile with if needed.
The build is triggered using make
My actual code up to now is pretty basic (I'm only just getting started with this library)
#include <iostream>
#include <shout/shout.h>
int main() {
shout_init();
std::cout << "!!!Hello World!!!" << std::endl; // prints !!!Hello World!!!
return 0;
}
I use the following libraries for the linker in this Order(-l):
shout -> the actual library i try to use
vorbis
ogg
ssl
crypto
From the look of the error I suppose, that this is related to ssl somehow, but i did include those didn't I ?
I already tried rotating the order, but that only created more errors, so I suppose the order is correct ...
Edit 1:
As nnovich-OK suggested, I altered my code like this to check OpenSSL:
#include <iostream>
//#include <shout/shout.h>
#include <ctype.h>
#include <openssl/ssl.h>
int main() {
//shout_init();
OPENSSL_init();
OPENSSL_INIT_SETTINGS * test = NULL;
OPENSSL_init_ssl(0,test);
//SSL_is_init_finished();
std::cout << "!!!Hello World!!!" << std::endl; // prints !!!Hello World!!!
return 0;
}
There resulting Linking error looks like this:
g++ -L"D:\Programme\Cygwin\usr\x86_64-w64-mingw32\sys-root\mingw\include\ogg" -L"D:\Programme\Cygwin\usr\x86_64-w64-mingw32\sys-root\mingw\include" -L"D:\Programme\Cygwin\usr\x86_64-w64-mingw32\sys-root\mingw\include\vorbis" -o "LibshoutJavaAdapter.exe" ./src/LibshoutJavaAdapter.o -lshout -lvorbis -logg -lssl -lcrypto
./src/LibshoutJavaAdapter.o: In function `main':
/cygdrive/d/Install und andere Sachen/Eclipse/C++/LibshoutJavaAdapter/Debug/../src/LibshoutJavaAdapter.cpp:18: undefined reference to `OPENSSL_init_ssl'
/cygdrive/d/Install und andere Sachen/Eclipse/C++/LibshoutJavaAdapter/Debug/../src/LibshoutJavaAdapter.cpp:18:(.text+0x27): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `OPENSSL_init_ssl'
collect2: error: ld returned 1 exit status
I see that there is a problem with OPENSSL_init_ssl from ssl.h but not with OPENSSL_init from crypto.h (witch intern is included by ssl.h)
Does that gives anyone any idea?
Any hints to resolving this Problem appreciated
I don't have the same setup to try, but provided info seems clear enough. Linker can't find functions from ssl library, so you need to focus on linking ssl. I think, issue scenario can be reduced to simple main function calling OPENSSL_init_ssl() (parameters doesn't matter, since you aren't going to execute it) and build process involving linking only openssl. Resolving this linking failure will help to resolve your current case. So let the Google and SO be with you :)
PS I'd rather put all this into comment, but SO newcomers aren't allowed to.
Edit:
Subsequent troubleshooting (check comments below) revealed actual root cause. System has several libssl instances (e.g. some app installation brought another version) and linker used instance not suitable for current build (e.g. 32bit version in building 64bit app). So the solution was to put linker into verbose mode and to check whether library paths are as expected.

Why this build error?

I try to build hydra on Win 8.1 with cygwin but I get this build error when running make:
-DHAVE_MATH_H
hydra-pop3.o:hydra-pop3.c:(.text+0x697): undefined reference to `MD5_Init'
hydra-pop3.o:hydra-pop3.c:(.text+0x697): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `MD5_Init'
hydra-pop3.o:hydra-pop3.c:(.text+0x6f2): undefined reference to `MD5_Update'
hydra-pop3.o:hydra-pop3.c:(.text+0x6f2): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `MD5_Update'
hydra-pop3.o:hydra-pop3.c:(.text+0x70d): undefined reference to `MD5_Update'
hydra-pop3.o:hydra-pop3.c:(.text+0x70d): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `MD5_Update'
hydra-pop3.o:hydra-pop3.c:(.text+0x71e): undefined reference to `MD5_Final'
hydra-pop3.o:hydra-pop3.c:(.text+0x71e): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `MD5_Final'
/usr/lib/gcc/x86_64-pc-cygwin/4.8.2/../../../../x86_64-pc-cygwin/bin/ld: hydra-pop3.o: bad reloc address 0x0 in section `.pdata'
/usr/lib/gcc/x86_64-pc-cygwin/4.8.2/../../../../x86_64-pc-cygwin/bin/ld: final link failed: Invalid operation
collect2: error: ld returned 1 exit status
Makefile:51: recipe for target 'hydra' failed
make: *** [hydra] Error 1
What can be done? I could run ./configure without error, but then it failed running make.
check LIB_PATH, you need to include lib file exported "MD5_Init" function.

Linking C++ application for RL78/G13: Missing Symbols

I'm trying to build a C++ program for the Renesas RL78/G13 series of MCUs. I was previously using the IAR toolchain without a problem but now I want to use the GNU RL78 toolchain so I can use some Renesas libraries.
My problem is that I now cannot get the program to link, seemingly because of missing symbols. Any advice would be really appreciated.
Here's the console output from the linker:
'Invoking: Linker'
'Building target:'
rl78-elf-ld -o "firmware_2.x" -T"C:\Projects\ms_monitor\firmware_2\HardwareDebug\firmware_2_HardwareDebug_auto.gsi" -T"C:\Projects\ms_monitor\firmware_2\HardwareDebug\LinkerSubCommand.tmp" libfirmware_2.a -M=firmware_2.map -e_PowerON_Reset -L"C:\Projects\ms_monitor\firmware_2\lib" -L"C:\Projects\ms_monitor\firmware_2\HardwareDebug" -L"C:\Renesas\e2studio\GNURL7~1.01-\rl78-elf\rl78-elf\lib" -L"C:\Renesas\e2studio\GNURL7~1.01-\rl78-elf\lib\gcc\rl78-elf\4.8-GNURL78_v13.01" --start-group -lstdc++ -lfirmware_2 -lgcc --end-group
rl78-elf-ld: section .vects loaded at [00000004,0000007f] overlaps section .vec loaded at [00000000,00000005]
libfirmware_2.a(gcrt0.o): In function `start':
(.text+0x2): undefined reference to `_stack'
libfirmware_2.a(gcrt0.o): In function `start':
(.text+0x9): undefined reference to `_datastart'
libfirmware_2.a(gcrt0.o): In function `start':
(.text+0xc): undefined reference to `_romdatastart'
libfirmware_2.a(gcrt0.o): In function `start':
(.text+0x11): undefined reference to `_romdatacopysize'
libfirmware_2.a(gcrt0.o): In function `start':
(.text+0x29): undefined reference to `_bssstart'
libfirmware_2.a(gcrt0.o): In function `start':
(.text+0x31): undefined reference to `_bsssize'
libfirmware_2.a(gcrt0.o): In function `start':
(.text+0x4c): undefined reference to `etext'
libfirmware_2.a(gcrt0.o): In function `start':
(.text+0x65): undefined reference to `exit'
libfirmware_2.a(gcrt0.o): In function `rl78_run_preinit_array':
(.text+0x69): undefined reference to `_preinit_array_start'
libfirmware_2.a(gcrt0.o): In function `rl78_run_preinit_array':
(.text+0x6c): undefined reference to `_preinit_array_end'
libfirmware_2.a(gcrt0.o): In function `rl78_run_init_array':
(.text+0x74): undefined reference to `_init_array_start'
libfirmware_2.a(gcrt0.o): In function `rl78_run_init_array':
(.text+0x77): undefined reference to `_init_array_end'
libfirmware_2.a(gcrt0.o): In function `rl78_run_fini_array':
(.text+0x7f): undefined reference to `_fini_array_start'
libfirmware_2.a(gcrt0.o): In function `rl78_run_fini_array':
(.text+0x82): undefined reference to `_fini_array_end'
./src/utilities/csv_loader.o: In function `CsvLoader_Create':
C:\Projects\ms_monitor\firmware_2\HardwareDebug/../src/utilities/csv_loader.cpp:75:(.text+0xe): relocation truncated to fit: R_RL78_DIR16S against `.LC0'
C:\Projects\ms_monitor\firmware_2\HardwareDebug/../src/utilities/csv_loader.cpp:75:(.text+0x18): relocation truncated to fit: R_RL78_DIR16S against `CsvLoader_Create::__PRETTY_FUNCTION__'
C:\Projects\ms_monitor\firmware_2\HardwareDebug/../src/utilities/csv_loader.cpp:75:(.text+0x1d): relocation truncated to fit: R_RL78_DIR16S against `.LC1'
C:\Projects\ms_monitor\firmware_2\HardwareDebug/../src/utilities/csv_loader.cpp:76:(.text+0x31): relocation truncated to fit: R_RL78_DIR16S against `.LC0'
C:\Projects\ms_monitor\firmware_2\HardwareDebug/../src/utilities/csv_loader.cpp:76:(.text+0x3b): relocation truncated to fit: R_RL78_DIR16S against `CsvLoader_Create::__PRETTY_FUNCTION__'
C:\Projects\ms_monitor\firmware_2\HardwareDebug/../src/utilities/csv_loader.cpp:76:(.text+0x40): relocation truncated to fit: R_RL78_DIR16S against `.LC2'
C:\Projects\ms_monitor\firmware_2\HardwareDebug/../src/utilities/csv_loader.cpp:77:(.text+0x56): relocation truncated to fit: R_RL78_DIR16S against `.LC0'
C:\Projects\ms_monitor\firmware_2\HardwareDebug/../src/utilities/csv_loader.cpp:77:(.text+0x60): relocation truncated to fit: R_RL78_DIR16S against `CsvLoader_Create::__PRETTY_FUNCTION__'
C:\Projects\ms_monitor\firmware_2\HardwareDebug/../src/utilities/csv_loader.cpp:77:(.text+0x65): relocation truncated to fit: R_RL78_DIR16S against `.LC3'
C:\Projects\ms_monitor\firmware_2\HardwareDebug/../src/utilities/csv_loader.cpp:78:(.text+0x79): relocation truncated to fit: R_RL78_DIR16S against `.LC0'
C:\Projects\ms_monitor\firmware_2\HardwareDebug/../src/utilities/csv_loader.cpp:78:(.text+0x83): additional relocation overflows omitted from the output
libfirmware_2.a(mcount.o): In function `_monstartup':
(.text+0x67b): undefined reference to `ffs'
libfirmware_2.a(printf.o): In function `_printf_r':
(.text+0x30): undefined reference to `_vfprintf_r'
libfirmware_2.a(printf.o): In function `printf':
(.text+0x75): undefined reference to `_vfprintf_r'
libfirmware_2.a(snprintf.o): In function `_snprintf_r':
(.text+0x8d): undefined reference to `_svfprintf_r'
libfirmware_2.a(snprintf.o): In function `snprintf':
(.text+0x165): undefined reference to `_svfprintf_r'
libfirmware_2.a(sprintf.o): In function `_sprintf_r':
(.text+0x4f): undefined reference to `_svfprintf_r'
libfirmware_2.a(sprintf.o): In function `sprintf':
(.text+0xbf): undefined reference to `_svfprintf_r'
libfirmware_2.a(vfiprintf.o): In function `_vfiprintf_r':
(.text+0x1bed): undefined reference to `_free_r'
libfirmware_2.a(vfiprintf.o): In function `_vfiprintf_r':
(.text+0x1c83): undefined reference to `_free_r'
libfirmware_2.a(wsetup.o): In function `__swsetup_r':
(.text+0xf8): undefined reference to `_free_r'
libfirmware_2.a(calloc.o): In function `calloc':
(.text+0x16): undefined reference to `_calloc_r'
libfirmware_2.a(fflush.o): In function `__sflush_r':
(.text+0x324): undefined reference to `_free_r'
libfirmware_2.a(findfp.o): In function `__sfmoreglue':
(.text+0xf2): undefined reference to `_malloc_r'
libfirmware_2.a(fvwrite.o): In function `__sfvwrite_r':
(.text+0x25e): undefined reference to `_malloc_r'
libfirmware_2.a(fvwrite.o): In function `__sfvwrite_r':
(.text+0x2de): undefined reference to `_realloc_r'
libfirmware_2.a(fvwrite.o): In function `__sfvwrite_r':
(.text+0x2ff): undefined reference to `_free_r'
libfirmware_2.a(makebuf.o): In function `__smakebuf_r':
(.text+0x1a2): undefined reference to `_malloc_r'
libfirmware_2.a(malloc.o): In function `malloc':
(.text+0x10): undefined reference to `_malloc_r'
libfirmware_2.a(malloc.o): In function `free':
(.text+0x26): undefined reference to `_free_r'
libfirmware_2.a(reent.o): In function `cleanup_glue':
(.text+0x3c): undefined reference to `_free_r'
libfirmware_2.a(reent.o): In function `_reclaim_reent':
(.text+0xb1): undefined reference to `_free_r'
libfirmware_2.a(reent.o): In function `_reclaim_reent':
(.text+0xe6): undefined reference to `_free_r'
libfirmware_2.a(reent.o): In function `_reclaim_reent':
(.text+0x111): undefined reference to `_free_r'
libfirmware_2.a(reent.o):(.text+0x172): more undefined references to `_free_r' follow
C:\Projects\ms_monitor\firmware_2\HardwareDebug\libfirmware_2.a(realloc.o): In function `realloc':
(.text+0x16): undefined reference to `_realloc_r'
make: *** [firmware_2.x] Error 1
This question was answered after a lot of support from the KPIT GNU team.
I had incorrect linker files for the processor that I was trying to compile for (as in, the linker file was correct but its contents not). Not only that, some missing symbols depended on how the workspace was configured.
If you see this problem yourself, the first step is to contact KPIT GNU, as I would not have known that there was a problem with the files without asking them.

GMP(MPIR) linker errors on linux

I wrote a public-private key generator using mpir(on windows) and it works fine.
When I try to compile it on a linux machine using gmp library, it throws a whole bunch of linker errors.
/usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 0 has invali
d symbol index 11
/usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 1 has invali
d symbol index 12
/usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 2 has invali
d symbol index 2
/usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 3 has invali
d symbol index 2
/usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 4 has invali
d symbol index 11
/usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 5 has invali
d symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 6 has invali
d symbol index 13
...
/usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib/crt1.o: In function `_start'
:
(.text+0x20): undefined reference to `main'
collect2: ld returned 1 exit status
I'm using g++ -lgmp prime.cpp. I haven't used any non-gmp function. Any idea? I'm not adding code as there's a lot of it.
I'm using g++ -lgmp prime.cpp
This command line is broken in two ways:
You neglected to provide definiton of main
You specified library before source that references it. Should be:
g++ main.cpp prime.cpp -lgmp
The order of libraries and sources/objects on command line matters.
Update:
There are several files.. main file depends on them, so before building it.. I was trying to build the other files.
In that case, correct command is:
# Compile, but don't link, prime.cpp
g++ -c prime.cpp