English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

when using the c++ visual studio express, how do to you build the exe file? (in other wordshow do you compile?) when I compile, it says 0 built, 1 error. How is the error avoided? I know that my source code is corret becuase I used another compiler and it gave me an exe. file correctly. (nothing works: build, debug, rebuild...etc..) thanks

2007-02-11 02:10:49 · 3 answers · asked by wanlei1991 1 in Computers & Internet Software

3 answers

The cleanest way according to my experiences is to simply wrap the cl.exe and link.exe and handle the custom builds there. Few things to take into consideration are:

1. Decide whether you want to use "permanent" wrapping or try do swap in and out the wrappers when required. Permanent wrapping could use the command line parameter or some registry/file key of a user to determine when to use the custom call. When reverting back to the original cl.exe and link.exe, be sure that your environment (environment variables, paths and stuff like that) are intact of what they were when your wrapper was called.

By intact I mean, that the Visual Studio relevant info is proper (see below on the wrapping). At least when starting the process with .NET libraries, the environment passed over from the wrapper by default.

2. Depending of the 3rd party tools, it is likely that you have to clean up and reformat the command line tool output. You likely can get rid of the 90% of the issues with simple .NET regexping, by formatting the warning/error and alike messages to the Visual Studio format.

Note: some portions of VS command line tools use environment variables for communicating with Visual Studio for various matters. I don't recall on top of my head, what the variables are, but you'll find them by examining the environment variables that are passed to the cl.exe for example. If you don't remove these (or reroute to your own), some messages will bypass the standard output and thus you cannot reformat them.

2007-02-11 02:17:00 · answer #1 · answered by Sir J 7 · 0 0

What is the error message/code?

Does your program have multi files (like more than one cpp and h file)? If so, you need to create a new project before compiling, you cannot just open directly the .cpp or .h files and try to compile, it won't establish the link between files.

Good luck

2007-02-11 10:18:32 · answer #2 · answered by Jocelyn B 3 · 0 0

if it says you have an error - you have an error. find the error and fix it and then you'll be able to build. good luck!

2007-02-11 10:17:00 · answer #3 · answered by zdanev78 3 · 0 2

fedest.com, questions and answers