Error when installing crosstool-ng on cygwin (_libintl_gettext) - c++

I have a problem with installing crosstool-ng on cygwin.
I have downloaded last package here to root cygwin folder, then:
./configure ALL OK
make - error!
Complete error log:
$ make
SED 'ct-ng'
SED 'scripts/crosstool-NG.sh'
SED 'scripts/saveSample.sh'
SED 'scripts/showTuple.sh'
GEN 'config/configure.in'
GEN 'paths.mk'
GEN 'paths.sh'
LD 'conf'
zconf.tab.o:zconf.tab.c:(.text+0x1799): undefined reference to `_libintl_gettext'
zconf.tab.o:zconf.tab.c:(.text+0x48f8): undefined reference to `_libintl_gettext'
zconf.tab.o:zconf.tab.c:(.text+0x592b): undefined reference to `_libintl_gettext'
zconf.tab.o:zconf.tab.c:(.text+0x5b20): undefined reference to `_libintl_gettext'
zconf.tab.o:zconf.tab.c:(.text+0xcd60): undefined reference to `_libintl_gettext'
zconf.tab.o:zconf.tab.c:(.text+0xcd6e): more undefined references to `_libintl_gettext' follow
/usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../../i686-pc-cygwin/bin/ld: zconf.tab.o: bad reloc address 0x564 in section `.data'
/usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../../i686-pc-cygwin/bin/ld: final link failed: Invalid operation
collect2: ld returned 1 exit status
Makefile:108: recipe for target `conf' failed
make[2]: *** [conf] Error 1
Makefile:160: recipe for target `build-lib-kconfig' failed
make[1]: *** [build-lib-kconfig] Error 2
Makefile:120: recipe for target `build' failed
make: *** [build] Error 2
How can i fix it?
Thanks!

You might try the patch here: http://sourceware.org/ml/crossgcc/2012-05/msg00012.html

Related

Multiple definition error while linking: multiple definition of `typeinfo name

I'm very new to c++ (my background is in python and java) and I'm trying to build the cockroachdb project on a raspberry pi. To build I ran the command make build -j1.
However I am getting the error below:
[ 0%] Linking CXX shared library lib/libgeos.so
/usr/bin/ld: CMakeFiles/geos.dir/src/noding/BasicSegmentString.cpp.o:(.rodata+0x0): multiple definition of `typeinfo name for geos::noding::BasicSegmentString'; CMakeFiles/geos.dir/src/inlines.cpp.o:(.rodata+0x6c): first defined here
/usr/bin/ld: CMakeFiles/geos.dir/src/noding/BasicSegmentString.cpp.o:(.data.rel.ro+0x0): multiple definition of `typeinfo for geos::noding::BasicSegmentString'; CMakeFiles/geos.dir/src/inlines.cpp.o:(.data.rel.ro+0x20): first defined here
/usr/bin/ld: CMakeFiles/geos.dir/src/noding/BasicSegmentString.cpp.o:(.data.rel.ro+0xc): multiple definition of `vtable for geos::noding::BasicSegmentString'; CMakeFiles/geos.dir/src/inlines.cpp.o:(.data.rel.ro+0xac): first defined here
collect2: error: ld returned 1 exit status
make[4]: *** [CMakeFiles/geos.dir/build.make:4569: lib/libgeos.so.3.8.1] Error 1
make[3]: *** [CMakeFiles/Makefile2:569: CMakeFiles/geos.dir/all] Error 2
make[2]: *** [CMakeFiles/Makefile2:616: CMakeFiles/geos_c.dir/rule] Error 2
make[1]: *** [Makefile:418: geos_c] Error 2
make: *** [Makefile:757: libgeos_inner] Error 2
I went to CMakeFiles/geos.dir/build.make and on line 4569 I see:
$(CMAKE_COMMAND) -E cmake_link_script CMakeFiles/geos.dir/link.txt --verbose=$(VERBOSE) but I don't really know what is wrong and what to do next to fix this.
Can someone help out a c++ beginner? Thank you.
apparently the issue has been around for a while. Workaround is to give -DDISABLE_GEOS_INLINE=ON as described on that page.
The respective switch is named differently on the GEOS Website though, yet that seems to be outdated information and does not work.

Building Google glog with CMake on Windows (failed)

I need the glog library (https://github.com/google/glog) for a C++ project (Windows 10, Qt 5.10) and try to build it from sources using CMake. The CMake configuration process was succesful, the path to gflags is also set correctly.
After configurating glog with CMake, I tried to compile it with MinGW (command mingw32-make in the build folder). After 64%, the building process stopped with an error:
[ 64%] Linking CXX executable utilities_unittest.exe
libglog.a(symbolize.cc.obj):symbolize.cc:(.text+0x15f): undefined reference to `_imp__SymFromAddr#20'
libglog.a(symbolize.cc.obj):symbolize.cc:(.text$_ZN6google14SymInitializerC1Ev[__ZN6google14SymInitializerC1Ev]+0x2f): undefined reference to `_imp__SymSetOptions#4'
libglog.a(symbolize.cc.obj):symbolize.cc:(.text$_ZN6google14SymInitializerC1Ev[__ZN6google14SymInitializerC1Ev]+0x51): undefined reference to `_imp__SymInitialize#12'
libglog.a(symbolize.cc.obj):symbolize.cc:(.text$_ZN6google14SymInitializerD1Ev[__ZN6google14SymInitializerD1Ev]+0x12): undefined reference to `_imp__SymCleanup#4' libglog.a(demangle.cc.obj):demangle.cc:(.text+0x9e): undefined reference to `_imp__UnDecorateSymbolName#16'
collect2.exe: error: ld returned 1 exit status
CMakeFiles\utilities_unittest.dir\build.make:98: recipe for target 'utilities_unittest.exe' failed
mingw32-make[2]: *** [utilities_unittest.exe] Error 1
CMakeFiles\Makefile2:482: recipe for target 'CMakeFiles/utilities_unittest.dir/all' failed
mingw32-make[1]:
*** [CMakeFiles/utilities_unittest.dir/all] Error 2
Makefile:159: recipe for target 'all' failed
mingw32-make: *** [all] Error 2
Do you have any idea how to fix it?
I already tried to enable the
CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS
option, but this did not solve the problem.
Thank you for your help!

CMake undefined reference to `mg_printf'

I've been trying to work this out for a while and I've decided to ask for help.
I'm trying to include mongoose in my project, so in my api_and_json.cpp file I have:
extern "C"{
#include "mongoose/mongoose.h"
}
My cmake file currently looks like this:
cmake_minimum_required(VERSION 2.8)
include(ProcessorCount)
ProcessorCount(N)
if(NOT N EQUAL 0)
set(CTEST_BUILD_FLAGS -j${N})
set(ctest_test_args ${ctest_test_args} PARALLEL_LEVEL ${N})
endif()
project(api_and_json)
set(CMAKE_BINARY_DIR ${CMAKE_SOURCE_DIR}/bin)
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR})
set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR})
include_directories("${PROJECT_SOURCE_DIR}")
add_executable(api_and_json ${PROJECT_SOURCE_DIR}/api_and_json.cpp)
I've tried a few permutations, so I've stripped it back to how it was before.
CMake works fine, but when I try make I get:
...
[ 50%] Linking CXX executable ../bin/api_and_json
CMakeFiles/api_and_json.dir/api_and_json.cpp.o: In function `ev_handler(mg_connection*, int, void*)':
api_and_json.cpp:(.text+0xa1): undefined reference to `mg_printf'
api_and_json.cpp:(.text+0xb7): undefined reference to `mg_printf_http_chunk'
api_and_json.cpp:(.text+0xcd): undefined reference to `mg_send_http_chunk'
CMakeFiles/api_and_json.dir/api_and_json.cpp.o: In function `main':
api_and_json.cpp:(.text+0x10c): undefined reference to `mg_mgr_init'
api_and_json.cpp:(.text+0x184): undefined reference to `mg_bind_opt'
api_and_json.cpp:(.text+0x1dc): undefined reference to `mg_set_protocol_http_websocket'
api_and_json.cpp:(.text+0x32b): undefined reference to `mg_mgr_poll'
collect2: error: ld returned 1 exit status
CMakeFiles/api_and_json.dir/build.make:94: recipe for target '../bin/api_and_json' failed
make[2]: *** [../bin/api_and_json] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/api_and_json.dir/all' failed
make[1]: *** [CMakeFiles/api_and_json.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
I'm sure I'm missing something simple, any help will be appreciated.
I've looked elsewhere including:
What is an undefined reference/unresolved external symbol error and how do I fix it?
This reference did not help me, but the suggestion by Rama did.
You forgot to link against mongoose.
Add this line at the end of your CmakeList.txt:
target_link_libraries (api_and_json mongoose)

Linker error while building from source code

I am trying to build an application from source. I am able to configure it using 'cmake .'. However, when I run 'make' it gives me this:
Linking CXX executable ../../bin/lux64/Release/od_batch_launcher
../../bin/lux64/Release/libBasic.so: undefined reference to `dlopen'
../../bin/lux64/Release/libBasic.so: undefined reference to `dlclose'
../../bin/lux64/Release/libBasic.so: undefined reference to `dlerror'
../../bin/lux64/Release/libBasic.so: undefined reference to `dlsym'
../../bin/lux64/Release/libBasic.so: undefined reference to `pthread_sigmask'
collect2: error: ld returned 1 exit status
make[2]: *** [bin/lux64/Release/od_batch_launcher] Error 1
make[1]: *** [src/Basic/CMakeFiles/od_batch_launcher.dir/all] Error 2
make: *** [all] Error 2
I understand that its is unable to dynamically link to a c++ library. I don't quite know how to make the necessary changes to cmake. I am running gcc version: 4.9.2 on Linux Mint 17. I would be grateful for any help. Thank you!
Try passing -DCMAKE_EXE_LINKER_FLAGS=-ldl to the CMake executable. To change the CMake build scripts, add something like:
target_link_libraries(target_name dl)
where target_name is basically the executable name without any extensions (e.g. .exe).
EDIT: Actually, I just reread you question, and I'm putting this in the wrong place. You really want:
target_link_libraries(Basic dl)
Apparently, there were also pthread-related errors, so you'd also have to add:
target_compile_options(Basic PUBLIC -pthread)
Both of these go in whichever file contains add_library(Basic) (usually CMakeLists.txt).
EDIT 2: Instead of target_compile_options, try:
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")

Qt 5.0.2 + Mingw-builds (4.8.1) webkit linkage error

I am trying to build Qt 5.0.2 with Mingw-builds (4.8.1), but during webkit building i have linking error:
C:/qt-everywhere-opensource-src-5.0.2/qtwebkit/Source/WebKit/release/libWebKit1.a(FullScreenVideoQt.o):FullScreenVideoQt.cpp:(.text+0x143): undefined reference to `WebCore::HTMLMediaElement::platformMedia() const'
C:/qt-everywhere-opensource-src-5.0.2/qtwebkit/Source/WebKit/release/libWebKit1.a(FullScreenVideoQt.o):FullScreenVideoQt.cpp:(.text+0x19e): undefined reference to `WebCore::HTMLMediaElement::platformMedia() const'
C:/qt-everywhere-opensource-src-5.0.2/qtwebkit/Source/WebKit/release/libWebKit1.a(FullScreenVideoQt.o):FullScreenVideoQt.cpp:(.text+0xe5): undefined reference to `WebCore::HTMLMediaElement::exitFullscreen()'
c:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.8.1/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/qt-everywhere-opensource-src-5.0.2/qtwebkit/Source/WebKit/release/libWebKit1.a(FullScreenVideoQt.o): bad reloc address 0x0 in section `.pdata'
collect2.exe: error: ld returned 1 exit status
Makefile.api.Release:81: recipe for target '..\lib\Qt5WebKit.dll' failed
mingw32-make[4]: *** [..\lib\Qt5WebKit.dll] Error 1
mingw32-make[4]: Leaving directory 'c:/qt-everywhere-opensource-src-5.0.2/qtwebkit/Source'
Makefile.api:52: recipe for target 'release-all' failed
mingw32-make[3]: *** [release-all] Error 2
mingw32-make[3]: *** Waiting for unfinished jobs....
C:/qt-everywhere-opensource-src-5.0.2/qtwebkit/Source/WebKit/debug/libWebKit1d.a(FullScreenVideoQt.o):FullScreenVideoQt.cpp:(.text+0x94): undefined reference to `WebCore::ChromeClientQt::createFullScreenVideoHandler()'
C:/qt-everywhere-opensource-src-5.0.2/qtwebkit/Source/WebKit/debug/libWebKit1d.a(FullScreenVideoQt.o):FullScreenVideoQt.cpp:(.text+0x163): undefined reference to `WebCore::HTMLMediaElement::platformMedia() const'
C:/qt-everywhere-opensource-src-5.0.2/qtwebkit/Source/WebKit/debug/libWebKit1d.a(FullScreenVideoQt.o):FullScreenVideoQt.cpp:(.text+0x1c7): undefined reference to `WebCore::HTMLMediaElement::platformMedia() const'
C:/qt-everywhere-opensource-src-5.0.2/qtwebkit/Source/WebKit/debug/libWebKit1d.a(FullScreenVideoQt.o):FullScreenVideoQt.cpp:(.text+0x293): undefined reference to `WebCore::HTMLMediaElement::platformMedia() const'
C:/qt-everywhere-opensource-src-5.0.2/qtwebkit/Source/WebKit/debug/libWebKit1d.a(FullScreenVideoQt.o):FullScreenVideoQt.cpp:(.text+0x122): undefined reference to `WebCore::HTMLMediaElement::exitFullscreen()'
c:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.8.1/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/qt-everywhere-opensource-src-5.0.2/qtwebkit/Source/WebKit/debug/libWebKit1d.a(FullScreenVideoQt.o): bad reloc address 0x0 in section `.pdata'
collect2.exe: error: ld returned 1 exit status
Makefile.api.Debug:81: recipe for target '..\lib\Qt5WebKitd.dll' failed
mingw32-make[4]: *** [..\lib\Qt5WebKitd.dll] Error 1
mingw32-make[4]: Leaving directory 'c:/qt-everywhere-opensource-src-5.0.2/qtwebkit/Source'
Makefile.api:38: recipe for target 'debug-all' failed
mingw32-make[3]: *** [debug-all] Error 2
mingw32-make[3]: Leaving directory 'c:/qt-everywhere-opensource-src-5.0.2/qtwebkit/Source'
Makefile.QtWebKit:43: recipe for target 'sub-api-pri-all-ordered' failed
mingw32-make[2]: *** [sub-api-pri-all-ordered] Error 2
mingw32-make[2]: Leaving directory 'c:/qt-everywhere-opensource-src-5.0.2/qtwebkit/Source'
Makefile:221: recipe for target 'sub-Source-QtWebKit-pro-all-ordered' failed
mingw32-make[1]: *** [sub-Source-QtWebKit-pro-all-ordered] Error 2
mingw32-make[1]: Leaving directory 'c:/qt-everywhere-opensource-src-5.0.2/qtwebkit'
Makefile:233: recipe for target 'module-qtwebkit-all' failed
mingw32-make: *** [module-qtwebkit-all] Error 2
So, does anybody know how i can fix this error, and is it possible to build Qt 5.0.2 with MinGW on windows?
P.S. My configure command:
>configure.bat -debug-and-release -developer-build -opensource -icu -opengl desktop -platform win32-g++ -c++11 -shared -nomake examples -nomake demos -nomake tests -prefix C:\Libs\Qt
It sounds strange, but when i done build in another directory with another -prefix option for 'configure' script build have finished successfully... So, question is closed? thanks all for responses...