I just build osqp for windows.
In my project I add lib path ".\lib" and the AdditionalDependencies "libosqp.dll"
But when I build project I have this error.
"\lib\libosqp.dll : fatal error LNK1107: invalid or corrupt file: cannot read at 0x480"
Anyone have a solution ?
Install TDM-GCC 64bit.
Install the latest CMake.
git clone --recursive https://github.com/oxfordcontrol/osqp
cd osqp
git pull
cmake -G "MinGW Makefiles" ..
cmake --build %cd%
I just run osqp_demo and the result is.
-----------------------------------------------------------------
OSQP v0.4.1 - Operator Splitting QP Solver
(c) Bartolomeo Stellato, Goran Banjac
University of Oxford - Stanford University 2018
-----------------------------------------------------------------
problem: variables n = 2, constraints m = 3
nnz(P) + nnz(A) = 7
settings: linear system solver = qdldl,
eps_abs = 1.0e-003, eps_rel = 1.0e-003,
eps_prim_inf = 1.0e-004, eps_dual_inf = 1.0e-004,
rho = 1.00e-001 (adaptive),
sigma = 1.00e-006, alpha = 1.60, max_iter = 4000
check_termination: on (interval 25),
scaling: on, scaled_termination: off
warm start: on, polish: off
iter objective pri res dua res rho time
1 -7.8808e-003 1.01e+000 2.00e+002 1.00e-001 1.97e-004s
25 1.8797e+000 1.60e-003 9.48e-004 1.00e-001 4.91e-004s
status: solved
number of iterations: 25
optimal objective: 1.8797
run time: 7.78e-004s
optimal rho estimate: 2.14e-001
So I have to find how to use a dll in my project. Or it's possible to easy set cmake for build lib file ?
target_link_libraries (osqp_demo osqp)
I deleted all files in build directory, change given line, re generate project 'cmake -G "MinGW Makefiles" ..' and re build "cmake --build %cd%"
osqp_demo.exe works fine but I have a same error on my project.
cmake -G "MinGW Makefiles" ..
cmake -G "Visual Studio 15 2017 Win64" ..
cmake --helpbut osqp_demo.exe doesn't build but I have dll/lib files and my project build !
Thanks for your help !
If I have to build twice I'll do it. When I have time I will see why it does not work the first time.