#### Archived

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

# Need help porting to Windows

This topic is 5727 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## 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 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 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 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 on other sites
quote:
Original post by Oluseyi
Logical oddities are common in the Windows world...

Uh-oh!

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

##### Share on other sites
Just add the directory to your path if the source file is not where your executable lives.

Tools->Options->Directories

1. 1
Rutin
24
2. 2
3. 3
JoeJ
18
4. 4
5. 5

• 38
• 23
• 13
• 13
• 17
• ### Forum Statistics

• Total Topics
631708
• Total Posts
3001840
×