I'm trying to compile the oauth-utils
http://mir.dnsalias.com/oss/oauth/start
for Windows from Ubuntu. I have compiled it on Windows before
(a few months back), but wanted to try cross-compiling.
I got openssl build using mingw32 ok, and put
libssl.a and libcrypto.a in the right place. The linker is now
finding the libraries (yay!) but I get the following error:
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/lib/libcrypto.a(rand_win.o):rand_win.c:(.text+0xaac): undefined reference to `_CreateDCA#16'
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/lib/libcrypto.a(rand_win.o):rand_win.c:(.text+0xab9): undefined reference to `_CreateCompatibleDC#4'
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/lib/libcrypto.a(rand_win.o):rand_win.c:(.text+0xacc): undefined reference to `_GetDeviceCaps#8'
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/lib/libcrypto.a(rand_win.o):rand_win.c:(.text+0xadc): undefined reference to `_GetDeviceCaps#8'
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/lib/libcrypto.a(rand_win.o):rand_win.c:(.text+0xaf4): undefined reference to `_CreateCompatibleBitmap#12'
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/lib/libcrypto.a(rand_win.o):rand_win.c:(.text+0xb04): undefined reference to `_SelectObject#8'
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/lib/libcrypto.a(rand_win.o):rand_win.c:(.text+0xb18): undefined reference to `_GetObjectA#12'
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/lib/libcrypto.a(rand_win.o):rand_win.c:(.text+0xb81): undefined reference to `_BitBlt#36'
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/lib/libcrypto.a(rand_win.o):rand_win.c:(.text+0xb8c): undefined reference to `_GetBitmapBits#12'
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/lib/libcrypto.a(rand_win.o):rand_win.c:(.text+0xbe5): undefined reference to `_SelectObject#8'
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/lib/libcrypto.a(rand_win.o):rand_win.c:(.text+0xbec): undefined reference to `_DeleteObject#4'
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/lib/libcrypto.a(rand_win.o):rand_win.c:(.text+0xbf6): undefined reference to `_DeleteDC#4'
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/lib/libcrypto.a(rand_win.o):rand_win.c:(.text+0xc00): undefined reference to `_DeleteDC#4'
Any ideas what could be causing this?
Thanks.
Link with Gdi32.lib
Which version of OpenSSL are you trying to compile?
In general, I have found version 1.0 and newer with MinGW-w64 to work great.
See for example the OpenSSL cross-compilation for Windows tutorial.
It seems that if one remove everything between
static void readscreen(void)
{
#if !defined(OPENSSL_SYS_WINCE) && !defined(OPENSSL_SYS_WIN32_CYGWIN)
and
#endif /* !OPENSSL_SYS_WINCE */
}
in rand_win.c, that building works. I'm not 100% sure how safe removing this is.
Are you adding -mwindows to your link command?
Related
I have problem with building my C++ project using CLion, MINGw64.
So this is the problem I cannot handle with ._.
Everything works on Linux but on Win10 I have this log:
libBiblioteka.a(Rent.cpp.obj): In function `boost::uuids::detail::random_provider_base::random_provider_base()':
C:/msys64/mingw64/include/boost/uuid/detail/random_provider_bcrypt.ipp:40: undefined reference to `BCryptOpenAlgorithmProvider'
libBiblioteka.a(Rent.cpp.obj): In function `boost::uuids::detail::random_provider_base::get_random_bytes(void*, unsigned long long)':
C:/msys64/mingw64/include/boost/uuid/detail/random_provider_bcrypt.ipp:76: undefined reference to `BCryptGenRandom'
libBiblioteka.a(Rent.cpp.obj): In function `boost::uuids::detail::random_provider_base::destroy()':
C:/msys64/mingw64/include/boost/uuid/detail/random_provider_bcrypt.ipp:93: undefined reference to `BCryptCloseAlgorithmProvider'
collect2.exe: error: ld returned 1 exit status
I have read these references are unavaiable on win10. But there is an question:
Is there any way to workaround this?
Those are not defined in libcrypt but in libbcrypt.
Did you have the same typo in your linker flags (you should have -lbcrypt)?
I am trying to link ICU 57 to my binary file. That does not work even thought (I think at least) I am linking the static lib files.
Here is a blunt example:
gcc -static /usr/lib/libicui18n.a /usr/lib/libicuuc.a /usr/lib/libicudata.a /usr/lib/libicule.a /usr/lib/libiculx.a /usr/lib/libicutu.a /usr/lib/libicuuc.a /usr/lib/libicuio.a obj/ex.o obj/msg.o -o bin/ex
This is the error message that I get:
src/msg.c:5: undefined reference to `u_fopen_57'
src/msg.c:9: undefined reference to `u_fgetfile_57'
src/msg.c:10: undefined reference to `u_fgetfile_57'
src/msg.c:11: undefined reference to `u_frewind_57'
src/msg.c:18: undefined reference to `u_fgetc_57'
src/msg.c:17: undefined reference to `u_feof_57'
src/msg.c:25: undefined reference to `u_fclose_57'
Linking the dynamic libs works fine though.
If you can, I'd recommend using pkg-config as I recommended here,
specifically with pkg-config --static … as explained here
I try to use a library compiled with gcc called matlisp based on fortran code. After specifyng the f77 compiler, I could performed the autoreconf, configure and make command to obtain the file libmatlisp.so.
But when I try to use it i get a:
Error opening shared object ".../libmatlisp.so":
/usr/lib/libf2c.so.2: undefined symbol: MAIN__.
And when i perform the command ld libmatlisp.so i get:
...
libmatlisp.so: undefined reference to `idamax_'
libmatlisp.so: undefined reference to `dger_'
/usr/lib/libf2c.so.2: undefined reference to `MAIN__'
libmatlisp.so: undefined reference to `zscal_'
libmatlisp.so: undefined reference to `dscal_'
....
Is there a way to improve the situation?
I already try this solution but it does not work.
I also try to change the compiler to gfortran but i get some some run time error messages mentionning missing libraries that are part of libf2c.
Ok. I move to a more recent source of matlisp 2012 instead of 2003, and it run properly in my environment now.
I want to install a latest Mono version on my CentOS (i686). As there is no ready to use binary distribution I tried to pull the latest Mono Source 3.2.3 from here. After pulling the source, I extracted it, change directory to it and tried below sequence of commands -
[root#localhost mono-3.2.3]# ./configure
No problems reported
[root#localhost mono-3.2.3]# make
make[3]: Entering directory `/usr/local/src/mono-3.2.3/mono/metadata'
CCLD pedump
./.libs/libmonoruntime.a(libmonoruntime_la-assembly.o): In function `InterlockedDecrement':
/usr/local/src/mono-3.2.3/mono/metadata/../../mono/utils/atomic.h:66: undefined reference to `__sync_add_and_fetch_4'
./.libs/libmonoruntime.a(libmonoruntime_la-assembly.o): In function `InterlockedIncrement':
/usr/local/src/mono-3.2.3/mono/metadata/../../mono/utils/atomic.h:61: undefined reference to `__sync_add_and_fetch_4'
./.libs/libmonoruntime.a(libmonoruntime_la-cominterop.o): In function `InterlockedDecrement':
/usr/local/src/mono-3.2.3/mono/metadata/../../mono/utils/atomic.h:66: undefined reference to `__sync_add_and_fetch_4'
./.libs/libmonoruntime.a(libmonoruntime_la-cominterop.o): In function `InterlockedIncrement':
/usr/local/src/mono-3.2.3/mono/metadata/../../mono/utils/atomic.h:61: undefined reference to `__sync_add_and_fetch_4'
./.libs/libmonoruntime.a(libmonoruntime_la-cominterop.o): In function `InterlockedDecrement':
/usr/local/src/mono-3.2.3/mono/metadata/../../mono/utils/atomic.h:66: undefined reference to `__sync_add_and_fetch_4'
./.libs/libmonoruntime.a(libmonoruntime_la-image.o):/usr/local/src/mono-3.2.3/mono/metadata/../../mono/utils/atomic.h:61: more undefined references to `__sync_add_and_fetch_4' follow
./.libs/libmonoruntime.a(libmonoruntime_la-marshal.o): In function `InterlockedCompareExchangePointer':
/usr/local/src/mono-3.2.3/mono/metadata/../../mono/utils/atomic.h:56: undefined reference to `__sync_val_compare_and_swap_4'
./.libs/libmonoruntime.a(libmonoruntime_la-marshal.o): In function `InterlockedExchangePointer':
While trying to resolve this I found this,this and this. I tried to implement the solution mentioned there but had no luck.
Has anybody faced this?
Regards,
Omky
I added two compiler switches in make file.
CPPFLAGS = -m32 -march=i686
This worked for me.
On Blackberry 10 using C++ I am getting the following link errors
undefined reference to __sync_fetch_and_add_4
undefined reference to __sync_fetch_and_sub_4
undefined reference to__sync_bool_compare_and_swap_4
Anyone know which library I am missing. The Momentics IDE is using GCC 4.6.3
Thanks
Wild stab in the dark but is it the 'math' library which can be added by including LIBS += -lm in your .pro file.