Note: I have also created this as an issue for xgo here, but I thought it might be better suited as an SO question.
I am trying to cross compile my go application and one of the dependencies is the alsa.lib. I cannot get this to sucessfully compile using xgo.
Initially I tried with this command:
xgo --targets=linux/*,windows/*,darwin/* -deps=ftp://ftp.alsa-project.org/pub/lib/alsa-lib-1.1.8.tar.bz2 github.com/Lynges/susimup
And that produced this error:
/deps-build/alsa-lib-1.1.8/src/pcm/pcm_softvol.c:856: undefined reference to 'pow'
collect2: error: ld returned 1 exit status
2019/04/11 22:51:27 Failed to cross compile package: exit status 2
So then I added the depsargs to get --with-softfloat and that moved it along to a new error:
/deps-build/alsa-lib-1.1.8/src/pcm/pcm_meter.c:674: undefined reference to `dlsym'
collect2: error: ld returned 1 exit status
And that is where I am stuck now.
I have tried adding some more arguments like mentioned in the comment to this answer, but that just gave me a warning:
configure: WARNING: unrecognized options: --disable-alsamixer, --disable-xmto, --disable-nls, --disable-bat
So now I really have no idea what to do. I just want to cross compile my very simple app for arm so that it may be used on a Raspberry pi.
Related
I am writing integrations tests with the Elrond Rust testing framework.
So, I am running cargo test. But it throws this error:
note: /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x24): undefined reference to `main'
collect2: error: ld returned 1 exit status
How can I fix it, please?
Using this similar issue as a starting point, I would say that the problem is that your tests are configured as a rust binary, and so the compiler expects a main function.
Try to re-create your integration test cargo package as a library, by providing the --lib argument to the cargo new command. Not providing that argument creates a binary by default, according to the documentation on cargo new.
I am trying to build gem5 (ARM) using
scons build/ARM/gem5.opt -j 1
But I keep getting this error
/usr/bin/ld: cannot find -lgrpc++
collect2: error: ld returned 1 exit status
scons: *** [build/ARM/gem5.opt] Error 1
scons: building terminated because of errors.
I can't seem to find any information on this missing file. It's not anywhere in the computer afaik and google isn't helping much either
It looks like you need to instal the grpc package. It contains the missing file, libgrpc++.so, most likely in /usr/lib/libgrpc++.so. See also Ubuntu packages site: https://packages.ubuntu.com/source/impish/misc/grpc
I've been trying to compile the go-scrap program on windows, but I've always got the following error
C:/Program
Files/mingw-w64/x86_64-8.1.0-posix-seh-rt_v6-rev0/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe:
cannot find -lscrap_sys collect2.exe: error: ld returned 1 exit status
From what I understand, the lscrap library on windows is needed.
Does anyone know what are the correct steps to compile the go-scrap program on windows correctly?
I am trying to compile a C program which utilizes dl library to access shared object functions from a dynamic library I created.
The code is very simple and from a tutorial.
I initially compiled it on x86 platform using gcc with no issues.
I am now trying to compile it for arm platform and I am getting an error.
I tried using the following to compile it
arm-none-eabi-gcc -I/usr/arm-linux-gnueabi/include -L/usr/arm-linux-gnueabi/lib ex29.c -ldl -o ex29
I get the following error:
/usr/local/share/gcc-arm-none-eabi-toolchain/bin/../lib/gcc/arm-none-eabi/5.4.1/../../../../arm-none-eabi/lib/crt0.o: In function _start':
(.text+0xe0): undefined reference to__libc_init_array'
collect2: error: ld returned 1 exit status
I am not sure what is causing this error.
Thanks for any help.
I am trying to build CEF in Release mode but I get the following linker error:
AR(target)
/home/adminuser/temp/build/linux/Release/obj.target/libcef_dll_wrapper.a
LINK(target) /home/adminuser/temp/build/linux/Release/cefclient
/home/adminuser/temp/build/linux/Release/ldb.a(ldbJS.o): In function
LdbURLLoader::LoadURL(std::string)': ldbJS.cpp:(.text+0x34e):
undefined reference toCefURLRequest::Create(CefRefPtr,
CefRefPtr)' collect2: error: ld returned 1 exit
status make: *** [/home/adminuser/temp/build/linux/Release/cefclient]
Error 1
I don't get this problem when building the Debug version so I am not quite sure how to resolve it. I tried various #pragma directives to stop the compiler from optimizing out this method but to no avail.
* UPDATE *
When I remove the -DNDEBUG flag from CFLAGS_Release in the libcef_dll_wrapper.target.mk file it will build. I don't want to do this in the Release build without knowing what I'm doing though.
I am using gcc 4.8.2.
It turns out forcing the LD linker to reanalyze my libraries was the solution. The CEF application already had an elaborate scheme of makefiles that used the --start-group and --end-group indicators to do this, but the library I previously added was not included with them. I added it and linked my application without any more problems!