I can't make a release in VC++

63 views
Skip to first unread message

Alex Tuchin

unread,
Mar 21, 2025, 5:43:04 AMMar 21
to dislin-users
Hello! In debugging mode, a simple program:
#include "discpp.h"
Dislin g;
int main ()
{
  g.swgopt("russian", "coding");
  g.chacod("utf8");
  g.winfnt("Times New Roman");
  int screen_width, screen_height;
  g.getscr (&screen_width, &screen_height);
  g.swgwin (0, 0, screen_width, screen_height);
  g.swgtit ("Изучение Dislin study");
  int id_main = g.wgini ("form");
  int id_basbtn = g.wgbas(id_main, "form");
  g.swgwin(30, 30, 350, 50);
  g.wgpbut(id_basbtn, "Старт Start");
  g.wgfin ();
  return 0;
}
compiles normally, but errors occur in release mode (343 errors):
unresolved external symbol __security_check_cookie 4
unresolved external symbol _abs
unresolved external symbol _calloc and other. .
I wanted to attach a project DislinStudyVC32bit.zip (668 kb), but I received a message that files of this type cannot be attached. I posted it at the link https://disk.yandex.ru/d/gGO7oRY6SGOOzQ. What files can I attach?
Please help me fix the project.

Helmut Michels

unread,
Mar 21, 2025, 7:08:53 AMMar 21
to dislin-users
Hi Alex,

in the project settings for the linker you have the entry LIBCMT for Ignore Specific Default Libraries.
If this entry is deleted the project links without any errors, and the created program can be executed.
Tested with Visual Studio 2022, Release mode, x86.

With best regards,

Helmut

Alex Tuchin

unread,
Mar 21, 2025, 7:27:01 AMMar 21
to dislin-users
Hi, Helmut! Thank you so much for your reply. Everything worked out. I would just like to know which files can be attached to the message? Why can't I attach files with the zip extension?

пятница, 21 марта 2025 г. в 14:08:53 UTC+3, mic...@dislin.de:

Helmut Michels

unread,
Mar 21, 2025, 7:31:32 AMMar 21
to dislin-users
Hi Alex,

for attaching a zip file to a mail, I often had to rename the term .zip in the filename to
another value. For example: test.zip -> test.zzp. The receiver of the mail has to rename it
back to .zip.

With best regards,

Helmut

Alex Tuchin

unread,
Mar 21, 2025, 7:57:19 AMMar 21
to dislin-users
I tried to compile the project for 64 bit. I replaced discpp32bit.lib with discpp64bit.lib, and set the Linker-Input parameters to be the same as for 32 bits . I got an error . Скриншоты прикрепил. How can I fix the project?

Error.png
пятница, 21 марта 2025 г. в 14:27:01 UTC+3, Alex Tuchin:
LinkerInput.png

Helmut Michels

unread,
Mar 21, 2025, 8:06:41 AMMar 21
to dislin-users
Please, check in the project settings if the Runtime Library is correctly set to /MT, or if the
default value /MD is used.

With best regards,

Helmut

Alex Tuchin

unread,
Mar 21, 2025, 8:21:20 AMMar 21
to dislin-users
Thanks again for the help! I apologize for the carelessness.

пятница, 21 марта 2025 г. в 15:06:41 UTC+3, mic...@dislin.de:

Alex Tuchin

unread,
Mar 21, 2025, 8:45:08 AMMar 21
to dislin-users
Please tell me what files you need to use to create projects in pure C. Is there a list of files in dislin-11.5.2.iso indicating which programming languages they are intended for?

пятница, 21 марта 2025 г. в 15:21:20 UTC+3, Alex Tuchin:

Helmut Michels

unread,
Mar 21, 2025, 9:11:23 AMMar 21
to dislin-users
Hi,

for C programming you need the header file dislin.h for compiling and for linking a Dislin library that
corresponds to your compiler. The ISO file dislin-11.5.2.iso contains all Dislin distributions, available
PDF manuals and the HTML documentation. To see which Dislin distribution corresponds to your
compiler and operating system, you can take a look at the download section of the site
https://www.dislin.de, or at the README files in the subdirectories of the ISO file.

With best regards,

Helmut
Message has been deleted
Message has been deleted

Alex Tuchin

unread,
Mar 21, 2025, 4:19:06 PMMar 21
to dislin-users
I tried to make a project in pure C:
#include "dislin.h"
int main ()
{
  swgopt("russian", "coding");
  chacod("utf8");
  winfnt("Times New Roman");
  int screen_width, screen_height;
  getscr (&screen_width, &screen_height);
  swgwin (0, 0, screen_width, screen_height);

  swgtit ("Изучение Dislin study");
  int id_main = wgini ("form");
  int id_basbtn = wgbas(id_main, "form");
  swgwin(30, 30, 350, 50);
  wgpbut(id_basbtn, "Старт Start");
  wgfin ();
  return 0;
}
and included the disvс32bit.lib and disvс64bit.lib libraries in it.

When compiling, I get the following results:
Release-x86, x64; Debug-x64
Severity Code Description Project File Line Suppression State Details
Error LNK1104 cannot open file 'LIBCMT.lib' cDislin O:\MyProgramming\cDislin\LINK 1
Debug-x86
unresolved external symbol _swgopt referenced in function _main
unresolved external symbol _chacod referenced in function _main
unresolved external symbol _getscr referenced in function _main
unresolved external symbol _swgtit referenced in function _main
unresolved external symbol _swgwin referenced in function _main
unresolved external symbol _wgbas referenced in function _main
unresolved external symbol _wgfin referenced in function _main
unresolved external symbol _wgini referenced in function _main
unresolved external symbol _wgpbut referenced in function _main
unresolved external symbol _winfnt referenced in function _main
library machine type 'x64' conflicts with target machine type 'x86'
10 unresolved externals

I tried to attach the project archive with the zzp and kpp extensions, but again I received a warning that files of this type cannot be attached. Posted the project via the link https://disk .yandex.ru/d/1lupmmKDfk8Pug

Alex Tuchin

unread,
Mar 23, 2025, 2:12:32 PMMar 23
to dislin-users
Something happened to the link to the project. New link  https://disk.yandex.ru/d/2pz0G1Vlkq3z0g

пятница, 21 марта 2025 г. в 23:19:06 UTC+3, Alex Tuchin:

Helmut Michels

unread,
Mar 25, 2025, 10:25:37 AMMar 25
to dislin-users
Hi,

if I create an empty project in Visual Studio 2022 and include your project files into the project,
everything is working fine, but when I open your project file cDislin.vcxproj with Visual Studio 2022,
I get also the error message that LIBCMT.lib cannot be opened. I can't find the reason for this until yet.
Which version of Visual Studio are you using?

 With best regards,

Helmut

Alex Tuchin

unread,
Mar 26, 2025, 4:13:57 AMMar 26
to dislin-users
Hi, Helmut!

I have Microsoft Visual Studio Enterprise 2022 (64-bit) installed - Current Version 17.13.4. I created an empty project, configured it in Debug mode for 32 and 64 bits. The same errors occur during compilation. Please compare the settings of your project and mine. I don't understand why you are compiling without errors. Project https://disk.yandex.ru/d/I3Zhs4j5Djij9g

Alex

вторник, 25 марта 2025 г. в 17:25:37 UTC+3, mic...@dislin.de:

Helmut Michels

unread,
Mar 26, 2025, 6:18:13 AMMar 26
to dislin-users
Hi Alex,

thanks for the information. If I set the runtime library in your project settings to Multithreaded (/MT), it is working for me.

With best regards,

Helmut

Alex Tuchin

unread,
Mar 26, 2025, 9:53:03 AMMar 26
to dislin-users
Hi, Helmut!

I ran the program in different modes and recorded the process of launching the program on video (https://disk.yandex.ru/d/2n_p4o3ARXrhDw). I'm making a lot of mistakes again. It's not clear!

Alex
среда, 26 марта 2025 г. в 13:18:13 UTC+3, mic...@dislin.de:

Helmut Michels

unread,
Mar 26, 2025, 11:56:50 AMMar 26
to dislin-users
Hi Alex,

each mode (debug, release, 32- and 64-bit) has its own project settings. So, if you change the mode,
you have to check the project settings. Especially, if the mulithreaded runtime library (/MT) is used
for Dislin.

With best regards,

Helmut

Alex Tuchin

unread,
Mar 26, 2025, 2:23:07 PMMar 26
to dislin-users
Hi, Helmut!

In the video, you can see that for different modes I use different Dislin libraries - for 32 bits discvc32bit.lib, for 64 bits - discvc64bit.lib. For all modes (debug, release, 32 and 64 bit), I use the/MT switch. Or should I use the/MTd switch for debug mode? Please give a link to your project with my cDislin.c, that is working so that I can figure out what my mistake is.

Alex

среда, 26 марта 2025 г. в 18:56:50 UTC+3, mic...@dislin.de:
Reply all
Reply to author
Forward
0 new messages