DCMTK + DCMPRINT : LNK2019 errors
Moderator: Moderator Team
-
- Posts: 43
- Joined: Fri, 2019-05-03, 15:06
DCMTK + DCMPRINT : LNK2019 errors
Hi
I am using DCMPRINT version 3.6.4.
Well, I'm having a problem with dcmtk + dcmprint where there are LNK2019 errors even if you don't have anything in my main, dcmtk's include's are enought to throw errors. I read that this can be generated by the lack of libs in the linker or by their order, but I think i have this part right. I'm going to add some prints of my code and the linker.
If you detect something wrong, please correct me.
Looking forward your reply. Thanks!
I am using DCMPRINT version 3.6.4.
Well, I'm having a problem with dcmtk + dcmprint where there are LNK2019 errors even if you don't have anything in my main, dcmtk's include's are enought to throw errors. I read that this can be generated by the lack of libs in the linker or by their order, but I think i have this part right. I'm going to add some prints of my code and the linker.
If you detect something wrong, please correct me.
Looking forward your reply. Thanks!
-
- OFFIS DICOM Team
- Posts: 1507
- Joined: Tue, 2004-11-02, 17:22
- Location: Oldenburg, Germany
- Contact:
Re: DCMTK + DCMPRINT : LNK2019 errors
The error message indeed indicates that the linker cannot resolve some symbols, either because a library is missing, or because the link order is incorrect.
The symbols reported in the error message are present in the ofstd library (ofstd.lib), and I cannot see that library in the list of library dependencies in your screenshot, so perhaps you simply need to add this.
The symbols reported in the error messages somewhere in the lower part of the screenshot are related to oflog.lib, which may also be missing.
As a rule of thumb, when working with DCMTK you will always need to link against ofstd.lib and oflog.lib, since these provide basic functions that are used everywhere in the toolkit.
And yes, you are right: Including header files can be enough to create library dependencies. That is a typical C++ feature that you probably won't find in pure C code.
The symbols reported in the error message are present in the ofstd library (ofstd.lib), and I cannot see that library in the list of library dependencies in your screenshot, so perhaps you simply need to add this.
The symbols reported in the error messages somewhere in the lower part of the screenshot are related to oflog.lib, which may also be missing.
As a rule of thumb, when working with DCMTK you will always need to link against ofstd.lib and oflog.lib, since these provide basic functions that are used everywhere in the toolkit.
And yes, you are right: Including header files can be enough to create library dependencies. That is a typical C++ feature that you probably won't find in pure C code.
-
- Posts: 43
- Joined: Fri, 2019-05-03, 15:06
Re: DCMTK + DCMPRINT : LNK2019 errors
Ty for your help.
U can see in the print under "wsock32.lib" (line 5 and 6) they are both there.
What else could cause this problem?
U can see in the print under "wsock32.lib" (line 5 and 6) they are both there.
What else could cause this problem?
-
- OFFIS DICOM Team
- Posts: 1507
- Joined: Tue, 2004-11-02, 17:22
- Location: Oldenburg, Germany
- Contact:
Re: DCMTK + DCMPRINT : LNK2019 errors
Then it's probably the link order. The libraries needed for the print client should be specified in this order:
Code: Select all
dcmprint.lib
dcmimage.lib
dcmimgle.lib
dcmnet.lib
dcmtls.lib
dcmdata.lib
oflog.lib
ofstd.lib
-
- Posts: 43
- Joined: Fri, 2019-05-03, 15:06
Re: DCMTK + DCMPRINT : LNK2019 errors
I have tried that and it made no diference. Im starting to think that it is a vs problem...
-
- OFFIS DICOM Team
- Posts: 1507
- Joined: Tue, 2004-11-02, 17:22
- Location: Oldenburg, Germany
- Contact:
Re: DCMTK + DCMPRINT : LNK2019 errors
Possible. You might want to check the command line options used to build DCMTK and compare these with the settings of your own project. There are some command line options that are mutually incompatible, such as
/Gd, /Gr, /Gv, /Gz
, which change the calling conventions (e.g. __thiscall, __fastcall, __stdcall) for functions.-
- Posts: 43
- Joined: Fri, 2019-05-03, 15:06
Re: DCMTK + DCMPRINT : LNK2019 errors
I left all of that default
-
- Posts: 43
- Joined: Fri, 2019-05-03, 15:06
Re: DCMTK + DCMPRINT : LNK2019 errors
Marco Eichelberg wrote: ↑Tue, 2021-04-06, 15:30 Possible. You might want to check the command line options used to build DCMTK and compare these with the settings of your own project. There are some command line options that are mutually incompatible, such as/Gd, /Gr, /Gv, /Gz
, which change the calling conventions (e.g. __thiscall, __fastcall, __stdcall) for functions.
Where can i check this? Im lost
-
- OFFIS DICOM Team
- Posts: 1507
- Joined: Tue, 2004-11-02, 17:22
- Location: Oldenburg, Germany
- Contact:
Re: DCMTK + DCMPRINT : LNK2019 errors
Sorry, I haven't used Visual Studio for years, I cannot say exactly where you can look that up. I remember that you can, though...
-
- Posts: 43
- Joined: Fri, 2019-05-03, 15:06
Re: DCMTK + DCMPRINT : LNK2019 errors
I've found out that it is compiling using "/Gd".
Now i'm trying to figure out how to remove that option, since, it's using the default
Now i'm trying to figure out how to remove that option, since, it's using the default
Last edited by ruben.cruz on Wed, 2021-04-07, 15:45, edited 1 time in total.
-
- Posts: 43
- Joined: Fri, 2019-05-03, 15:06
Re: DCMTK + DCMPRINT : LNK2019 errors
I managed to make it work but now im having this error...
can u help me with this?
can u help me with this?
-
- Posts: 43
- Joined: Fri, 2019-05-03, 15:06
Re: DCMTK + DCMPRINT : LNK2019 errors
I already fixed this by recompilind all libs with the "shared libs option" off and "overwrite flags" off and is running but im having a problem while connecting to it using your client.
do u know what might be causing this error?
do u know what might be causing this error?
-
- OFFIS DICOM Team
- Posts: 1507
- Joined: Tue, 2004-11-02, 17:22
- Location: Oldenburg, Germany
- Contact:
Re: DCMTK + DCMPRINT : LNK2019 errors
The print server uses two TCP ports, one for DICOM communication and one for inter-process communication (although the latter one is not really needed in the Windows version). The error message indicates that "somebody" has connected to the IPC port instead of the DICOM port.
Who is online
Users browsing this forum: No registered users and 1 guest