I am having linking errors trying to run the gtkada sample program that comes with GPS.
Link
[link] main.adb
/usr/lib/x86_64-linux-gnu/libgtk-3.so: undefined reference to `pango_fc_font_map_config_changed'
collect2: error: ld returned 1 exit status
gprbuild: link of main.adb failed
[2018-07-19 09:39:45] process exited with status 4, 100% (8/8), elapsed time: 01.05s
Is there a way to see what library paths GPS is searching?
Thanks,
In Project/Build/Switches/Ada Linker, add (in the summary line at the bottom of the panel)
-v -Wl,-v
(the -v is a switch to gnatbind, the -Wl,-v is a switch to the underlying linker. You may only need the latter)
Related
With the enthusiastic help of SO netizens, I configured all the environments required for ASAP (Automated Slide Analysis Platform)
The necessary libraries including Boost, Openslide, Qt, etc. have been successfully linked, but the following error occurred
====================[ Build | ASAP | Debug ]====================================
"D:\_Jason\Clion\CLion 2021.2.2\bin\cmake\win\bin\cmake.exe" --build D:\_Jason\C++_hospital\orignal\CLion1.9\ASAP-1.9\cmake-build-debug --target ASAP -- -j 9
[ 25%] Automatic MOC and UIC for target ASAP
[ 25%] Built target ASAP_autogen
[ 50%] Linking CXX executable ASAP.exe
CMakeFiles\ASAP.dir/objects.a(main.cpp.obj): In function `main':
D:/_Jason/C++_hospital/orignal/CLion1.9/ASAP-1.9/ASAP/main.cpp:6: undefined reference to `__imp__ZN12QApplicationC1ERiPPci'
D:/_Jason/C++_hospital/orignal/CLion1.9/ASAP-1.9/ASAP/main.cpp:7: undefined reference to `__imp__ZN4ASAPC1EP7QWidget'
D:/_Jason/C++_hospital/orignal/CLion1.9/ASAP-1.9/ASAP/main.cpp:8: undefined reference to `__imp__ZN7QWidget4showEv'
D:/_Jason/C++_hospital/orignal/CLion1.9/ASAP-1.9/ASAP/main.cpp:10: undefined reference to `__imp__ZN12QApplication4execEv'
D:/_Jason/C++_hospital/orignal/CLion1.9/ASAP-1.9/ASAP/main.cpp:7: undefined reference to `__imp__ZN4ASAPD1Ev'
D:/_Jason/C++_hospital/orignal/CLion1.9/ASAP-1.9/ASAP/main.cpp:6: undefined reference to `__imp__ZN12QApplicationD1Ev'
D:/_Jason/C++_hospital/orignal/CLion1.9/ASAP-1.9/ASAP/main.cpp:7: undefined reference to `__imp__ZN4ASAPD1Ev'
D:/_Jason/C++_hospital/orignal/CLion1.9/ASAP-1.9/ASAP/main.cpp:6: undefined reference to `__imp__ZN12QApplicationD1Ev'
collect2.exe: error: ld returned 1 exit status
mingw32-make.exe[3]: *** [CMakeFiles\ASAP.dir\build.make:111: ASAP.exe] Error 1
mingw32-make.exe[2]: *** [CMakeFiles\Makefile2:163: CMakeFiles/ASAP.dir/all] Error 2
mingw32-make.exe[1]: *** [CMakeFiles\Makefile2:170: CMakeFiles/ASAP.dir/rule] Error 2
mingw32-make.exe: *** [Makefile:168: ASAP] Error 2
It can be seen from "__imp__ZN12QApplicationD1Ev" that this is a Qt problem. The solution they gave in other forums is to add the statement QT += gui widgets core to the .pro file under this project.However, there is no .pro file in the ASAP source code, so I tried to use the qmake -project command to generate the .pro file. It still doesn't work after adding QT += gui widgets core
I'm using the Mozzi lib (http://sensorium.github.io/Mozzi/) as part of a tutorial (http://www.echanter.com/home/howto-build#TOC-Arduino-IDE). I included the Mozzi in Arduino Studio and followed minor configs in the tutorial. I've looked around the lines that are reported, but I'm stumped. Compile error is:
Mozzi/mozzi_fixmath.cpp.o: In function isqrt16(unsigned int)': /home/temp/sketchbook/libraries/Mozzi/mozzi_fixmath.cpp:156: multiple definition of isqrt32(unsigned long)'
echanter.cpp.o:/home/temp/sketchbook/libraries/Mozzi/Sample.h:61: first defined here
collect2: error: ld returned 1 exit status
In the root dir are two files with isqrt16(unsigned int) defined: mozzi_fixmath.cpp and mozzi_fixmath.h. I commented out the definition in the cpp file and it compiled.
I'm writing simple OpenGl program using ADA in GPS IDE.
I have all supporting file (like glut.ads/adb, Gl.ads/adb)
I have created Pragma like "pragma Linker_Options("../Lib/glut32.dll");"
But I get errors like
Link
[link] main.adb
collect2.exe: error: ld returned 5 exit status
gprbuild: link of main.adb failed
gprbuild: failed command was: c:\gnat\2019\bin\gcc.exe main.o b__main.o D:\Saravanan\Project\Training\Open_GL Project\obj\GL-Extended.o D:\Saravanan\Project\Training\Open_GL Project\obj\GL.o D:\Saravanan\Project\Training\Open_GL Project\obj\glut.o -LD:\Saravanan\Project\Training\Open_GL Project\obj\ -LD:\Saravanan\Project\Training\Open_GL Project\obj\ -LC:/gnat/2019/lib/gcc/x86_64-pc-mingw32/8.3.1/adalib/ -static-libgcc ../Lib/glut32.dll C:/gnat/2019/lib/gcc/x86_64-pc-mingw32/8.3.1/adalib/libgnat
.a -Wl,--stack=0x2000000 -o main.exe
[2019-12-23 15:28:13] process exited with status 4, elapsed time: 01.83s
So kindly help me to resolve this issue
You might want to try
pragma Linker_Options("-L../Lib");
pragma Linker_Options("-lglut32");
See also, for example, here and here.
If you're using FreeGLUT, you need to link against additional system libraries:
pragma Linker_Options ("-lglu32", "-lopengl32", "-lgdi32",
"-lwinmm", "-luser32");
These are from the FreeGLUT C header.
Then you either do what #DeeDee suggested, or you place your DLL file into c:\gnat\2019\lib and just do
pragma Linker_Options ("-lglut32");
You might want to have a look at my OpenGLAda binding which handles this stuff with GPR files but uses GLFW instead of GLUT.
I am building a Unit-Test using this tutorial. However, when compiling my code I get these two errors:
undefined reference to 'WinMain#16'.
collect2: ld returned 1 exit status.
why is this happening?
Did you create a main function where you create a qapplication? There's a good example here
You can also get that error when you're creating a DOS executable instead of a Windows GUI executable. It's looking for winmain() not main(),
I want to install PyQt for Qt 4.7.4 and i downloaded the packages SIP and PyQt from riverbankcomputing.co.uk.
I configured and installed SIP successfully and configured PyQt successfully. But when i ran make in the terminal i got this error:
/home/user/Desktop/PyQt-x11-gpl-4.8.5/QtCore/sipQtCoreQThread.cpp: In function ‘PyObject* meth_QThread_currentThreadId(PyObject*, PyObject*)’:
/home/user/Desktop/PyQt-x11-gpl-4.8.5/QtCore/sipQtCoreQThread.cpp:325:50: error: invalid conversion from ‘void*’ to ‘long unsigned int’
/home/user/Desktop/PyQt-x11-gpl-4.8.5/QtCore/sipQtCoreQThread.cpp:325:50: error: initializing argument 1 of ‘PyObject* PyLong_FromUnsignedLong(long unsigned int)’
make[1]: *** [sipQtCoreQThread.o] Error 1
make[1]: Leaving directory `/home/user/Desktop/PyQt-x11-gpl-4.8.5/QtCore'
make: *** [all] Error 2
The full log is here: http://www.text-upload.com/read.php?id=176672&c=5376703
Can you help me fix this error, please? Thank you!
According to the build log, PyQt's configure script has found and is using the Simulator/embedded variant of Qt, and not the Desktop variant.
Try passing the path to qmake of the Desktop variant to the configure script:
python ./configure.py -q /home/user/.QtSDK/Desktop/Qt/4.7.4/gcc/bin/qmake
There are two choices
python ./configure.py -q /home/user/.QtSDK/Desktop/Qt/4.7.4/gcc/bin/qmake
or
python ./configure.py -q /home/user/.QtSDK/Simulator/Qt/gcc/bin/qmake
second will exit with some error code.
I'm trying first string right now.