View Full Version : Linux to Windows
07-19-2001, 04:01 AM
I've got a game working under Linux, now I'm trying to get it work under Windows. The thing is I get a strange compiling error in Visual C++:
c:\include\GL\gl.h(1152) : error C2144: syntax error : missing ';' identifier before...
Obviously there are some settings or likewise that I've missed.
Does anyone have a clue?
07-19-2001, 04:24 AM
Make sure you #include <windows.h> before you #include <GL/...>. If you've already done that, then I'm not sure.
Hope that helps.
07-19-2001, 04:34 AM
Thanks a lot, that was indeed the problem...or at least THAT problem, I've got a couple more of them http://www.opengl.org/discussion_boards/ubb/smile.gif
Do you know if #include <string> should work in windows?
/a happy goat
of course it should. its not a 'windows' thing, either, but a pre-processor thing.
< > means 'search the include path', and
" " means 'search the currect directory'
if your preprocessor is not finding <string>, then make sure 'strings' location is in your include path (-I<path> on commandline compilers)
07-19-2001, 04:41 PM
I was under the impression that the
atribute was a part of the standard c++ libraries... Maybe I'm wrong, but shuldn't this work with any compiler claming to be able to recognize standard c++ syntax?! As I said I might be wrong... Please correct me and tell me where I fail if I do so...
everything beginning with '#' is a pre-processor directive. The underlying C compiler never sees source code with #<something>. The pre-processor scans the source for #<something> and acts on it. (Some of them use a hack and just chck to see if the first char of each line is a '#'. in this case, source code that has <tab>#include won't work =)
its like this:
<src> -> [preprocessor] -> <outsrc> -> [compiler] -> <objectcode> -> [linker] -> <executable>
#include is a pre-processor hack (a HACK, damnit=) because C doesn't support multiple files. Some languages, like Java and Ada, inherently KNOW that the project is built of multiple source files. BUt not C; as far as the compiler is concerned, there is only ever one source file. True, it might not be executable, but.. hey! thats the job of the linker.
#include is not a compiler specific thing. You can use the same preprocessor on anything, actually... like a text file (#include"chatper1.txt", for a book, if you wanted=). include files don't necessarily have to have function prototypes in, either. aYou could so something like this:
/* a.h */
/* b.h */
/* c.h */
/* main.c */
07-20-2001, 05:44 AM
What version of VC++ are you using? VC++ 6.0 does have the string header, but I can't say for sure that older versions did. (I didn't use STL way back when I had 5.0 and 4.0)
Also, do you get an error on the include or on another line... The string object is placed in the std namespace so unless you do this...
using namespace std;
typedef std::string String;
You are likely to get errors saying that "string" is unrecognized.
07-20-2001, 12:07 PM
I get about 100 errors, all complaining on different operations with my strings. Like "YourString must be of class/struct type...something"
I'm maybe not being crystal clear to you guys, but hopefully you'll understand? http://www.opengl.org/discussion_boards/ubb/smile.gif
07-21-2001, 12:31 AM
If you're not getting an error similar to "Include file 'string' not found" and your errors are "... must be of class/struct type ..." then I'm guessing it's because you are passing wrong parameter types to functions. I've seen errors like this before and it's because there is no implicit type conversion for your parameters. A function will expect say const &T and you're trying to pass it &S or something. Cut and paste some detailed error messages into a post so we can see more information.
Hope that helps.
07-21-2001, 02:39 AM
By adding the line "using namespace std" i managed to get rid of all compile errors. However, now I'm stuck with a lot of linker errors. Most of them are "unresolved external symbol" and seem to have something to do with the string class:
error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::basic_string<char,struct std::char_traits<char>,class std::allocator<
I'm having a hard time figuring out what this means. Does anybody have some advice on how to fix this?
Thanks in advance!
Powered by vBulletin® Version 4.2.3 Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.