-
June 2nd, 2009, 11:13 PM
#1
visual C++ use with gcc?
hi can i use visual c++ studio express edition for my IDE and make it compile using GCC (gcc is free and cross platform) compiler. i want to make my application cross platform. gcc is easy way for me to do this.
also though i like the visual C++ IDE alot.
-
June 3rd, 2009, 08:12 AM
#2
Re: visual C++ use with gcc?
I, too, focus on portable code and use GCC, but not inside Visual Studio.
I don't know the specifics, but google reveals several threads in various places where Visual Studio is configured to use makefiles and fire off the appropriate commands, but there's a few catches.
It appears that you can no longer use the debugger within the IDE, and there's no parallel compilation, in some cases the optimizations may not be as good, etc.
In my own work, I simply use a VM with Linux, and I have a Mac with XCode (which is based on GCC), so I post my code and compare compilations. To me it's easier than imposing GCC on Visual Studio.
If my post was interesting or helpful, perhaps you would consider clicking the 'rate this post' to let me know (middle icon of the group in the upper right of the post).
-
June 3rd, 2009, 09:15 AM
#3
Re: visual C++ use with gcc?
It's usually better to use Visual Studio's native compiler even if you are writing cross-platform code, because different compilers will warn you about different things.
-
June 3rd, 2009, 10:54 AM
#4
Re: visual C++ use with gcc?
then is there any way i can make visual C++ warn me about the cross platform errors so i dont have to write 2 versions of the code every time?
like i dont want to use visual C++ special functions like _itoa instead of itoa (i have to change these back), but visual C++ stupid gives me warning when i use itoa??
-
June 3rd, 2009, 11:03 AM
#5
Re: visual C++ use with gcc?
Originally Posted by poolisfun
then is there any way i can make visual C++ warn me about the cross platform errors so i dont have to write 2 versions of the code every time?
like i dont want to use visual C++ special functions like _itoa instead of itoa (i have to change these back), but visual C++ stupid gives me warning when i use itoa??
You could disable language extensions and set a high warning level, but that is not foolproof. You really should compile the code with multiple compilers if you want to be more certain that you are not doing things that are implementation/platform specific (e.g., relying on a header that is indirectly included).
-
June 3rd, 2009, 11:04 AM
#6
Re: visual C++ use with gcc?
Most of those warnings come with instructions on how to disable them. Worst case, you can always write something in a header file like
Code:
# if defined(MSC_VER)
# define itoa(x) _itoa(x)
# endif
It's worth noting, however, that proper C++ constructs are for the most part *not* so deprecated; that is limited mostly to libc. So for instance, you wouldn't get such a warning if you use a stringstream to do the conversion rather than itoa.
-
June 3rd, 2009, 03:07 PM
#7
Re: visual C++ use with gcc?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|