Click here to Skip to main content
15,885,435 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I need to use Libqp (LIBRARY FOR QUADRATIC PROGRAMMING) for my project in Matlab. I am running the code on Windows 7 64 bit, Matlab R2011b. I have downloaded the library and when I want to comiple it according to the simple inctructions:

Run Matlab and go to the folder libqp_root/matlab
cd libqp_root/matlab


Compile mex files by running
libqp_compile

I get the following errors:

VB
libqp_gsmo_mex.c
libqp_gsmo_mex.c(75) : warning C4267: '=' : conversion from 'size_t' to 'uint32_t', possible loss of data
libqp_gsmo_mex.c(107) : error C2275: 'libqp_state_T' : illegal use of this type as an expression
        C:/Users/Downloads/libqp/lib/libqp.h(54) : see declaration of 'libqp_state_T'
libqp_gsmo_mex.c(107) : error C2146: syntax error : missing ';' before identifier 'state'
libqp_gsmo_mex.c(107) : error C2065: 'state' : undeclared identifier
libqp_gsmo_mex.c(108) : error C2065: 'state' : undeclared identifier
libqp_gsmo_mex.c(109) : error C2440: '=' : cannot convert from 'libqp_state_T' to 'int'
libqp_gsmo_mex.c(115) : error C2065: 'state' : undeclared identifier
libqp_gsmo_mex.c(115) : error C2224: left of '.QP' must have struct/union type
libqp_gsmo_mex.c(115) : error C2198: 'mxCreateDoubleScalar' : too few arguments for call
libqp_gsmo_mex.c(116) : error C2065: 'state' : undeclared identifier
libqp_gsmo_mex.c(116) : error C2224: left of '.exitflag' must have struct/union type
libqp_gsmo_mex.c(116) : error C2198: 'mxCreateDoubleScalar' : too few arguments for call
libqp_gsmo_mex.c(117) : error C2065: 'state' : undeclared identifier
libqp_gsmo_mex.c(117) : error C2224: left of '.nIter' must have struct/union type
libqp_gsmo_mex.c(117) : error C2198: 'mxCreateDoubleScalar' : too few arguments for call

  C:\PROGRA~1\MATLAB\R2011B\BIN\MEX.PL: Error: Compile of 'libqp_gsmo_mex.c' failed.


Any pointers appreciated.
Posted
Comments
The_Inventor 28-Sep-13 7:26am    
Are you able to show us the code from libqp_gsmo_mex.c, but It seems that you have used a string to initialize an unsigned 32 bit integer, and line 107 has some serious issues, that has affected the code below it.

hiii
i got the same problem here
i noticed that you post that five monthes ago

did you find any solution for that problem

i will be glad if you could help me
thanks #
 
Share this answer
 
XML
Hey,

I have found a solution. I have tried to compile them in matlab too but no success. So i decided to compile them on Visual Studio 2010.

I came up a solution on StackOverFlow that explains how to compile MEX files on Visual Studio <a href="http://stackoverflow.com/a/16718578">LINK</a>. I followed the steps and compiled both MEX files.

libqp_splx_mex.c easily compiled but my compiler produced strange errors when i tried to compile libqp_gsmo_mex.c file but when i move "libqp_state_T state;" declaration to top it resolved.

I hope it helps.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900