I'm trying to bind to BugSense's lib but having a hard time trying to include the framework using -gcc_flags in the extra build arguments. BugSense provides a .framework and not a static .a lib. No amount of googling lead me to a solution to how to properly link the framework to my project.
So far I have something like this:
-v -v -v -gcc_flags "-framework ${ProjectDir}/../References/BugSense-iOS.framework"
I had copied the .framework folder to my References folder.
Building the project results in this mtouch error:
Error 1: mtouch failed with the following message:
/var/folders/XV/XVCgAKTfGEmAUQGlxdGm9E+++TU/-Tmp-/tmp36ed5372.tmp/main.m: In function 'main':
/var/folders/XV/XVCgAKTfGEmAUQGlxdGm9E+++TU/-Tmp-/tmp36ed5372.tmp/main.m:1838: warning: implicit declaration of function 'monotouch_enable_debug_tracking'
/var/folders/XV/XVCgAKTfGEmAUQGlxdGm9E+++TU/-Tmp-/tmp36ed5372.tmp/main.m:1921: warning: implicit declaration of function 'mini_get_debug_options'
/var/folders/XV/XVCgAKTfGEmAUQGlxdGm9E+++TU/-Tmp-/tmp36ed5372.tmp/main.m:1925: warning: implicit declaration of function 'mono_debugger_agent_parse_options'
/var/folders/XV/XVCgAKTfGEmAUQGlxdGm9E+++TU/-Tmp-/tmp36ed5372.tmp/main.m:2059: warning: cast from pointer to integer of different size
/var/folders/XV/XVCgAKTfGEmAUQGlxdGm9E+++TU/-Tmp-/tmp36ed5372.tmp/main.m:2059: warning: initialization makes pointer from integer without a cast
ld: framework not found /Users/xxx/Projects/myProj/myProj/../References/BugSense-iOS.framework
collect2: ld returned 1 exit status
I believe its like libraries: you specify the name of the framework and then specify where to search.
-F <dir>
-framework <name>
So try this:
-gcc_flags "-F ${ProjectDir}/../References -framework BugSense-IOS"
Related
while I am building glibc library using yocto project it is giving
error: missing attribute ((constructor)) support??
after adding the coverage flags:
TARGET_CFLAGS += "-fprofile-arcs -ftest-coverage"
TARGET_LDFLAGS += "-lgcov -fprofile-arcs -ftest-coverage"
still, I am getting an error for glibc.
Please find the link of config log file : https://drive.google.com/file/d/14tiQJ8JIFE_tDWt3H9tS8zBBQROcZDNa/view
It is not working even after adding the following line in conf/local.conf :
EXTRA_OECONF = "libc_cv_ctors_header=yes"
Even i tried this
EXTRA_OECONF_append = "libc_cv_ctors_header=yes"
please find the config log file generated during compilation : https://drive.google.com/open?id=1kxTu8pt7h_9ty55OywP9Ilmmp04T61Rr
So, How to resolve this error?
Log file error Point
poky-linux/gcc/i586-poky-linux/8.2.0/ld: /tmp/ccxetEc1.o: in function `_GLOBAL__sub_D_00100_1__start':
conftest.c:(.text.exit+0x40): undefined reference to `__gcov_exit'<br>
collect2: error: ld returned 1 exit status<br>
configure:5682: $? = 1<br>
configure:5702: error: missing __attribute__ ((constructor)) support??
You are trying to build glibc with -fprofile-arcs -ftest-coverage in CFLAGS. That will not work. The errors you see are a result of these incorrect compiler flags.
A profiling glibc requires fairly substantial changes throughout the library and needs to be created by building with --enable-profile (which is not the default).
I had this error while I tried to enable coverage on a C project using a C++ test harness (CppUTest). Build system was handled by CMake.
Compilers and gcov were aligned on the same version (gcc --version, g++ --version and gcov --version gave the same version) but it seems that my build system was generated with a gcc 5 (resulting to an additional included directory by the linker: usr/lib/gcc/x86_64-linux-gnu/5). I clean the build tree and generated it again thanks to CMake which fixed the error.
Nearly every function from Crypto++ produces undefined reference in Qt Creator, code::blocks however runs just great.
LIBS+= -lcryptopp
in .pro file seems to work as I can include needed files and declare variables unless constructor is overloaded.
For example
CryptoPP::Integer integer;
std::string str=CryptoPP::IntToString(integer, 10);
Throws
.../main.cpp:54: undefined reference to `std::string CryptoPP::IntToString<CryptoPP::Integer>(CryptoPP::Integer, unsigned int)'
collect2: error: ld returned 1 exit status
make: *** [PDBM] Error 1
07:10:21: The process "/usr/bin/make" exited with code 2.
cryptest.pro
Makefile
full rebuild //sorry, stackoverflow wants those links to be a code
/usr/lib/ contains libcrypto++.a, libcrypto++.so, libcryptopp.so and link to libcrypto++.a named libcryptopp.a
New findings: I have tried to compile this library before and now my project folder has all the .h and .cpp files in cryptopp folder. To provide all the code without showing the code new project has been created and more errors appeared:
In file included from /usr/include/cryptopp/secblock.h:7:0,
from /usr/include/cryptopp/integer.h:7,
from ../cryptest/main.cpp:7:
/usr/include/cryptopp/misc.h: In instantiation of ‘std::string CryptoPP::IntToString(T, unsigned int) [with T = CryptoPP::Integer; std::string = std::basic_string<char>]’:
../cryptest/main.cpp:54:54: required from here
/usr/include/cryptopp/misc.h:424:58: error: invalid cast from type ‘CryptoPP::Integer’ to type ‘char’
result = char((digit < 10 ? '0' : ('a' - 10)) + digit) + result;
^
Makefile:1113: recipe for target 'main.o' failed
Which means that cryptopp has been using those new .h files. So it is not only a problem with linker as I previously thought.
I'm on Ubuntu 16.04, using Qt 5.8 and Crypto++ from repository.
-lcryptopp
This option simply tells your linker that you want to link to a shared library called libcryptopp.so. However, it does not tell your linker where to find the shared library.
You must specify the folder which contains the developer's copy of the library, using the -L option. For example, if the library is in /usr/lib, then write this:
LIBS += -L/usr/lib/ -lcryptopp
I am trying to make ZIMPL using MINGW64, but I get the following error:
myname#... MINGW64 ~/scipoptsuite-3.2.1/zimpl-3.3.3
$ make
-> generating library lib/libzimpl-3.3.3.mingw.x86_64.gnu.opt.a
-> linking bin/zimpl-3.3.3.mingw.x86_64.gnu.normal.opt
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible lib/libgmp.a when searching for -lgmp
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible lib\libgmp.a when searching for -lgmp
....
....
....
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lmsvcrt
collect2.exe: error: ld returned 1 exit status
make: *** [Makefile:170: bin/zimpl-3.3.3.mingw.x86_64.gnu.normal.opt] Error 1
In the README of ZIMPL it says:
The most likely reason that you can't compile, is that gmp.h or zlib.h
are not in your include path (-I) or that libgmp.a oder libz.a are not
in your library path (-L).
But I have those files present in C:\msys64\mingw64\include and C:\msys64\mingw64\lib respectively. Isn't this the right location?
My questions:
- What does this error mean?
- What are the right locations for the files mentioned?
- How do I include these files to the right include and library path? Is it -I/mingw64/include and -L/mingw64/lib?
Thank you in advance.
One reason for these error messages might be that your GMP library is built for another architecture than you're trying to link to (32 bit vs 64 bit). Have a look at this question: skipping incompatible... / cannot find
You might also try using a different linker as suggested here: MinGW-W64 linker skipping incompatible files when searching for third-party static libraries
I think the paths you specified are already correct, it's just that the libs there don't work with your binary. If you can go without GMP, I suggest you try compiling ZIMPL with the option GMP=false.
I'm trying to make a shared library, in Linux, which is a *.so. My DMD version is 2, latest. I'm just trying yo compile a simple empty shared library, with the code that Mono-D(plugin for MonoDevelop) creates. When I try to compile it, it tells me to check the build log, this is what's in the build log:
Building Solution: QScr (Debug)
Building: QScr (Debug)
Performing main compilation...
Current dictionary: /home/nafees/Desktop/Projects/QScr/QScr
dmd -debug -gc "myclass.d" "dllmain.d" "-I/usr/include/dmd" "-L/IMPLIB:/home/nafees/Desktop/Projects/QScr/QScr/bin/Debug/libQScr.a" "-odobj/Debug" "-of/home/nafees/Desktop/Projects/QScr/QScr/bin/Debug/libQScr.so" -w -vcolumns
/usr/bin/ld: cannot find /IMPLIB:/home/nafees/Desktop/Projects/QScr/QScr/bin/Debug/libQScr.a: No such file or directory
collect2: error: ld returned 1 exit status
--- errorlevel 1
Exit code 1
Build complete -- 1 error, 0 warnings
---------------------- Done ----------------------
Build: 1 error, 0 warnings
This is what dllmain contains:
module dllmain;
And in myclass.d:
module myclass;
class MyClass
{
//TODO: Enter class code here
}
export:
extern(D):
MyClass createMyClass()
{
return new MyClass();
}
I have no idea what is that a file, I'm still fairly new to D, and Linux.
How do I get it to compile? And could someone explain to me what is an .a file?
EDIT: No, it's not a duplicate, I'm trying to compile, while that question is about loading libraries.
EDIT2: I checked the directory, the .a file doesn't exist.
/usr/bin/ld: cannot find /IMPLIB:/home/nafees/Desktop/Projects/QScr/QScr/bin/Debug/libQScr.a: No such file or directory
/IMPLIB is a Windows linker switch. Your IDE is misconfigured (or just buggy).
Try changing the project settings in the IDE or filing a bug against the IDE.
Few things.
extern(D) would not be needed for free functions since it is default
You don't need createMyClass function at all, new will work fine
-shared must be passed to dmd for it to create a shared library
In case you didn't know, you will be passing the files in the shared library as import files when compiling the host binary.
Any idea why i cant use or cant build in Lua the ProTeaAudio ?
1) Exist
[root#example ~]# yum install lua-devel
Loaded plugins: presto, refresh-packagekit
Setting up Install Process
Package lua-devel-5.1.4-4.fc12.i686 already installed and latest version
Nothing to do
2) get failed to build the RtAudio
[sun#example proteaAudio_src_090204]$ make
g++ -O2 -Wall -DHAVE_GETTIMEOFDAY -D__LINUX_ALSA__ -Irtaudio -Irtaudio/include -I../lua/src -I../archive/baseCode/include -c rtaudio/RtAudio.cpp -o rtaudio/RtAudio.o
rtaudio/RtAudio.cpp:365: error: no ‘unsigned int RtApi::getStreamSampleRate()’ member function declared in class ‘RtApi’
rtaudio/RtAudio.cpp: In member function ‘virtual bool RtApiAlsa::probeDeviceOpen(unsigned int, RtApi::StreamMode, unsigned int, unsigned int, unsigned int, RtAudioFormat, unsigned int*, RtAudio::StreamOptions*)’:
rtaudio/RtAudio.cpp:5835: error: ‘RTAUDIO_SCHEDULE_REALTIME’ was not declared in this scope
rtaudio/RtAudio.cpp:5837: error: ‘struct RtAudio::StreamOptions’ has no member named ‘priority’
make: *** [rtaudio/RtAudio.o] Error 1
[sun#example proteaAudio_src_090204]$
Lua 5.1.4 Copyright (C) 1994-2008 Lua.org, PUC-Rio
> require("proAudioRt");
stdin:1: module 'proAudioRt' not found:
no field package.preload['proAudioRt']
no file './proAudioRt.lua'
no file '/usr/share/lua/5.1/proAudioRt.lua'
no file '/usr/share/lua/5.1/proAudioRt/init.lua'
no file '/usr/lib/lua/5.1/proAudioRt.lua'
no file '/usr/lib/lua/5.1/proAudioRt/init.lua'
no file './proAudioRt.so'
no file '/usr/lib/lua/5.1/proAudioRt.so'
no file '/usr/lib/lua/5.1/loadall.so'
stack traceback:
[C]: in function 'require'
stdin:1: in main chunk
[C]: ?
Lua is trying to tell you that it cannot find an implementation of the module "proAudioRt" which it tried to find in a variety of places. The first block of places are various attempts at loading an implementation in Lua, then there are a few tries at various shared object files that might have contained the module. Since none of the places work, require fails.
None worked, because you haven't actually built a .so containing the module.
You need to get all of the compile and link errors to clear up so that you build proAudioRt.so. Note that for that to actually contain a Lua module, it must have a C callable entry point named luaopen_proAudioRt(), with the signature
LUALIB_API int luaopen_proAudioRt(lua_State *L);
That function is expected to construct the module's table, supplying it with members containing the functions of the module. The function luaL_register() is handy for this.
The Lua users wiki has a section on binding to Lua that should be helpful as well.