Error while compiling qt-dab with Qt (Ubuntu 14.04) - c++

I am trying to compile qt-dab by using the command line:
qmake qt-dab.pro
make
But I get these error messages:
/usr/bin/ldĀ : ne peut trouver -lqwt-qt5
collect2: error: ld returned 1 exit status
make: *** [linux-bin/qt-dab-0.998] Erreur 1
"qmake -v" gives me QMake version 3.0 using Qt version 5.2.1 in /usr/lib/x86_64-linux-gnu.
Moreover, I installed the qwt-6.1.3 library. Is there a solution for this?

The linker can not find the library: qwt-qt5.
If you've installed the qwt library, you will want to find where it is located.
It sounds like you may have installed version 6 of the library,
but are trying to link with version 5 (which may be non-existent on your machine).
When you find the correct library on your system, you can tell the linker which to directories to search for it using the -L flag.

Related

ProtoBuf Compile Link GCC

I am trying to debug why protobuf is not being linked in my C++ project.
So I tried this in cygwin:
$ gcc -libprotobuf
/usr/lib/gcc/x86_64-pc-cygwin/4.9.3/../../../../x86_64-pc-cygwin/bin/ld: cannot find -libprotobuf
collect2: error: ld returned 1 exit status
I built and installed protobuf on cygwin.
it should be -lprotobuf, find libprotobuf.so in /usr/lib or /usr/lib64/

Setting Eclipse CDT with cygwin 1.7 for gtest

I am running a simple gtest sample in eclipse CDT using cygwin, initially i was getting error as
make***multiple target pattern
Then I changed the library path from D:/ to /cygdrive/d/ and the error is gone but now it is telling
undefined reference to blah blah files
collect2: ld returned 1 exit status
make: *** [sample_gmock.exe] Error 1
I checked the makefile and objects.mk all the things are proper there
g++ -L"/cygdrive/D/Project/gmock-1.6.0/gtest/make" -o "sample_gmock.exe"
./src/sample1.o ./src/sample1_unittest.o /cygdrive/D/Project/gmock-1.6.0/gtest
/make/gtest_main.a -lpthread
What should I do to resolve and make it work, so that I am able to run gmock and gtest in eclipse using cygwin
At first I was working on Linux environment and had gmock_main.a and gtest_main.a generated over there. Same files I was using in Windows environment in Eclipse, so it was giving error.
To get rid of the error I compiled the gmock and gtest code in cygwin terminal to generate gmock_main.a and gtest_main.a, and its working fine.

Why can't the linker find the CppUnit libraries?

I am trying to learn the CPPUNIT i looked at the following link:
CPPUNIT
although the selected language here is c i have selected c++ while creating this application and have added the
C:\cppunit\cppunit-1.12.1\include to the include directories i have also added cppunitd,cppunit in the linker options however i still the errors as while i try to test the cppunit.
Errors:
c:/mingw/bin/../lib/gcc/mingw32/4.6.1/../../../../mingw32/bin/ld.exe: cannot find
-lcppunitd
c:/mingw/bin/../lib/gcc/mingw32/4.6.1/../../../../mingw32/bin/ld.exe: cannot find -lcppunit
c:/mingw/bin/../lib/gcc/mingw32/4.6.1/../../../../mingw32/bin/ld.exe: cannot find -lcppunit
collect2: ld returned 1 exit status
make[1]: *** [build/Debug/MinGW_1-Windows/tests/TestFiles/f1] Error 1
make: *** [.build-tests-impl] Error 2
BUILD TESTS FAILED (exit value 2, total time: 4s)
Need to use the -L flag and have a path to the library.
I experienced the same linker error and found that I only had 64-bit version of CppUnit installed while building 32-bit application. I solved it by installing 32-bit version of the library.

Building Boost with ICU using MinGW

I downloaded the last ICU release (49) binaries and add the following arg to b2:
-sICU_PATH="D:\lib64\icu"
I got
gcc.link D:\boost\1.51.0\boost\boost\bin.v2\libs\locale\build\gcc-mingw-4.7.1\debug\has_icu64.exe
d:/mingw/bin/../lib/gcc/x86_64-w64-mingw32/4.7.1/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -licui18n
d:/mingw/bin/../lib/gcc/x86_64-w64-mingw32/4.7.1/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -licudata
collect2.exe: error: ld returned 1 exit status
There were not such libicui18n, libicudata among icu binaries.
So I tried to build it myself. I got this error
PATH=../../lib:../../stubdata:../../tools/ctestfw:$PATH ../../bin/genrb -e UTF-8 -s resources -d uconvmsg root.txt
Makefile:173: recipe for target `uconvmsg/root.res' failed
make[2]: *** [uconvmsg/root.res] Error 127
Could somebody suggest me how I should build Boost with ICU using MinGW?
1.) the libraries in the package you downloaded are named icuin49.dll, icudt49.dll. We build regularly with mingw (and many other platforms) to test, but don't post those binaries.
2.) uconv is just an extra. You can disable it with --disable-extras on the configure line. (not enough info there to tell me why it failed.)

Project Compilation Error - cannot find -lwxmsw28

While compiling a project i get the following error as
c:/mingw/bin/../lib/gcc/mingw32/4.6.2/../../../../mingw32/bin/ld.exe: cannot find lwxmsw28
collect2: ld returned 1 exit status
make[2]: *** [dist/Debug/MinGW-Windows/libRegistration.dll] Error 1
make[1]: *** [.build-conf] Error 2
make: *** [.build-impl] Error 2
I am using wxwidgets libraries however when i ran a command in cmd as
wx-config --libs
i could not see lwxmsw28 either let me know if it is downloadable from somewhere or any workaround to resolve this issue.
Thanks
This is a linker error, rather than a compilation error.
"lwxmsw28" looks to me like a wxwidgets v2.8 microsoft windows library. Should the linker be looking for this? Since you are using mingw, I would think you should NOT be linking to msw libraries. However, I am not familiar with mingw, so maybe this is the name used for mingw libraries.
If this is the correct library, then the next question is: have you built the wxWidgets libraries? The libraries are NOT "downloadable from somewhere" - you must download the source and build the libraries yourself.
A simple test to find out if you have built the libraries - try to build one of the sample projects.