ADA not able to link glut32.dll in GPS IDE - ada

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.

Related

Compile error in Arduino IDE using Mozzi library

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.

GTKAda hello world

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)

trouble compiling chrome native client tutorial

I tried following the tutorial here for NaCl or PNaCl or native client or pinnacle whatever the name of the day is and got this:
F:/nacl_sdk/pepper_31/toolchain/win_x86_newlib/bin/i686-nacl-g++ -o hello_tutori
al_x86_32.nexe hello_tutorial_32.o -m32 -O0 -g -IF:/nacl_sdk/pepper_31/include -
lppapi_cpp -lppapi
/x86_64-nacl-ld: cannot find -lppapi_cpp
collect2: ld returned 1 exit status
Makefile:64: recipe for target 'hello_tutorial_x86_32.nexe' failed
make: * [hello_tutorial_x86_32.nexe] Error 1
Any ideas?
It looks like you are running the old "hello_tutorial" example with the new pepper_31 SDK. Please use this new documentation instead:
https://developers.google.com/native-client/dev/devguide/tutorial/tutorial-part1
This source for this tutorial can be found in the pepper_31 SDK in the directory pepper_31\getting_started\part1.
The new tutorial cited by binji is set up to build/run a pexe. To use nexe's as in the older example, update the tutorial's Makefile:
Add LDFLAGS for each target:
LDFLAGS_NEWLIB_ARM := -L$(NACL_SDK_ROOT)/lib/newlib_arm/Release -lppapi_cpp -lppapi
LDFLAGS_NEWLIB_X86_32 := -L$(NACL_SDK_ROOT)/lib/newlib_x86_32/Release -lppapi_cpp -lppapi
LDFLAGS_NEWLIB_X86_64 := -L$(NACL_SDK_ROOT)/lib/newlib_x86_64/Release -lppapi_cpp -lppapi
and change the $(LDFLAGS) specified for linking the respective targets.

QT Creator: undefined reference to 'WinMain#16'

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(),

PyQt make error while compiling the source code

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.

Resources