Smile in Visual C++ Windows Forms Application

The engine.
Kasiak
Posts: 13
Joined: Tue Jul 28, 2009 8:43 am

Post by Kasiak »

Now when I include smile.h in "release":

1>c:\documents and settings\nuk\moje dokumenty\visual studio 2005\projects\ttt\ttt\smile.h(11) : fatal error C1189: #error : In release build _SECURE_SCL must be defined and set to zero for VS.NET 2005 or late.
shooltz[BayesFusion]
Site Admin
Posts: 1457
Joined: Mon Nov 26, 2007 5:51 pm

Post by shooltz[BayesFusion] »

Kasiak wrote:But now can I use smile without libraries?
You can't, but smile.h takes care of selecting the proper library (this can be disabled, but I think you can just leave the auto-linking on). All you need to do is ensure that the path to directory containing smile*.lib files is set globally in Tools/Options or as configuration property in Linker/General/Additional Library Directories.
shooltz[BayesFusion]
Site Admin
Posts: 1457
Joined: Mon Nov 26, 2007 5:51 pm

Post by shooltz[BayesFusion] »

Kasiak wrote:1>c:\documents and settings\nuk\moje dokumenty\visual studio 2005\projects\ttt\ttt\smile.h(11) : fatal error C1189: #error : In release build _SECURE_SCL must be defined and set to zero for VS.NET 2005 or late.
That should be self-explaining :) The best place to set this is in C++/Preprocessor/Preprocessor Definitions - note that you only need to that for release build.
Kasiak
Posts: 13
Joined: Tue Jul 28, 2009 8:43 am

Post by Kasiak »

How to run my program on computers without Visual C?
shooltz[BayesFusion]
Site Admin
Posts: 1457
Joined: Mon Nov 26, 2007 5:51 pm

Post by shooltz[BayesFusion] »

Kasiak wrote:How to run my program on computers without Visual C?
Use static C/C++ runtime. Alternatively, you may look into distributing the CRT with your application, but for VStudio 2005/2008 it's probably not worth the effort.
Kasiak
Posts: 13
Joined: Tue Jul 28, 2009 8:43 am

Post by Kasiak »

I have to do some experiments with my program on computers without Visual C++. Like I said before, it is my first program in Visual C++, so please give me more details. What should I set in project properties? Maybe I should copy some libraries with the exe file?
shooltz[BayesFusion]
Site Admin
Posts: 1457
Joined: Mon Nov 26, 2007 5:51 pm

Post by shooltz[BayesFusion] »

Project properties -> C++ -> Code generation -> Runtime library -> Multithreaded (/MT). Make sure you're doing that in release configuration. Rebuild the project and you should be able to distribute the exe file to other machines without installing any dependencies.
Maybe I should copy some libraries with the exe file?
You'll be linking statically with CRT just to avoid that.
Kasiak
Posts: 13
Joined: Tue Jul 28, 2009 8:43 am

Post by Kasiak »

1>------ Rebuild All started: Project: TTT, Configuration: Release Win32 ------
1>Deleting intermediate and output files for project 'TTT', configuration 'Release|Win32'
1>Compiling...
1>cl : Command line error D8016 : '/MT' and '/clr' command-line options are incompatible
1>Build log was saved at "file://c:\Documents and Settings\nuk\Moje dokumenty\Visual Studio 2005\Projects\TTT\TTT\Release\BuildLog.htm"
1>TTT - 1 error(s), 0 warning(s)
Kasiak
Posts: 13
Joined: Tue Jul 28, 2009 8:43 am

Post by Kasiak »

I've changed this option before, because smile didn't work with Windows Forms Application.
shooltz[BayesFusion]
Site Admin
Posts: 1457
Joined: Mon Nov 26, 2007 5:51 pm

Post by shooltz[BayesFusion] »

Kasiak wrote:I've changed this option before, because smile didn't work with Windows Forms Application.
In this case, stick with CRT in DLL and use the redistributable package containing the VC++ 8.0 runtime:
http://www.microsoft.com/downloads/deta ... laylang=en

Finally, you'll need to install the proper version of .NET on the target machine.
Post Reply