error LNK2019 visual c++

333 views
Skip to first unread message

RobW

unread,
Mar 3, 2012, 10:05:48 AM3/3/12
to dislin-users
Hello,

I am using Visual C++ 2010 Express and have downloaded the windows 64
bit dislin distribution from here http://www.mps.mpg.de/dislin/win64.html,

When I try and compile the following code:

#include "stdafx.h"
#include <iostream>
#include "dislin.h"

int main()
{
int numberOfPoints = 2;
double x[2] = {100, 105};
double y[2] = {200, 210};
qplot(x, y, numberOfPoints);
return 0;
}

I receive the following error:
error LNK2019: unresolved external symbol _qplot referenced in
function _main

I have added C:\dislin\disvc.lib to the list of Additional
Dependencies in Linker -> Input and C:\dislin\real64 to the Additional
Include Directories and the Runtime Library is set to Multi-threaded (/
MT).

I'm very new to c++ so any help resolving this would be much
appreciated.

Thanks

Rob

Helmut Michels

unread,
Mar 3, 2012, 11:40:58 AM3/3/12
to dislin-users
Hi Rob,

>
> I am using Visual C++ 2010 Express and have downloaded the windows 64
> bit dislin distribution from herehttp://www.mps.mpg.de/dislin/win64.html,
>
> When I try and compile the following code:
>
> #include "stdafx.h"
> #include <iostream>
> #include "dislin.h"
>
> int main()
> {
>         int numberOfPoints = 2;
>         double x[2] = {100, 105};
>         double y[2] = {200, 210};
>         qplot(x, y, numberOfPoints);
>         return 0;
>
> }
>
> I receive the following error:
> error LNK2019: unresolved external symbol _qplot referenced in
> function _main
>
> I have added C:\dislin\disvc.lib to the list of Additional
> Dependencies in Linker -> Input and C:\dislin\real64 to the Additional
> Include Directories and the Runtime Library is set to Multi-threaded (/
> MT).
>
> I'm very new to c++ so any help resolving this would be much
> appreciated.
>

if you are using double parameters for Dislin routines, you have to
link
with the library disvc_d.lib instead of disvc.lib. But this is not the
reason
for the linker error. The project setting could be wrong or you are
using
a 32-bit compiler with a 64-bit Dislin library. Just to make sure that
your
compiler is working with the correct Dislin library, you can open a
command
prompt of Visual Studio x64 from the Visual Studio Tools and give the
commands:

cd \dislin\examples
cl /Ic:\dislin exa_c.c c:\dislin\disvc.lib gdi32.lib
user32.lib

The command for your test program should be

cl /Ic:\dislin\real64 test.cpp c:\dislin\disvc_d.lib gdi32.lib
user32.lib

Best regards,

Helmut




RobW

unread,
Mar 3, 2012, 1:00:31 PM3/3/12
to dislin-users
Many thanks for the quick response Helmut.

When I run the above command line for exa_c.c I receive a list of
LNK2019 errors, & fatal error LNK1120: 119 unresolved externals.

for e.g. unresolved external symbol _wgfin referenced in function
_widget

Helmut Michels

unread,
Mar 3, 2012, 2:48:11 PM3/3/12
to dislin-users
Hi Rob,

> Many thanks for the quick response Helmut.
>
> When I run the above command line for exa_c.c I receive a list of
> LNK2019 errors, & fatal error LNK1120: 119 unresolved externals.
>
> for e.g. unresolved external symbol _wgfin referenced in function
> _widget
>

I think that you are using Visual C++ as a 32-bit compiler. Can you
check this? Normally, you can see it in the title of the command
prompt, or in the header line of MS Visual Studio (Win32 or Win64).
If you are using it as a 32-bit compiler, you can download the 32-bit
distribution of Dislin for Visual C++ and link with the library
disvcm.lib
or disvcm_d.lib.

Regards,

Helmut

RobW

unread,
Mar 4, 2012, 10:13:18 AM3/4/12
to dislin-users
This was indeed the case and all appears to be working with the 32-bit
distribution. Thank you very much for the help.
Reply all
Reply to author
Forward
0 new messages