I have used Ada successfully for years; but I am trying to create "hello world," and I am getting the following error:
/opt/GNAT/2021/bin/../libexec/gcc/x86_64-pc-linux-gnu/10.3.1/ld:
.gnu.build.attributes has both ordered
[.gnu.build.attributes.lo.exit in /lib/../lib64/crt1.o] and unordered
[.gnu.build.attributes in /lib/../lib64/crt1.o] sections
/opt/GNAT/2021/bin/../libexec/gcc/x86_64-pc-linux-gnu/10.3.1/ld:
final link failed: bad value collect2: error: ld returned 1 exit status
Try to replace GNAT CE ld with system one:
cd /opt/GNAT/2021/libexec/gcc/x86_64-pc-linux-gnu/10.3.1/
mv ld ld_
ln -s /usr/bin/ld ./ld
Related
I was installing Caffe and ran into an error:
make all CXX/LD -o .build_release/tools/compute_image_mean.bin
//home/ivan/anaconda3/lib/libpng16.so.16: undefined reference to
`inflateValidate#ZLIB_1.2.9' collect2: error: ld returned 1 exit
status Makefile:625: recipe for target
'.build_release/tools/compute_image_mean.bin' failed make: ***
[.build_release/tools/compute_image_mean.bin] Error 1
the possible solution is to run ./configure --prefix=/usr/local/, however, which configure is it about, and where can I find it?
cocos2d-x 3.14.1, ndk r13b
'Standard' compile command works fine:
cocos compile -p android -m debug --ap android-23
I get an apparent link error when I compile using this command:
cocos compile -p android -m debug --ap android-23 --android-studio
Error:
jni/../../../Classes/AppDelegate.cpp:289: error: undefined reference to 'MainMenu::createScene()'
collect2: error: ld returned 1 exit status
make: *** [obj/local/armeabi/libMyGame.so] Error 1
Error running command, return code: 2.
Struggling with this - any ideas please?
It seems you haven't added the MainMenu class in Android.mk for Android Studio.
Open the android.mk from following path:
~project-directory/proj.android-studio/app/jni/android.mk
Add all the classes that you have in the following manner:
LOCAL_SRC_FILES := hellocpp/main.cpp \
../../../Classes/AppDelegate.cpp \
../../../Classes/HelloWorldScene.cpp
Note: Edit the above classes with your actual names.HelloWorldScene.cpp is just used for representation purposes.
/usr/bin/ld: cannot find -lmdb
collect2: error: ld returned 1 exit status
Makefile:568: recipe for target '.build_release/lib/libcaffe.so.1.0.0-rc3' failed
make: *** [.build_release/lib/libcaffe.so.1.0.0-rc3] Error 1
How to get rid of this problem.
Make sure that the library file your are trying to use while compiling is present in the path that your have given while compiling...
I am still doing the Caffe Installation but now I'm facing a new problem. When I run make command a new error massage appear which is:
LD -o .build_release/lib/libcaffe.so.1.0.0-rc3
/usr/bin/ld: cannot find -lhdf5_hl
/usr/bin/ld: cannot find -lhdf5
/usr/bin/ld: cannot find -lopencv_imgcodecs
collect2: error: ld returned 1 exit status
Makefile:563: recipe for target '.build_release/lib/libcaffe.so.1.0.0-rc3'
failed
make: *** [.build_release/lib/libcaffe.so.1.0.0-rc3] Error 1
I am pretty sure I already have all the dependencies.
Hope someone can help me. Thank you.
It can't find the way to reach the files. I mean the files here are libhdf5_hl.so, libhdf5.so and libopencv_imgcodecs.so.
Open your Makefile.config file, you'll find the following lines:
# Whatever else you find you need goes here.
INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include
LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib
That means those 3 files I mentioned above are not found within the default LIBRARY_DIRS. Search through usr subdirectories.
If you've found the location, for example /usr/local/hdf5/lib, then add it to LIBRARY_DIRS.
LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib /usr/local/hdf5/lib
You need to create symbolic links to the missing library files. For hdf5 you may do this:
ln -s /usr/lib/x86_64-linux-gnu/libhdf5_serial.so.10.0.1 /usr/lib/x86_64-linux-gnu/libhdf5.so
ln -s /usr/lib/x86_64-linux-gnu/libhdf5_serial_hl.so.10.0.1 /usr/lib/x86_64-linux-gnu/libhdf5_hl.so
Before creating the symbolic links check the version of your library files and OS. For me it's 10.0.1 and my OS is Ubuntu 15.10.
I am connecting the Mysql using c program in eclipse, I am using CYGWIN compiler to compile program. I have installed the mysql c connector and added the include files to the compiler and linker
but i am getting error
**** Build of configuration Debug for project DbConnectionC ****
make all
Building file: ../connection.c
Invoking: Cygwin C Compiler
gcc -I"C:\Program Files (x86)\MySQL\MySQL Connector C 6.0.2\include" -include"C:\Program Files (x86)\MySQL\MySQL Connector C 6.0.2\include\mysql.h" -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"connection.d" -MT"connection.d" -o "connection.o" "../connection.c"
cygwin warning:
MS-DOS style path detected: D:\java\workspace\DbConnectionC\Debug
Preferred POSIX equivalent is: /cygdrive/d/java/workspace/DbConnectionC/Debug
CYGWIN environment variable option "nodosfilewarning" turns off this warning.
Consult the user's guide for more details about POSIX paths:
http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
../connection.c: In function `main':
../connection.c:57: warning: char format, different type arg (arg 2)
../connection.c:57: warning: char format, different type arg (arg 2)
../connection.c:61: warning: char format, different type arg (arg 2)
../connection.c:61: warning: char format, different type arg (arg 2)
Finished building: ../connection.c
Building target: DbConnectionC.exe
Invoking: Cygwin C Linker
gcc -L"C:\Program Files (x86)\MySQL\MySQL Connector C 6.0.2\lib\opt" -o "DbConnectionC.exe" ./connection.o -llibmysql.lib -lmysqlclient.lib
/usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../../i686-pc-cygwin/bin/ld: cannot find -llibmysql.lib
/usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../../i686-pc-cygwin/bin/ld: cannot find -lmysqlclient.lib
collect2: ld returned 1 exit status
make: *** [DbConnectionC.exe] Error 1
makefile:29: recipe for target `DbConnectionC.exe' failed
**** Build Finished ****
Please help me on this
thanks in advance
In the first part you have some warnings about possible problems:
../connection.c:39: warning: implicit declaration of function `exit'
This means function exit() is not declared, your source needs an #include <stdlib.h>
../connection.c:46: warning: control reaches end of non-void function
You don't return a value at the end of main(), add a return 0; if the program succeeds.
In the second part are linker warnings:
/usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../../i686-pc-cygwin/bin/ld: cannot find -llibmysql.lib
/usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../../i686-pc-cygwin/bin/ld: cannot find -lmysqlclient.lib
which means the linker needs a path to the libraries or the libraries do not exist or the library names are misspelled.
One possible solution is using -lmysql -lmysqlclient instead of -llibmysql.lib -lmysqlclient.lib, but I'm not that familiar with Windows.
Having said that, I suggest strongly, you look at https://stackoverflow.com/tags/c/info and look at some book links.