473,387 Members | 1,553 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Converting unix project over to windows Visual Studio

RRick
463 Expert 256MB
I have a unix C++ project that needs to be converted over to windows visual studio. I'm not sure of the exact version of VS, but it's a recent version, probabIy 2003 or 2005.

I would like the windows directory tree to mimic the unix tree as closely as possible, but I don't want duplicate files and other inconsistencies. I have come up with an idea but I don't know how close it fits a "typical" windows project. If you know of specific links that deals with this subject, please post them.

The unix project creates a single library from the app directory tree and the test directory tree is the corresponding set of unit tests for the app tree. The structure of the unix project is:
  • unix_project
    • include
    • lib
    • app
      • util
        • math
        • string
    • test
      • util
        • math
        • string
This deviates a little bit from the unix standard where the app directory replaces the src directory and test replaces example.

Unix Include Directory
The main problem I'm having with the directory structure is converting the unix include directory over to a windows directory. Windows has a "common" directory concept. In this case, can I rename the include directory to common? Is this the usual use of common and header files? I thought of getting rid of the include/common directory, but the include/common directory is needed when distributing the library.

Also, the files in the unix include directory are links to the header files under the app tree. The links allow the user to edit the header locally or in the include directory and end up modifying the same file. In windows, it looks like I'll have to move the headers files over to the common directory to avoid duplicate header files

Visual Studio Setup
Visual Studio has the concept of a solution and project and little else. After playing around with VS for a while I came up with the following structure.

The "solution" would the the unix/windows project and the "projects" will be app and the various executables under test. By using solution folders and project filters (?) I was able to mimic the unix tree very closely.

One odd artifact came from putting all the headers files in a solution folder called common. This appears to be purely cosmetic and allows users to see the header files.

I tried making multiple projects under app (i.e. app/util/math and app/util/string) that modified the same static library, but this didn't work. I couldn't get them to work together. Math would wipe out string changes and vice versa. This appears to be a limitation of the VS project.

I have a similar problem with the test tree. I have two different test executables under the test/utill/math tree(i.e. mathUtil and random). Does this mean I need two projects? VS keeps creating new directories for each project, that I really don't want. Is it possible to have multiple executables in the same project?

Also, if there is something I missed, let me know.
Aug 15 '08 #1
1 3813
arnaudk
424 256MB
I've recently started using visual studio myself and encountered some similar problems. This is what I found out:
The main problem I'm having with the directory structure is converting the unix include directory over to a windows directory.
You can set additional include directories for each project in the project properties (Alt-F7) under Configuration Properties->C/C++->General, this is equivalent to the -I (upper case i) option for g++, additional libraries (g++'s -l (lower case L) switch) are listed in Configuration Properties->Linker->Input "Additional Dependencies", and the path to those libraries (g++'s -L switch) is in Configuration Properties->Linker->General "Additional Library Directories". You can also add those directories to the global search path in Tools->Options->Projects&Solutions->VC++ Directories
I tried making multiple projects under app (i.e. app/util/math and app/util/string) that modified the same static library, but this didn't work. I couldn't get them to work together. Math would wipe out string changes and vice versa. This appears to be a limitation of the VS project.
If some projects share source files then they may interfere with each other as they build. There are three solutions to that as I see it; you can
- build one solution at a time: Tools->Options->Projects&Solutions->Build&Run, set "maximum parallel project builds" to 1 or
- change the project dependencies Project->Project dependencies such that the build order (same dialog box) is correct or
- use different directories for the intermediate files of each project (see below).
I have a similar problem with the test tree. I have two different test executables under the test/utill/math tree(i.e. mathUtil and random). Does this mean I need two projects? VS keeps creating new directories for each project, that I really don't want. Is it possible to have multiple executables in the same project?
A solution can be comprised of several projects where each project builds to a single executable or library. You can place the solution and all its projects in the same directory, just uncheck the option "Create Directory For Solution" when you create a new project. Any intermediate files are placed in a directory specifed under Configuration Properties->General in the project properties (Alt-F7) and the linker places the executable/library it generates in a folder specified under Configuration Properties->Linker->General "Output File".

I'm not sure is this fully addresses your problems, but I hope this helps.
Aug 16 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: j.a. harriman | last post by:
Hi, On MSDN I know there is a JScript example (Upgrading Visual C++ Projects to Visual Studio .NET in Batch Mode) to upgrade VS6 C++ projects to .NET solutions. It converts the project files...
9
by: Michael Tissington | last post by:
After converting from 6.0 to 2005 when I try to Compile my project I'm getting a LINK error Error 1 fatal error LNK1181: cannot open input file " ?/.obj" Any ideas how to fx this please ? ...
0
by: Rich | last post by:
(1) Is there a better place to pose the question below? (2) I am starting to convert my enterprise solution from VS 2003 (.NET v1.1.4322) to VS 2005 Professional (.NET v2.0.50727). The entire...
28
by: Randy Reimers | last post by:
(Hope I'm posting this correctly, otherwise - sorry!, don't know what else to do) I wrote a set of programs "many" years ago, running in a type of basic, called "Thoroughbred Basic", a type of...
2
by: sitko | last post by:
Hi, I've not coded in C since College, and am now having to convert a VB.net app into a C program that will run on a Unix box (GNU Linux). Our development environment is pure Windows, with...
1
by: sureshhalade | last post by:
I want to migrate VS2003 Windows/Class library/console project to VS2005 Windows/Class library/console project. And the DLL out of VS2005 project should work as previously. Note: My main project...
2
by: Norman Diamond | last post by:
My C# code is I18N'ed by appropriately naming and editing .resx files. At execution time, it works. My C++ code is somewhat I18N'ed. When I put UI code in C++ I use .rc files. When I link to a...
4
by: Vadim | last post by:
Hello, I need to converting project that done on Visual Studio 2005 to Visual Studio 2003. What the best way to do this? Vadim Vilkhov
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.