INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

LNK Error 2019 using Visual Studio 2005 to compile C code

LNK Error 2019 using Visual Studio 2005 to compile C code

(OP)
>    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.

RE: LNK Error 2019 using Visual Studio 2005 to compile C code

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.

RE: LNK Error 2019 using Visual Studio 2005 to compile C code

(OP)
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

RE: LNK Error 2019 using Visual Studio 2005 to compile C code

Try this:

cl.exe /I "c:\LP\glpk-4.25\glpk-4.25\include"

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close