User Profile
Collapse
-
Problem solved, turns out to be very silly. The include guard in qlib/math/Math.h ( __MATH_H__ ) was being defined in one of the system libraries which caused the compiler to essentially ignore the entire file. Changing the guard define solved everything. -
It gets better...
Code compiles without any problems in cygwin using gcc 3.4.4Leave a comment:
-
Math.h is always included in sequence with other header files by the precompiled header. Q_INLINE is defined in ../sys/Public.h which is the first user file included by the precompiled header..
Your question definitely makes sense and is valid in C++, it's just the precompiled header strategy used in project that's throwing you off....Leave a comment:
-
All source files include the precompiled header 'qlib/precompiled.h' which includes the header files in the order shown.
qMath::Fabs is declared and defined in qlib/math/Math.h which is included by qlib/Lib.h two lines before qlib/math/Vector.h which, as I understand it, means that qMath will always be declared when parsing Vector.h.Leave a comment:
-
No .cpp file since it tries to compile object code for the precompiled header first. I hope you're prepared for quite a bit of code. I've included everything up to pertinent parts except for other headers.
...Code:// qlib/precompiled.h // #ifndef __PRECOMPILED_H__ #define __PRECOMPILED_H__ //--------------------------------------------------------- #if !defined( _DEBUG ) &&
Leave a comment:
-
I believe there is no 'easy' way to format data in a console. You will have to use spacing and newlines. Search for "format specifiers" for some neat tricks for formatting specific types in printf type functions.Leave a comment:
-
Given your code:
char a[10][10];
char **ptr_x;
Like cats said, your multi-dimensional array is essentially interpreted as an single dimensional array with a size of 100; as in it is a continuous block of 100 characters. Your ptr_x is pointing to a pointer to an array. So when you use array operators [] with ptr_x it expects to find an array of pointers which would then point to your character array. But your multi-dimensional...Leave a comment:
-
That is what I suspected even though, as I said, the headers are included in the correct order. I've actually already tried forward declaring qMath which generates the incomplete type errors you predicted. I'm about at wit's end trying to understand what could be wrong here.
I suppose it interesting that the error that I get about qMath is slightly different than those generated by other unrecognized symbols, I'm not sure if this is...Leave a comment:
-
If it is because of MS specific extensions it is near impossible for me to tell which or why since disabling their extensions prevents even their standard header files from compiling.Leave a comment:
-
-
I'm using Xcode as my development environment and I'm not sure where exactly to view the makefile. It fails while trying to create the precompiled header object /precompiled.h.g ch, which is the first object being compiled.
By using the -H compiler flag I can see that the headers are being added in the correct order, and errors are not generated until after all the headers have been included. Since this the code compiles without errors...Leave a comment:
-
Porting from MSVC to GCC, vague errors
As the title says, I am porting some code from MSVC (not sure which version, using Visual Studio 2008), which compiles without errors or warnings, to GCC 4.0 which generates a large number of generic errors.
The project uses a large header file 'precompiled.h' which includes two other header files, math/math.h and math/vector.h in that order. I've already disabled the ALWAYS_SEARCH_U SER_PATHS which was causing other errors.
...
No activity results to display
Show More
Leave a comment: