Need help porting to Windows

Started by
4 comments, last by spiffgq 21 years, 5 months ago
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.
SpiffGQ
Advertisement
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.
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.

SpiffGQ
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...
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]
SpiffGQ
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.

This topic is closed to new replies.

Advertisement