Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

LNK Error 2019 using Visual Studio 2005 to compile C code

Status
Not open for further replies.

Fivehundred

Programmer
Dec 28, 2007
2
US
> I am using Visual Studio 2005 Command Prompt to compile this c code.
> For C++ code we use the follwing cl /clr filename but to complie C code I
> used cl /tp sample.c. I first get the following errors glpk.h file not
> found. I copied this file to the root directory where I am compiling the
> sample.c code along with glplib.h and other files. After resolving this I
> get another error sample.obj : error LNK 2019 unresolevd external symbol
> _glp_lpx_set_reference in function_ main .Please advice how to solve this
> issue.
 
Typically, it's due to an external dll that you need to provide the .lib file to. You need to add the reference to whatever lib file contains the _glp_lpx_set_reference symbols.
 
I am using glpk 4.25 and run the batch file after changing the HOME path
> in Build_GLPK_with_VC6.bat to C:\Program Files\Microsoft Visual Studio 8\VC.
> It created the following files glpsol , glpk object file library and glkp
> 4.25 export definitaion file in the same folder (w32). Does this mean the
> batch file run properly.

Yes.

> Next I try to run sample.c code but it gives me an
> error saying fatal error cannot open incllude file 'glpk.h' no such file or
> directory. The following is the path of my files

> C:\LP\glpk-4.25\glpk-4.25\examples\sample.c

> My glpk.h files are in the following directory

> C:\LP\glpk-4.25\glpk-4.25\include

> I type the following at the command prompt of Visual Stodio 2005

> C:\LP\glpk-4.25\glpk-4.25\examples> cl sample.c

> hit enter and the error I get is this

> fatal error C1083: cannot open incllude file 'glpk.h' no such file or
> directory

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top