Archived

This topic is now archived and is closed to further replies.

spiffgq

Need help porting to Windows

Recommended Posts

Until now, I''ve been developing my program in Linux. Now, I think its about time to start porting it to Windows. I''ve written the program with portability in mind, so I''m hoping it won''t be a too big a job. I managed to get my hands on a copy of VC++ 6.0 (through legal means ), but I''m not entirely sure how to use it. I read through some tutorials and viewed some other VC++ projects, so I have the basics down. But I''m having one somewhat major problem. First some background: My program is organized into various namespaces. One namespace encapsulates the entire game and 11 namespaces encapsulate each subsystem (and 5 more for the tools). I have the source files divided up into separate directories depending on what namespace the file belongs to. This works very well because the Makefile allows me to ignore what directory the file is in, so I can do this:
#include "somefile.h" 
even though the files are in separate directories. This brings me to my problem. I created a Workspace and a Project for the main program. Then I added each source and header file to the project so all the files are listed in the Sources and Headers folders on the tree (on the left side of the screen). Then I try to compile the program and, among other errors , I get an error stating that somefile.h can''t be found. So the question I have is: even though all files are listed in the folders in the tree, how do I get VC++ to see the files and still maintain my directory structure? Oh, and any general tips on porting a program to Windows? Thanks for your help.

Share this post


Link to post
Share on other sites
quote:
Original post by spiffgq
So the question I have is: even though all files are listed in the folders in the tree, how do I get VC++ to see the files and still maintain my directory structure?

Specify the complete path in the #include directive:
#include "/path/to/somefile.h" 

You can use the parent directory shortcut "..", but may want to use Window path delineators ("\\" instead of "/").

quote:
Oh, and any general tips on porting a program to Windows?

Without more specific information (type of application, services used, etc), not really.

Share this post


Link to post
Share on other sites
quote:
Original post by Oluseyi
Specify the complete path in the #include directive:
#include "/path/to/somefile.h"  

You can use the parent directory shortcut "..", but may want to use Window path delineators ("\\" instead of "/").



Thats possible, but I would have to go through all the source and header files to do that. It is odd that even though VC++ lists "somefile.h" as a header in the headers folder it doesn''t recognize it as a local include file.

Share this post


Link to post
Share on other sites
quote:
Original post by spiffgq
Thats possible, but I would have to go through all the source and header files to do that. It is odd that even though VC++ lists "somefile.h" as a header in the headers folder it doesn''t recognize it as a local include file.

Logical oddities are common in the Windows world...

Share this post


Link to post
Share on other sites
quote:
Original post by Oluseyi
Logical oddities are common in the Windows world...



Uh-oh!



Thanks for your help.

[edited by - spiffgq on November 10, 2002 9:51:27 PM]

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Just add the directory to your path if the source file is not where your executable lives.

Tools->Options->Directories

Add the path to wherever your .h files are.

Share this post


Link to post
Share on other sites