Select projectadd visualgdb configurationnew linux. Downloading file cppopengl3dfuncsource code stdafx. As to the source code, include, and lib files, i issued lines of commands to specify the path. Oct 12, 2017 the code worked just fine in linux, but failed in the clients windows systems. However, this now means you have multiple files with same names in different places and this makes maintenance problem prone. This file is built with the yc switch which is used specifically to tell the compiler to create precompiled headers. In visual studio 2017 and earlier, the file was called stdafx.
Tutorials porting porting a windows app to linux with visual studio. Pretty often it all ends in them diligently turning off all. If you dont want it, delete it and dont include it in your main cpp file. Now we are porting the application to linux using gcc 4. By the program you are able to draw 6 different 3d functions. Introduction to linux a hands on guide this guide was created as an overview of the linux operating system, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter. I think that on my ubuntu linux machine the files are stored at usr include.
Oct 12, 2012 the simple solution is to have the linux build have a different stdafx. If you add something the program does not compile if you look closely to projectsettingsprecompiler headers you will see that checkbox use precompiler. As it happens in the realworld you cant just change the clients infrastructure to linux or just install another. Weve looked at it in some detail while working with pclint 9. If you havent got a solution by tomorrow morning, ill have a look at my socket code and check that thats how i. Porting a windows app to linux with visual studio february 4, 2014 linux, porting. Porting a windows app to linux with visual studio visualgdb. If you add something the program does not compile if you look closely to project settingsprecompiler headers you will see that checkbox use precompiler. Unless you have separately included the boost headers in code stda. The most interesting stuff is stored in the stdafx. Program also has opengl functions that provides you to rotate the graphics. If you are including the below windows header files. The only solution is to turn off using precompiled headers for that particular file.
This tutorial shows how to port a simple windows application to linux by creating a linux configuration in a visual studio project with visualgdb. Where are include files stored ubuntu linux, gcc stack. Could not find include file even if it is one of the specified include directories. Next thing is to be sure all your header files is installed. As it happens in the realworld you cant just change the clients infrastructure to. Everything can look strange and complicated in an unfamiliar environment, and novices are especially irritated by the stdafx. I think that on my ubuntu linux machine the files are stored at usrinclude. Thus, each time the user compiles their program, the user is essentially recompiling. Otherwise you are guaranteed to get compilation errors. Thats a precompiled header thing that nobody needs. How does the compiler know where to look for these. Therefore if the stdafx is the first include in the cpp file, then the compiler will have everything the header file needs, when it hits the headerfile in the cpp file.
It just utilizes the files with no interaction from me. Each header file should then have a construct like this so that its contents are only included once. Im new to this and so when i got this error, i tried searching where stdafx. The purpose of the file is to speed up the build process. Unless you were thinking of a compiler that can handle stdafx. Mar 24, 2018 iostream is only needed on windows thus you can comment the line and you are off to another breakage. Ive experimented with precompiled headers on both various vs versions and gcc on linux blog posts about this here and here. I have written one client and server for udp sockets i got the following errors while conpilation i have include all include files. The compiler would always compile this header files from scratch.
When you build this project, if you do not have a precompiled header the compiler is going to compile the 2 source files main. When you create a new project in visual studio, a precompiled header file named pch. Apr 23, 20 im new to this and so when i got this error, i tried searching where stdafx. Find answers to how to compile c in visual studio need to include stdafx. The simple solution is to have the linux build have a different stdafx. When you choose to compile your program, all of the. Sep 02, 2011 i was wondering the program i made was wrong but still i can run it. The code worked just fine in linux, but failed in the clients windows systems. If you havent got a solution by tomorrow morning, ill have a look at my socket code and check that thats how i did it. Instead of displaying and using greek text properly, some i. This may be caused by trying to include a system header using quotes, e. I also included the header files referenced by my stdafx. Im afraid im working blind at the moment as i am at home, not work. Both with and without them, the program seems to take the same time to compile.
158 829 1219 767 1104 1153 1084 634 344 1203 168 307 1057 659 1146 539 1153 826 1117 496 3 669 1405 758 200 1225 1036 1414 1094 992 455 416