Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linker error 2019 when using shogun on windows #4219

Closed
friente opened this issue Mar 27, 2018 · 24 comments
Closed

Linker error 2019 when using shogun on windows #4219

friente opened this issue Mar 27, 2018 · 24 comments
Labels

Comments

@friente
Copy link

friente commented Mar 27, 2018

Hello,

I'm trying to use shogun on windows. I built the library with msvc 2015 64bit. In the following there is the cmake report:

Could NOT find CCache (missing: CCACHE CCACHE_VERSION) 
Using system's malloc
Could NOT find GDB (missing: GDB_COMMAND GDB_VERSION) 
Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE) (Required is at least version "1.8.6")
dir='C:/Users/myUser/Downloads/shogun-shogun_6.1.3/shogun-shogun_6.1.3/src'
dir='C:/Users/myUser/Downloads/shogun-shogun_6.1.3/shogun-shogun_6.1.3/build/src'
Could NOT find CxaDemangle (missing: HAVE_CXA_DEMANGLE) 
Could NOT find CxaDemangle (missing: HAVE_CXA_DEMANGLE) 
Could NOT find Eigen3 (missing: EIGEN_INCLUDE_DIR) (Required is at least version "3.1.2")
Could NOT find OPENCL (missing: OPENCL_LIBRARY OPENCL_INCLUDE_DIR) 
Could NOT find ViennaCL (missing: VIENNACL_INCLUDE_DIR VIENNACL_ENCODED_VERSION OpenCL_INCLUDE_DIRS OpenCL_LIBRARIES) (Required is at least version "1.5.0")
Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE) 
Could NOT find TFLogger (missing: TFLogger_DIR)
A library with BLAS API not found. Please specify library location.
LAPACK requires BLAS
Could NOT find GLPK (missing: GLPK_LIBRARY GLPK_INCLUDE_DIR GLPK_PROPER_VERSION_FOUND) 
Could NOT find CPLEX (missing: CPLEX_LIBRARY CPLEX_INCLUDE_DIR) 
Could NOT find MOSEK (missing: MOSEK_DIR MOSEK_INCLUDE_DIR MOSEK_LIBRARY MOSEK_LIBRARIES) 
Could NOT find Protobuf (missing: Protobuf_LIBRARIES Protobuf_INCLUDE_DIR) 
Could NOT find JSON (missing: JSON_INCLUDE_DIR JSON_LIBRARY) (Required is at least version "0.11")
Could NOT find LibXml2 (missing: LIBXML2_LIBRARY LIBXML2_INCLUDE_DIR) 
Could NOT find CURL (missing: CURL_LIBRARY CURL_INCLUDE_DIR) 
Could NOT find ZLIB (missing: ZLIB_LIBRARY ZLIB_INCLUDE_DIR) 
Could NOT find BZip2 (missing: BZIP2_LIBRARIES BZIP2_INCLUDE_DIR) 
Could NOT find LibLZMA (missing: LIBLZMA_INCLUDE_DIR LIBLZMA_LIBRARY LIBLZMA_HAS_AUTO_DECODER LIBLZMA_HAS_EASY_ENCODER LIBLZMA_HAS_LZMA_PRESET) 
Could NOT find SNAPPY (missing: SNAPPY_LIBRARIES SNAPPY_INCLUDE_DIR) 
Lzo includes and libraries NOT found. 
Could NOT find NLOPT (missing: NLOPT_LIBRARY NLOPT_INCLUDE_DIR) 
Could NOT find LPSOLVE (missing: LPSOLVE_LIBRARIES LPSOLVE_INCLUDE_DIR) 
Could NOT find ColPack (missing: COLPACK_LIBRARIES COLPACK_LIBRARY_DIR COLPACK_INCLUDE_DIR) 
Could NOT find ARPREC (missing: ARPREC_LIBRARIES ARPREC_INCLUDE_DIR) 
Linker: Default system linker
Could NOT find Ctags (missing: CTAGS_EXECUTABLE) 
Failed to locate sphinx-build executable (missing: SPHINX_EXECUTABLE) 
Failed to locate pandoc executable (missing: PANDOC_EXECUTABLE) 
===================================================================================================================
Summary of Configuration Variables
The following OPTIONAL packages have been found:

 * OpenMP
 * Threads

-- The following REQUIRED packages have been found:

 * PythonInterp

-- The following OPTIONAL packages have not been found:

 * CCache
 * GDB
 * Doxygen (required version >= 1.8.6)
 * CxaDemangle
 * Eigen3 (required version >= 3.1.2)
 * ViennaCL (required version >= 1.5.0)
 * rxcpp
 * TFLogger (required version >= 0.1.0)
 * BLAS
 * GLPK
 * CPLEX
 * ARPACK
 * Mosek
 * Protobuf
 * JSON (required version >= 0.11)
 * LibXml2
 * CURL
 * ZLIB
 * BZip2
 * LibLZMA
 * SNAPPY
 * LZO
 * NLopt
 * LpSolve
 * ColPack
 * ARPREC
 * Ctags
 * Sphinx
 * Pandoc

===================================================================================================================
Integrations
  OpenCV Integration is OFF 	 enable with -DOpenCV=ON
===================================================================================================================
Interfaces
  Python is OFF 		 enable with -DINTERFACE_PYTHON=ON
  Octave is OFF 		 enable with -DINTERFACE_OCTAVE=ON
  Java is OFF 		 enable with -DINTERFACE_JAVA=ON
  Perl is OFF 		 enable with -DINTERFACE_PERL=ON
  Ruby is OFF 		 enable with -DINTERFACE_RUBY=ON
  C# is OFF 			 enable with -DINTERFACE_CSHARP=ON
  R is OFF 			 enable with -DINTERFACE_R=ON
  Lua is OFF 		 enable with -DINTERFACE_LUA=ON
  Scala is OFF 		 enable with -DINTERFACE_SCALA=ON
===================================================================================================================
To compile shogun type
  make

To install shogun to C:/Users/myUser/Desktop/shogun type
  make install

or to install to a custom directory
  make install DESTDIR=/my/special/path
  (or rerun cmake with -DCMAKE_INSTALL_PREFIX=/my/special/path) to just change the prefix
===================================================================================================================
Configuring done
Generating done

The library build successfully but when I try to build the following example code:

#include <shogun/base/init.h>

using namespace shogun;
int main(int argc, char** argv)
{
    init_shogun_with_defaults();
    exit_shogun();
    return 0;
}

I get the following error:

link /NOLOGO /DYNAMICBASE /NXCOMPAT /INCREMENTAL:NO /SUBSYSTEM:CONSOLE "/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'" /MANIFEST:embed /OUT:..\build_release\shoguntest.exe @C:\Users\myUser\AppData\Local\Temp\shoguntest.exe.14740.610.jom shogun.lib(Time.obj) : error LNK2019: unresolved external symbol __imp_timeGetTime referenced in function "public: __cdecl shogun::CTime::CTime(bool)" (??0CTime@shogun@@QEAA@_N@Z) ..\build_release\shoguntest.exe : fatal error LNK1120: 1 unresolved externals
I don't understand where is the problem.

@friente friente changed the title Issue building libshogun module Linker error when using shogun on windows Mar 30, 2018
@friente friente changed the title Linker error when using shogun on windows Linker error 2019 when using shogun on windows Mar 30, 2018
@friente
Copy link
Author

friente commented Mar 31, 2018

Nobody can help me?

@karlnapf
Copy link
Member

karlnapf commented Apr 2, 2018

Sorry! As of now, you will have to check how we build shogun in appveyor and try to replicate that.
Any patches fixing potential problems are more than welcome

@friente
Copy link
Author

friente commented Apr 2, 2018

Is it possible to get the release and debug version of shogun binaries built with AppVeyor?
For would be enough. I need to start a project using shogun, but I'm stuck at the moment.

@karlnapf
Copy link
Member

karlnapf commented Apr 3, 2018

Shogun is part of vcpkg

microsoft/vcpkg#2977 (comment)

You could try that and let us know how it went

@friente
Copy link
Author

friente commented Apr 4, 2018

Thanks for your reply. I just cloned vcpkg from git repository and tried but I got the following error:

Call Stack (most recent call first):
  scripts/cmake/vcpkg_install_cmake.cmake:24 (vcpkg_build_cmake)
  ports/nlopt/portfile.cmake:22 (vcpkg_install_cmake)
  scripts/ports.cmake:72 (include)


Error: Building package nlopt:x64-windows failed with: BUILD_FAILED
Please ensure you're using the latest portfiles with `.\vcpkg update`, then
submit an issue at https://github.com/Microsoft/vcpkg/issues including:
  Package: nlopt:x64-windows
  Vcpkg version: 0.0.107-2018-04-03-599aea98c9a2ef587fd9deacdfcf64dfa2e3c4db

Additionally, attach any relevant sections from the log files above.

@vigsterkr
Copy link
Member

@fyoda you dont need to clone vcpkg just do: vcpkg install shogun

@vigsterkr
Copy link
Member

@fyoda could you actually provide the full version of your msvc?

@vigsterkr
Copy link
Member

@fyoda and if for some strange reason vcpkg does not work you can still opt to user the windows binary packages in conda-forge

@friente
Copy link
Author

friente commented Apr 4, 2018

The msvc version is: 14.00.24215.1

@friente
Copy link
Author

friente commented Apr 4, 2018

I have tried using conda, but it generates a lot a linker errors when I try to link shogun lib to the sample code posted above.

@friente
Copy link
Author

friente commented Apr 4, 2018

I have re-tried with vcpkg on another PC but I get the following error:

[657/659] cmd.exe /C "cd . && C:\Users\umber\Desktop\vcpkg\downloads\cmake-3.10.2-win32-x86\bin\cmake.exe -E vs_link_exe --intdir=examples\minimal\CMakeFiles\minimal.dir --manifests  -- C:\PROGRA~2\MICROS~1.0\VC\bin\X86_AM~1\link.exe  examples\minimal\CMakeFiles\minimal.dir\minimal.cpp.obj  /out:examples\minimal\minimal.exe /implib:examples\minimal\minimal.lib /pdb:examples\minimal\minimal.pdb /version:0.0  /machine:x64 /debug /INCREMENTAL /subsystem:console -LIBPATH:C:\Users\umber\Desktop\vcpkg\buildtrees\shogun\x64-windows-dbg\src\shogun  -LIBPATH:C:\Users\umber\Desktop\vcpkg\installed\x64-windows\debug\lib  -LIBPATH:C:\Users\umber\Desktop\vcpkg\installed\x64-windows\lib src\shogun\libshogun.lib winmm.lib C:\Users\umber\Desktop\vcpkg\installed\x64-windows\debug\lib\libprotobufd.lib C:\Users\umber\Desktop\vcpkg\installed\x64-windows\debug\lib\libxml2.lib C:\Users\umber\Desktop\vcpkg\installed\x64-windows\debug\lib\libiconv.lib C:\Users\umber\Desktop\vcpkg\installed\x64-windows\debug\lib\libcharset.lib ws2_32.lib C:\Users\umber\Desktop\vcpkg\installed\x64-windows\debug\lib\libcurl.lib C:\Users\umber\Desktop\vcpkg\installed\x64-windows\debug\lib\zlibd.lib C:\Users\umber\Desktop\vcpkg\installed\x64-windows\debug\lib\bz2d.lib C:\Users\umber\Desktop\vcpkg\installed\x64-windows\debug\lib\lzma.lib C:\Users\umber\Desktop\vcpkg\installed\x64-windows\lib\snappy.lib C:\Users\umber\Desktop\vcpkg\installed\x64-windows\debug\lib\lzo2.lib C:\Users\umber\Desktop\vcpkg\installed\x64-windows\debug\lib\nlopt.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib && cd ."
FAILED: examples/minimal/minimal.exe 
cmd.exe /C "cd . && C:\Users\umber\Desktop\vcpkg\downloads\cmake-3.10.2-win32-x86\bin\cmake.exe -E vs_link_exe --intdir=examples\minimal\CMakeFiles\minimal.dir --manifests  -- C:\PROGRA~2\MICROS~1.0\VC\bin\X86_AM~1\link.exe  examples\minimal\CMakeFiles\minimal.dir\minimal.cpp.obj  /out:examples\minimal\minimal.exe /implib:examples\minimal\minimal.lib /pdb:examples\minimal\minimal.pdb /version:0.0  /machine:x64 /debug /INCREMENTAL /subsystem:console -LIBPATH:C:\Users\umber\Desktop\vcpkg\buildtrees\shogun\x64-windows-dbg\src\shogun  -LIBPATH:C:\Users\umber\Desktop\vcpkg\installed\x64-windows\debug\lib  -LIBPATH:C:\Users\umber\Desktop\vcpkg\installed\x64-windows\lib src\shogun\libshogun.lib winmm.lib C:\Users\umber\Desktop\vcpkg\installed\x64-windows\debug\lib\libprotobufd.lib C:\Users\umber\Desktop\vcpkg\installed\x64-windows\debug\lib\libxml2.lib C:\Users\umber\Desktop\vcpkg\installed\x64-windows\debug\lib\libiconv.lib C:\Users\umber\Desktop\vcpkg\installed\x64-windows\debug\lib\libcharset.lib ws2_32.lib C:\Users\umber\Desktop\vcpkg\installed\x64-windows\debug\lib\libcurl.lib C:\Users\umber\Desktop\vcpkg\installed\x64-windows\debug\lib\zlibd.lib C:\Users\umber\Desktop\vcpkg\installed\x64-windows\debug\lib\bz2d.lib C:\Users\umber\Desktop\vcpkg\installed\x64-windows\debug\lib\lzma.lib C:\Users\umber\Desktop\vcpkg\installed\x64-windows\lib\snappy.lib C:\Users\umber\Desktop\vcpkg\installed\x64-windows\debug\lib\lzo2.lib C:\Users\umber\Desktop\vcpkg\installed\x64-windows\debug\lib\nlopt.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib && cd ."
LINK Pass 1: command "C:\PROGRA~2\MICROS~1.0\VC\bin\X86_AM~1\link.exe examples\minimal\CMakeFiles\minimal.dir\minimal.cpp.obj /out:examples\minimal\minimal.exe /implib:examples\minimal\minimal.lib /pdb:examples\minimal\minimal.pdb /version:0.0 /machine:x64 /debug /INCREMENTAL /subsystem:console -LIBPATH:C:\Users\umber\Desktop\vcpkg\buildtrees\shogun\x64-windows-dbg\src\shogun -LIBPATH:C:\Users\umber\Desktop\vcpkg\installed\x64-windows\debug\lib -LIBPATH:C:\Users\umber\Desktop\vcpkg\installed\x64-windows\lib src\shogun\libshogun.lib winmm.lib C:\Users\umber\Desktop\vcpkg\installed\x64-windows\debug\lib\libprotobufd.lib C:\Users\umber\Desktop\vcpkg\installed\x64-windows\debug\lib\libxml2.lib C:\Users\umber\Desktop\vcpkg\installed\x64-windows\debug\lib\libiconv.lib C:\Users\umber\Desktop\vcpkg\installed\x64-windows\debug\lib\libcharset.lib ws2_32.lib C:\Users\umber\Desktop\vcpkg\installed\x64-windows\debug\lib\libcurl.lib C:\Users\umber\Desktop\vcpkg\installed\x64-windows\debug\lib\zlibd.lib C:\Users\umber\Desktop\vcpkg\installed\x64-windows\debug\lib\bz2d.lib C:\Users\umber\Desktop\vcpkg\installed\x64-windows\debug\lib\lzma.lib C:\Users\umber\Desktop\vcpkg\installed\x64-windows\lib\snappy.lib C:\Users\umber\Desktop\vcpkg\installed\x64-windows\debug\lib\lzo2.lib C:\Users\umber\Desktop\vcpkg\installed\x64-windows\debug\lib\nlopt.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST /MANIFESTFILE:examples\minimal\CMakeFiles\minimal.dir/intermediate.manifest examples\minimal\CMakeFiles\minimal.dir/manifest.res" failed (exit code 1104) with the following output:
Microsoft (R) Incremental Linker Version 14.00.24215.1
Copyright (C) Microsoft Corporation.  All rights reserved.

LINK : fatal error LNK1104: cannot open file 'src\shogun\libshogun.lib'

Any help?

@vigsterkr
Copy link
Member

@fyoda could you actually post the linker errors as that seems to be pretty strange... since you the python module (shogun package in conda) itself is linked to that .lib... so i guess you are missing some linker flags.

on the other hand i'm not so sure what command yields you to the output of:
[657/659] cmd.exe

@friente
Copy link
Author

friente commented Apr 5, 2018

I'm sorry the [657/659] is my fault, comes from copy/paste.

@vigsterkr to summarize, I added set VCPKG_DEFAULT_TRIPLET=x64-windows before installing shogun through vcpkg.
Then I get the following error in the vpckg window:

CMake Error at scripts/cmake/vcpkg_build_cmake.cmake:136 (message):
    Command failed: C:/Users/myUser/Downloads/vcpkg/downloads/cmake-3.10.2-win32-x86/bin/cmake.exe;--build;.;--config;Debug;--target;install;--;-v;-j1
    Working Directory: C:/Users/myUser/Downloads/vcpkg/buildtrees/nlopt/x64-windows-dbg
    See logs for more information:
      C:\Users\myUser\Downloads\vcpkg\buildtrees\nlopt\install-x64-windows-dbg-out.log

Call Stack (most recent call first):
  scripts/cmake/vcpkg_install_cmake.cmake:24 (vcpkg_build_cmake)
  ports/nlopt/portfile.cmake:22 (vcpkg_install_cmake)
  scripts/ports.cmake:72 (include)


Error: Building package nlopt:x64-windows failed with: BUILD_FAILED
Please ensure you're using the latest portfiles with `.\vcpkg update`, then
submit an issue at https://github.com/Microsoft/vcpkg/issues including:
  Package: nlopt:x64-windows
  Vcpkg version: 0.0.107-2018-04-04-3baf583934f3077070e9ed4e7684f743ecced577

In the following I report the last portion of log file install-x64-windows-dbg-out.log:

   Creating library nlopt.lib and object nlopt.exp
[45/47] cmd.exe /C "cmd.exe /C "C:\Users\myUser\Downloads\vcpkg\downloads\cmake-3.10.2-win32-x86\bin\cmake.exe -E __create_def C:\Users\myUser\Downloads\vcpkg\buildtrees\nlopt\x64-windows-dbg\octave\CMakeFiles\nlopt_optimize-mex.dir\exports.def C:\Users\myUser\Downloads\vcpkg\buildtrees\nlopt\x64-windows-dbg\octave\CMakeFiles\nlopt_optimize-mex.dir\exports.def.objs && cd C:\Users\myUser\Downloads\vcpkg\buildtrees\nlopt\x64-windows-dbg" && C:\Users\myUser\Downloads\vcpkg\downloads\cmake-3.10.2-win32-x86\bin\cmake.exe -E vs_link_dll --intdir=octave\CMakeFiles\nlopt_optimize-mex.dir --manifests  -- "E:\Software\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\x86_amd64\link.exe"  octave\CMakeFiles\nlopt_optimize-mex.dir\nlopt_optimize-mex.c.obj  /out:octave\nlopt_optimize.mexw64 /implib:octave\nlopt_optimize.lib /pdb:octave\nlopt_optimize.pdb /dll /version:0.0 /machine:x64 /debug /INCREMENTAL  /DEF:octave\CMakeFiles\nlopt_optimize-mex.dir\exports.def  E:\Software\MATLAB\R2017b\extern\lib\win64\microsoft\libmex.lib nlopt.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib  && cd ."
FAILED: octave/nlopt_optimize.mexw64 octave/nlopt_optimize.lib 
cmd.exe /C "cmd.exe /C "C:\Users\myUser\Downloads\vcpkg\downloads\cmake-3.10.2-win32-x86\bin\cmake.exe -E __create_def C:\Users\myUser\Downloads\vcpkg\buildtrees\nlopt\x64-windows-dbg\octave\CMakeFiles\nlopt_optimize-mex.dir\exports.def C:\Users\myUser\Downloads\vcpkg\buildtrees\nlopt\x64-windows-dbg\octave\CMakeFiles\nlopt_optimize-mex.dir\exports.def.objs && cd C:\Users\myUser\Downloads\vcpkg\buildtrees\nlopt\x64-windows-dbg" && C:\Users\myUser\Downloads\vcpkg\downloads\cmake-3.10.2-win32-x86\bin\cmake.exe -E vs_link_dll --intdir=octave\CMakeFiles\nlopt_optimize-mex.dir --manifests  -- "E:\Software\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\x86_amd64\link.exe"  octave\CMakeFiles\nlopt_optimize-mex.dir\nlopt_optimize-mex.c.obj  /out:octave\nlopt_optimize.mexw64 /implib:octave\nlopt_optimize.lib /pdb:octave\nlopt_optimize.pdb /dll /version:0.0 /machine:x64 /debug /INCREMENTAL  /DEF:octave\CMakeFiles\nlopt_optimize-mex.dir\exports.def  E:\Software\MATLAB\R2017b\extern\lib\win64\microsoft\libmex.lib nlopt.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib  && cd ."
LINK Pass 1: command "E:\Software\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\x86_amd64\link.exe octave\CMakeFiles\nlopt_optimize-mex.dir\nlopt_optimize-mex.c.obj /out:octave\nlopt_optimize.mexw64 /implib:octave\nlopt_optimize.lib /pdb:octave\nlopt_optimize.pdb /dll /version:0.0 /machine:x64 /debug /INCREMENTAL /DEF:octave\CMakeFiles\nlopt_optimize-mex.dir\exports.def E:\Software\MATLAB\R2017b\extern\lib\win64\microsoft\libmex.lib nlopt.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST /MANIFESTFILE:octave\CMakeFiles\nlopt_optimize-mex.dir/intermediate.manifest octave\CMakeFiles\nlopt_optimize-mex.dir/manifest.res" failed (exit code 1120) with the following output:
Microsoft (R) Incremental Linker Version 14.00.24215.1
Copyright (C) Microsoft Corporation.  All rights reserved.

nlopt_optimize-mex.c.obj : warning LNK4197: export 'mexFunction' specified multiple times; using first specification
   Creating library octave\nlopt_optimize.lib and object octave\nlopt_optimize.exp
nlopt_optimize-mex.c.obj : error LNK2019: unresolved external symbol mxCalloc referenced in function mexFunction
nlopt_optimize-mex.c.obj : error LNK2019: unresolved external symbol mxFree referenced in function mexFunction
nlopt_optimize-mex.c.obj : error LNK2019: unresolved external symbol mxGetM referenced in function mexFunction
nlopt_optimize-mex.c.obj : error LNK2019: unresolved external symbol mxGetCell_730 referenced in function mexFunction
nlopt_optimize-mex.c.obj : error LNK2019: unresolved external symbol mxIsNumeric referenced in function struct_val_default
nlopt_optimize-mex.c.obj : error LNK2019: unresolved external symbol mxIsCell referenced in function mexFunction
nlopt_optimize-mex.c.obj : error LNK2019: unresolved external symbol mxIsChar referenced in function mexFunction
nlopt_optimize-mex.c.obj : error LNK2019: unresolved external symbol mxIsStruct referenced in function mexFunction
nlopt_optimize-mex.c.obj : error LNK2019: unresolved external symbol mxIsFunctionHandle referenced in function mexFunction
nlopt_optimize-mex.c.obj : error LNK2019: unresolved external symbol mxIsComplex referenced in function mexFunction
nlopt_optimize-mex.c.obj : error LNK2019: unresolved external symbol mxIsDouble referenced in function mexFunction
nlopt_optimize-mex.c.obj : error LNK2019: unresolved external symbol mxGetPr referenced in function mexFunction
nlopt_optimize-mex.c.obj : error LNK2019: unresolved external symbol mxGetScalar referenced in function struct_val_default
nlopt_optimize-mex.c.obj : error LNK2019: unresolved external symbol mxGetN referenced in function mexFunction
nlopt_optimize-mex.c.obj : error LNK2019: unresolved external symbol mxGetField_730 referenced in function mexFunction
nlopt_optimize-mex.c.obj : error LNK2019: unresolved external symbol mxDestroyArray referenced in function mexFunction
nlopt_optimize-mex.c.obj : error LNK2019: unresolved external symbol mxCreateDoubleMatrix_730 referenced in function mexFunction
nlopt_optimize-mex.c.obj : error LNK2019: unresolved external symbol mxGetString_730 referenced in function mexFunction
nlopt_optimize-mex.c.obj : error LNK2019: unresolved external symbol mxIsNaN referenced in function user_function
octave\nlopt_optimize.mexw64 : fatal error LNK1120: 19 unresolved externals
[46/47] cmd.exe /C "cd . && C:\Users\myUser\Downloads\vcpkg\downloads\cmake-3.10.2-win32-x86\bin\cmake.exe -E vs_link_exe --intdir=test\CMakeFiles\testopt.dir --manifests  -- "E:\Software\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\x86_amd64\link.exe"  test\CMakeFiles\testopt.dir\testfuncs.c.obj test\CMakeFiles\testopt.dir\testopt.c.obj test\CMakeFiles\testopt.dir\__\util\timer.c.obj test\CMakeFiles\testopt.dir\__\util\mt19937ar.c.obj test\CMakeFiles\testopt.dir\__\util\nlopt-getopt.c.obj  /out:test\testopt.exe /implib:test\testopt.lib /pdb:test\testopt.pdb /version:0.0  /machine:x64 /debug /INCREMENTAL  /subsystem:console  nlopt.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib && cd ."
Microsoft (R) Incremental Linker Version 14.00.24215.1
Copyright (C) Microsoft Corporation.  All rights reserved.

Microsoft (R) Incremental Linker Version 14.00.24215.1
Copyright (C) Microsoft Corporation.  All rights reserved.

ninja: build stopped: subcommand failed.

@vigsterkr
Copy link
Member

mmm you are building an octave interface? :)
or this is an error of nlopt that for some reason is trying to build something with octave?

@friente
Copy link
Author

friente commented Apr 5, 2018

I just did:

vcpkg install shogun

I think something strange happens when nlopt is built..

@vigsterkr
Copy link
Member

@fyoda this is a vcpkg issue unfortunately :(

@vigsterkr
Copy link
Member

i see you've already sent in an issue, let's have this one track it: microsoft/vcpkg#3207

@lyhyl
Copy link

lyhyl commented Jan 8, 2020

Hi @fyoda, do you solve your problem? I met a similar problem today. vcpkg#9588
btw, @vigsterkr, Is it normal for libshogun.lib to be so huge?

@vigsterkr
Copy link
Member

@lyhyl as you can see there's a pr to try to fix this: vigsterkr@0f959a6

it certainly solves all the unresolved external symbols but i had a problem of actually running the tests... if you happen to have windows on your desk and happy to help maybe we can finally find a final solution for this

@lyhyl
Copy link

lyhyl commented Jan 8, 2020

I'm glad you're still working on it @vigsterkr. I'll try to solve it based on your pr. I'm just curious why the project will generate such a huge static link library. Really unfriendly to linker😂.

@vigsterkr
Copy link
Member

@lyhyl as you can see there was an error how the dll was generated.. unfortunately until #4792 is not merged the static library of shogun is huge... :(

@vigsterkr
Copy link
Member

i mean i had a branch where i've manually set all the SHOGUN_EXPORT things... but i've dropped that in favour of CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS

@stale
Copy link

stale bot commented Jul 6, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jul 6, 2020
@stale
Copy link

stale bot commented Jul 13, 2020

This issue is now being closed due to a lack of activity. Feel free to reopen it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants