C++ :: How To Use G++ Or Clang In IDE
Apr 11, 2014
I am creating a simple IDE that has an editor + compiler. It has syntax highlighting, code completion, etc. It returns the C++ code (it's a C++ IDE) in a string, I need to compile that string of C++ code and if there are errors let the compiler (g++ or clang) send the errors back to my program, so I could format the error output. Is that possible without adding the compiler's whole code base to my IDE source code? Or can I use something like fork() or exec() to do something of that kind?
View 9 Replies
Nov 20, 2014
I've been writing a game engine in C++ for a little over a year now, and its been really fun so far. I've been focusing on windows support for now (using Visual Studio and MSVC) but I'd like to leave the possibility of Linux and Mac support open. As a test, I recently compiled a small portion of my reflection system in Clang, to make sure it all still worked (since I consider that the most advanced portion of my codebase, though I'm pretty sure its all standard C++11). Anyway, I got some strange errors regarding undefined identifiers in template functions, and I managed to isolate the issue in the code below:
#include <iostream>
#include <string>
using namespace std;
template <class UserType>
string DoSomething() {
return TypeInfo<UserType>();
[Code] ....
Clang throws an error about 'TypeInfo' being undefined when 'DoSomething()' is compiled. However, MSVC compiles the code above without so much as a warning.
This goes against my understanding of how template functions/classes were compiled. I always thought that Undefined symbols were not an issue in templates, as long as they were defined by the time the template was instantiated. Whats the issue here? If in fact MSVC has been doing some non-standard stuff, that's pretty unfortunate for me if I want Linux support, as I'll have to do some serious backflips to resolve all the issues with this in my headers and stuff (I can't be the only one in thinking the current state of C++ with headers and forward-decelerations is just awful to work with).
View 1 Replies
View Related