[MingW - Boost::asio + OpenSSL] Undefined reference BUT find it with "nm"

Started by
10 comments, last by rXpSwiss 6 years, 5 months ago

Hello,

I am not really sure where I should post that since it is linked to a network library and I want to make my connection secured I will put my problem here.

I am trying to make SSL work with boost ASIO. I am on windows and using MingW 6.3.

I built OpenSSL 1.1, 1.0 and 0.8 with MingW when I try to link them to the project I always get different errors (depending on what is missing). Right now I am trying to make work OpenSSL 1.1.0g but I have those error even though I give manually the path to the libs with CMAKE.

This is the errors if I build my projct with OpenSSL 1.1.0g :


"C:\Program Files\JetBrains\CLion 2017.2.3\bin\cmake\bin\cmake.exe" --build C:\Users\myuser\Documents\MagesBattleAuthServerCPP\AuthServer\cmake-build-debug --target AuthServer -- -j 2
"C:\Program Files\JetBrains\CLion 2017.2.3\bin\cmake\bin\cmake.exe" -HC:\Users\myuser\Documents\MagesBattleAuthServerCPP\AuthServer -BC:\Users\myuser\Documents\MagesBattleAuthServerCPP\AuthServer\cmake-build-debug --check-build-system CMakeFiles\Makefile.cmake 0
C:/MinGW/bin/mingw32-make.exe -f CMakeFiles\Makefile2 AuthServer
mingw32-make.exe[1]: Entering directory 'C:/Users/myuser/Documents/MagesBattleAuthServerCPP/AuthServer/cmake-build-debug'
"C:\Program Files\JetBrains\CLion 2017.2.3\bin\cmake\bin\cmake.exe" -HC:\Users\myuser\Documents\MagesBattleAuthServerCPP\AuthServer -BC:\Users\myuser\Documents\MagesBattleAuthServerCPP\AuthServer\cmake-build-debug --check-build-system CMakeFiles\Makefile.cmake 0
"C:\Program Files\JetBrains\CLion 2017.2.3\bin\cmake\bin\cmake.exe" -E cmake_progress_start C:\Users\myuser\Documents\MagesBattleAuthServerCPP\AuthServer\cmake-build-debug\CMakeFiles 6
C:/MinGW/bin/mingw32-make.exe -f CMakeFiles\Makefile2 CMakeFiles/AuthServer.dir/all
mingw32-make.exe[2]: Entering directory 'C:/Users/myuser/Documents/MagesBattleAuthServerCPP/AuthServer/cmake-build-debug'
C:/MinGW/bin/mingw32-make.exe -f CMakeFiles\AuthServer.dir\build.make CMakeFiles/AuthServer.dir/depend
mingw32-make.exe[3]: Entering directory 'C:/Users/myuser/Documents/MagesBattleAuthServerCPP/AuthServer/cmake-build-debug'
"C:\Program Files\JetBrains\CLion 2017.2.3\bin\cmake\bin\cmake.exe" -E cmake_depends "MinGW Makefiles" C:\Users\myuser\Documents\MagesBattleAuthServerCPP\AuthServer C:\Users\myuser\Documents\MagesBattleAuthServerCPP\AuthServer C:\Users\myuser\Documents\MagesBattleAuthServerCPP\AuthServer\cmake-build-debug C:\Users\myuser\Documents\MagesBattleAuthServerCPP\AuthServer\cmake-build-debug C:\Users\myuser\Documents\MagesBattleAuthServerCPP\AuthServer\cmake-build-debug\CMakeFiles\AuthServer.dir\DependInfo.cmake --color=
mingw32-make.exe[3]: Leaving directory 'C:/Users/myuser/Documents/MagesBattleAuthServerCPP/AuthServer/cmake-build-debug'
C:/MinGW/bin/mingw32-make.exe -f CMakeFiles\AuthServer.dir\build.make CMakeFiles/AuthServer.dir/build
mingw32-make.exe[3]: Entering directory 'C:/Users/myuser/Documents/MagesBattleAuthServerCPP/AuthServer/cmake-build-debug'
[ 16%] Linking CXX executable bin\Windows\AuthServer.exe
"C:\Program Files\JetBrains\CLion 2017.2.3\bin\cmake\bin\cmake.exe" -E cmake_link_script CMakeFiles\AuthServer.dir\link.txt --verbose=1
"C:\Program Files\JetBrains\CLion 2017.2.3\bin\cmake\bin\cmake.exe" -E remove -f CMakeFiles\AuthServer.dir/objects.a
C:\MinGW\bin\ar.exe cr CMakeFiles\AuthServer.dir/objects.a @CMakeFiles\AuthServer.dir\objects1.rsp
C:\MinGW\bin\g++.exe -g   -Wl,--whole-archive CMakeFiles\AuthServer.dir/objects.a -Wl,--no-whole-archive  -o bin\Windows\AuthServer.exe -Wl,--out-implib,lib\libAuthServer.dll.a -Wl,--major-image-version,0,--minor-image-version,0 @CMakeFiles\AuthServer.dir\linklibs.rsp
CMakeFiles\AuthServer.dir/objects.a(main.cpp.obj): In function `ZN5boost4asio3ssl6detail17openssl_init_base7do_initD1Ev':
c:/users/myuser/documents/magesbattleauthservercpp/include/boost/asio/ssl/detail/impl/openssl_init.ipp:89: undefined reference to `CONF_modules_unload'
CMakeFiles\AuthServer.dir/objects.a(main.cpp.obj): In function `ZNK5boost4asio5error6detail12ssl_category7messageB5cxx11Ei':
c:/users/myuser/documents/magesbattleauthservercpp/include/boost/asio/ssl/impl/error.ipp:39: undefined reference to `ERR_reason_error_string'
collect2.exe: error: ld returned 1 exit status
CMakeFiles\AuthServer.dir\build.make:217: recipe for target 'bin/Windows/AuthServer.exe' failed
mingw32-make.exe[3]: Leaving directory 'C:/Users/myuser/Documents/MagesBattleAuthServerCPP/AuthServer/cmake-build-debug'
CMakeFiles\Makefile2:69: recipe for target 'CMakeFiles/AuthServer.dir/all' failed
mingw32-make.exe[2]: Leaving directory 'C:/Users/myuser/Documents/MagesBattleAuthServerCPP/AuthServer/cmake-build-debug'
mingw32-make.exe[3]: *** [bin/Windows/AuthServer.exe] Error 1
mingw32-make.exe[2]: *** [CMakeFiles/AuthServer.dir/all] Error 2
CMakeFiles\Makefile2:81: recipe for target 'CMakeFiles/AuthServer.dir/rule' failed
mingw32-make.exe[1]: Leaving directory 'C:/Users/myuser/Documents/MagesBattleAuthServerCPP/AuthServer/cmake-build-debug'
Makefile:120: recipe for target 'AuthServer' failed
mingw32-make.exe[1]: *** [CMakeFiles/AuthServer.dir/rule] Error 2
mingw32-make.exe: *** [AuthServer] Error 2

 

My make :


cmake_minimum_required(VERSION 3.8)
project(AuthServer)

#----------------- MACROS -----------------------------
#FIND THE CORRECT VERSION OF WINNT
macro(get_WIN32_WINNT version)
    if (CMAKE_SYSTEM_VERSION)
        set(ver ${CMAKE_SYSTEM_VERSION})
        string(REGEX MATCH "^([0-9]+).([0-9])" ver ${ver})
        string(REGEX MATCH "^([0-9]+)" verMajor ${ver})
        # Check for Windows 10, b/c we'll need to convert to hex 'A'.
        if ("${verMajor}" MATCHES "10")
            set(verMajor "A")
            string(REGEX REPLACE "^([0-9]+)" ${verMajor} ver ${ver})
        endif ("${verMajor}" MATCHES "10")
        # Remove all remaining '.' characters.
        string(REPLACE "." "" ver ${ver})
        # Prepend each digit with a zero.
        string(REGEX REPLACE "([0-9A-Z])" "0\\1" ver ${ver})
        set(${version} "0x${ver}")
    endif(CMAKE_SYSTEM_VERSION)
endmacro(get_WIN32_WINNT)
#----------------- MACROS -----------------------------

set(CMAKE_VERBOSE_MAKEFILE ON)

set(CMAKE_CXX_STANDARD 14)

SET(CMAKE_FIND_LIBRARY_PREFIXES "lib")

add_definitions(-DBOOST_NETWORK_ENABLE_HTTPS)

set(SOURCE_FILES
        AuthServer/Client.cpp
        AuthServer/Client.h
        AuthServer/main.cpp
        AuthServer/NetworkManager.cpp
        AuthServer/NetworkManager.h
        AuthServer/Message.cpp
        AuthServer/Message.h
        AuthServer/JsonSerializable.h
        AuthServer/JsonDeserializerFactory.cpp
        AuthServer/JsonDeserializerFactory.h)

if (WIN32) #windows

    #set the correct WINNET version
    get_WIN32_WINNT(ver)
    add_definitions(-D_WIN32_WINNT=${ver})

    set(CMAKE_CXX_STANDARD_LIBRARIES "${CMAKE_CXX_STANDARD_LIBRARIES} -lws2_32 -lwsock32 -lmswsock")

    #set the correct lib build type .a because we are using mingw
    if(${CMAKE_BUILD_TYPE} MATCHES "debug")
        SET(CMAKE_FIND_LIBRARY_SUFFIXES "-mgw63-mt-d-1_65_1.a" ".a")
    ELSEIF(${CMAKE_BUILD_TYPE} MATCHES "release")
        SET(CMAKE_FIND_LIBRARY_SUFFIXES "-mgw63-mt-1_65_1.a" ".a")
    ENDIF()

    #find all the libs
    find_library(BOOST_LIBRARY_atomic
            NAMES boost_atomic
            PATHS ${CMAKE_SOURCE_DIR}/../Lib/win/x64/${CMAKE_BUILD_TYPE}
            NO_DEFAULT_PATH)

    find_library(BOOST_LIBRARY_chrono
            NAMES boost_chrono
            PATHS ${CMAKE_SOURCE_DIR}/../Lib/win/x64/${CMAKE_BUILD_TYPE}
            NO_DEFAULT_PATH)

    find_library(BOOST_LIBRARY_date_time
            NAMES boost_date_time
            PATHS ${CMAKE_SOURCE_DIR}/../Lib/win/x64/${CMAKE_BUILD_TYPE}
            NO_DEFAULT_PATH)

    find_library(BOOST_LIBRARY_regex
            NAMES boost_regex
            PATHS ${CMAKE_SOURCE_DIR}/../Lib/win/x64/${CMAKE_BUILD_TYPE}
            NO_DEFAULT_PATH)

    find_library(BOOST_LIBRARY_thread
            NAMES boost_thread
            PATHS ${CMAKE_SOURCE_DIR}/../Lib/win/x64/${CMAKE_BUILD_TYPE}
            NO_DEFAULT_PATH)

    find_library(BOOST_LIBRARY_system
            NAMES boost_system
            PATHS ${CMAKE_SOURCE_DIR}/../Lib/win/x64/${CMAKE_BUILD_TYPE}
            NO_DEFAULT_PATH)

    find_library(BOOST_LIBRARY_iostreams
            NAMES boost_iostreams
            PATHS ${CMAKE_SOURCE_DIR}/../Lib/win/x64/${CMAKE_BUILD_TYPE}
            NO_DEFAULT_PATH)

    find_library(BOOST_LIBRARY_zlib
            NAMES boost_zlib
            PATHS ${CMAKE_SOURCE_DIR}/../Lib/win/x64/${CMAKE_BUILD_TYPE}
            NO_DEFAULT_PATH)

    find_library(LIBRARY_ossl_ssl
            NAMES ssl
            PATHS ${CMAKE_SOURCE_DIR}/../Lib/win/x64/${CMAKE_BUILD_TYPE}
            NO_DEFAULT_PATH)

    find_library(LIBRARY_ossl_crypto
            NAMES crypto
            PATHS ${CMAKE_SOURCE_DIR}/../Lib/win/x64/${CMAKE_BUILD_TYPE}
            NO_DEFAULT_PATH)

    add_executable(AuthServer ${SOURCE_FILES})
ELSEif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") #osx

    SET(CMAKE_OSX_ARCHITECTURES x86_64)
    SET(CMAKE_FIND_LIBRARY_SUFFIXES ".a" ".dylib")

    find_library(BOOST_LIBRARY_atomic
            NAMES boost_atomic
            PATHS ${CMAKE_SOURCE_DIR}/../Lib/osx/x64/${CMAKE_BUILD_TYPE}
            NO_DEFAULT_PATH)

    find_library(BOOST_LIBRARY_chrono
            NAMES boost_chrono
            PATHS ${CMAKE_SOURCE_DIR}/../Lib/osx/x64/${CMAKE_BUILD_TYPE}
            NO_DEFAULT_PATH)

    find_library(BOOST_LIBRARY_date_time
            NAMES boost_date_time
            PATHS ${CMAKE_SOURCE_DIR}/../Lib/osx/x64/${CMAKE_BUILD_TYPE}
            NO_DEFAULT_PATH)

    find_library(BOOST_LIBRARY_regex
            NAMES boost_regex
            PATHS ${CMAKE_SOURCE_DIR}/../Lib/osx/x64/${CMAKE_BUILD_TYPE}
            NO_DEFAULT_PATH)

    find_library(BOOST_LIBRARY_thread
            NAMES boost_thread
            PATHS ${CMAKE_SOURCE_DIR}/../Lib/osx/x64/${CMAKE_BUILD_TYPE}
            NO_DEFAULT_PATH)

    find_library(BOOST_LIBRARY_system
            NAMES boost_system
            PATHS ${CMAKE_SOURCE_DIR}/../Lib/osx/x64/${CMAKE_BUILD_TYPE}
            NO_DEFAULT_PATH)

    find_library(BOOST_LIBRARY_iostreams
            NAMES boost_iostreams
            PATHS ${CMAKE_SOURCE_DIR}/../Lib/osx/x64/${CMAKE_BUILD_TYPE}
            NO_DEFAULT_PATH)

    find_library(BOOST_LIBRARY_zlib
            NAMES boost_zlib
            PATHS ${CMAKE_SOURCE_DIR}/../Lib/osx/x64/${CMAKE_BUILD_TYPE}
            NO_DEFAULT_PATH)

    add_executable(AuthServer ${SOURCE_FILES})
endif()

target_include_directories(AuthServer PUBLIC ${CMAKE_SOURCE_DIR}/../Include)


target_link_libraries(AuthServer
        PUBLIC
        ${BOOST_LIBRARY_chrono}
        ${BOOST_LIBRARY_atomic}
        ${BOOST_LIBRARY_date_time}
        ${BOOST_LIBRARY_regex}
        ${BOOST_LIBRARY_thread}
        ${BOOST_LIBRARY_system}
        ${BOOST_LIBRARY_iostreams}
        ${BOOST_LIBRARY_zlib}
        ${LIBRARY_ossl_ssl}
        ${LIBRARY_ossl_crypto}
        )


set_target_properties(AuthServer
        PROPERTIES
        ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
        LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
        RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin/${CMAKE_SYSTEM_NAME}"
        )

 

Command to build OpenSSL (mingw msys2) :


$ ./Configure mingw64 no-shared no-asm --prefix=/C/OpenSSL-x64
$ make && make install

 

linklibs.rsp :


C:/Users/myuser/Documents/MagesBattleAuthServerCPP/Lib/win/x64/debug/libboost_chrono-mgw63-mt-d-1_65_1.a
 C:/Users/myuser/Documents/MagesBattleAuthServerCPP/Lib/win/x64/debug/libboost_atomic-mgw63-mt-d-1_65_1.a
 C:/Users/myuser/Documents/MagesBattleAuthServerCPP/Lib/win/x64/debug/libboost_date_time-mgw63-mt-d-1_65_1.a
 C:/Users/myuser/Documents/MagesBattleAuthServerCPP/Lib/win/x64/debug/libboost_regex-mgw63-mt-d-1_65_1.a
 C:/Users/myuser/Documents/MagesBattleAuthServerCPP/Lib/win/x64/debug/libboost_thread-mgw63-mt-d-1_65_1.a
 C:/Users/myuser/Documents/MagesBattleAuthServerCPP/Lib/win/x64/debug/libboost_system-mgw63-mt-d-1_65_1.a
 C:/Users/myuser/Documents/MagesBattleAuthServerCPP/Lib/win/x64/debug/libboost_iostreams-mgw63-mt-d-1_65_1.a
 C:/Users/myuser/Documents/MagesBattleAuthServerCPP/Lib/win/x64/debug/libboost_zlib-mgw63-mt-d-1_65_1.a
 C:/Users/myuser/Documents/MagesBattleAuthServerCPP/Lib/win/x64/debug/libssl.a
 C:/Users/myuser/Documents/MagesBattleAuthServerCPP/Lib/win/x64/debug/libcrypto.a
 -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid
 -lcomdlg32 -ladvapi32 -lws2_32 -lwsock32 -lmswsock -ldl -lpthread 

 

nm of crypto :


myuser@LHCFB203 MINGW64 ~
$ nm /C/Users/myuser/Documents/MagesBattleAuthServerCPP/Lib/win/x64/debug/libcrypto.a | grep 'CONF_modules_unload'
00000000000005c0 T CONF_modules_unload

myuser@LHCFB203 MINGW64 ~
$ nm /C/Users/myuser/Documents/MagesBattleAuthServerCPP/Lib/win/x64/debug/libcrypto.a | grep 'ERR_reason_error_string'
0000000000004de0 T ERR_reason_error_string

 

I'm really lost here. What did I do wrong ?

rXp

Advertisement

Not sure if this is the reason why but you look for the 64 bit versions of the libraries but it seems that you use mingw 32 bits...

1 hour ago, _Silence_ said:

Not sure if this is the reason why but you look for the 64 bit versions of the libraries but it seems that you use mingw 32 bits...

I thought even though mingw 32bits is a 32bit software it can compile 32 and 64 bits applications.
And everything is working, only when trying to include OpenSSL that I get the error.

The way you're building seems weird to me. You compile object files, then create a static library (archive,) then try to link everything in that static archive, plus some things in another archive (but not everything) into a dynamic library.

The UNIX linker is a pretty sorry set of arcane rules that were needed to build old versions of old tools on machines with < 64 kB of RAM. And we've inherited them. One of the problems is that a library doesn't necessarily actually resolve all the symbols in it! You must build an "index" for the library with "ranlib" to make that happen. Also, ordering may be important.


C:\MinGW\bin\g++.exe -g   -Wl,--whole-archive CMakeFiles\AuthServer.dir/objects.a -Wl,--no-whole-archive  -o bin\Windows\AuthServer.exe -Wl,--out-implib,lib\libAuthServer.dll.a -Wl,--major-image-version,0,--minor-image-version,0 @CMakeFiles\AuthServer.dir\linklibs.rsp

You also don't show the contents of linklibs.rsp, so it's kind of impossible to see what you're trying to include other than the original .a file.


-o bin\Windows\AuthServer.exe -Wl,--out-implib,lib\libAuthServer.dll.a

Why are you building a link library for the EXE?

Finally -- I've never made friends with mingw. It's much easier to use the Microsoft compilers when building for Windows. Have you tried that?

 

enum Bool { True, False, FileNotFound };
On 11/12/2017 at 4:11 AM, hplus0603 said:

The way you're building seems weird to me. You compile object files, then create a static library (archive,) then try to link everything in that static archive, plus some things in another archive (but not everything) into a dynamic library.

The UNIX linker is a pretty sorry set of arcane rules that were needed to build old versions of old tools on machines with < 64 kB of RAM. And we've inherited them. One of the problems is that a library doesn't necessarily actually resolve all the symbols in it! You must build an "index" for the library with "ranlib" to make that happen. Also, ordering may be important.



C:\MinGW\bin\g++.exe -g   -Wl,--whole-archive CMakeFiles\AuthServer.dir/objects.a -Wl,--no-whole-archive  -o bin\Windows\AuthServer.exe -Wl,--out-implib,lib\libAuthServer.dll.a -Wl,--major-image-version,0,--minor-image-version,0 @CMakeFiles\AuthServer.dir\linklibs.rsp

You also don't show the contents of linklibs.rsp, so it's kind of impossible to see what you're trying to include other than the original .a file.



-o bin\Windows\AuthServer.exe -Wl,--out-implib,lib\libAuthServer.dll.a

Why are you building a link library for the EXE?

Finally -- I've never made friends with mingw. It's much easier to use the Microsoft compilers when building for Windows. Have you tried that?

 

For now I would love to make it work with mingw but if that won't be possible I will use the Microsoft compilers. I would like to be able to use mingw with Clion for this project, but it made my life difficult for sure. 

Though I showed the linklibs.rsp just before the nm of crypto.

Your msys file/paths use UNIX-style paths, but your rsp file uses Windows-style paths. Is this a problem? (I wouldn't know -- I use UNIX tools on UNIX, and Windows tools on Windows...)

This one's even more exciting!


CMakeFiles\AuthServer.dir/objects.a

Do mixed path separators work in mingw? Maybe? You should probably ask in a build-specific sub-section (or on the mingw forums) because I don't think anyone who has used this particular build environment.

Also, if you are on Windows 10, go to "add and remove windows features" and add the Windows 10 subsystem for linux (or whatever it is called) and then start "bash" inside a command window. Ta-da! Instant Ubuntu-like command line. You have apt for installing packages, and configure / make works great as if you were on a Ubuntu system. The draw-back is that the programs built aren't windows tools, they're Ubuntu programs, but they run fine in the Ubuntu bash shell on Windows.

enum Bool { True, False, FileNotFound };
4 hours ago, hplus0603 said:

Your msys file/paths use UNIX-style paths, but your rsp file uses Windows-style paths. Is this a problem? (I wouldn't know -- I use UNIX tools on UNIX, and Windows tools on Windows...)

This one's even more exciting!



CMakeFiles\AuthServer.dir/objects.a

Do mixed path separators work in mingw? Maybe? You should probably ask in a build-specific sub-section (or on the mingw forums) because I don't think anyone who has used this particular build environment.

Also, if you are on Windows 10, go to "add and remove windows features" and add the Windows 10 subsystem for linux (or whatever it is called) and then start "bash" inside a command window. Ta-da! Instant Ubuntu-like command line. You have apt for installing packages, and configure / make works great as if you were on a Ubuntu system. The draw-back is that the programs built aren't windows tools, they're Ubuntu programs, but they run fine in the Ubuntu bash shell on Windows.

A lot of things that CMAKE does on windows (with MingW) is quite weird I agree.
My problem is not that I hate windows and don't want to use microsoft compilers, the problem is that I use Clion to code the project on Mac/Linux/Windows but it does not support Microsoft Debugger.
So I can work with mingw, cigwin, the ubuntu shell on windows 10 but the official Microsoft debugger are not supported.
I could have a VS project on windows and cmake for mac and linux but I would like to have everything on my cmake project. I can build and compile for windows with the cmake project but that would mean no debugging on windows from Clion.

On 08/11/2017 at 12:42 PM, rXpSwiss said:

CMakeFiles\AuthServer.dir/objects.a(main.cpp.obj): In function `ZN5boost4asio3ssl6detail17openssl_init_base7do_initD1Ev': c:/users/myuser/documents/magesbattleauthservercpp/include/boost/asio/ssl/detail/impl/openssl_init.ipp:89: undefined reference to `CONF_modules_unload' CMakeFiles\AuthServer.dir/objects.a(main.cpp.obj): In function `ZNK5boost4asio5error6detail12ssl_category7messageB5cxx11Ei': c:/users/myuser/documents/magesbattleauthservercpp/include/boost/asio/ssl/impl/error.ipp:39: undefined reference to `ERR_reason_error_string' collect2.exe: error: ld returned 1 exit status

I can remember a bit having such kind of issues. Mainly when mixing C/C++ compiling and linking and different versions of compilers (this was threw using Linux and Solaris, not mingw however).

Sometimes the linker uses mangling and is looking for a C symbol uses this mangling and thus cannot find it. Sometimes it can do the opposite. I guess that using some #ifdef c_plus_plus and extern C resolved much of this kind of things.

You might also try to create a very little and simple test-case, even without any makefiles (just type in the g++ commands and test the various options). You might also try with the shared object instead of the archive of openssl.

One last thing that comes to my mind (and I don't know if this is yet the case in mingw), is that gcc 5 changed the ABI, so files generated with gcc 5 are no more compatibles with files generated with previous versions of gcc.

These are just thrown things... Hopefully one could help you :-|

4 minutes ago, _Silence_ said:

I can remember a bit having such kind of issues. Mainly when mixing C/C++ compiling and linking and different versions of compilers (this was threw using Linux and Solaris, not mingw however).

Sometimes the linker uses mangling and is looking for a C symbol uses this mangling and thus cannot find it. Sometimes it can do the opposite. I guess that using some #ifdef c_plus_plus and extern C resolved much of this kind of things.

You might also try to create a very little and simple test-case, even without any makefiles (just type in the g++ commands and test the various options). You might also try with the shared object instead of the archive of openssl.

One last thing that comes to my mind (and I don't know if this is yet the case in mingw), is that gcc 5 changed the ABI, so files generated with gcc 5 are no more compatibles with files generated with previous versions of gcc.

These are just thrown things... Hopefully one could help you :-|

I will look into it :) As for the ABI stuff it should not be a problem since I built everything from source myself with mingw. Took time but I wanted to be sure it was compatible.

cmake can generate visual studio projects, unless the cmakefiles are explicitly made to be linux-only.

 

enum Bool { True, False, FileNotFound };

This topic is closed to new replies.

Advertisement