Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Falcorum
Oct 21, 2010
More a curiosity than a real question but, why is it that the following doesn't give the same results in VS and GCC?
C++ code:
void foo() {}
template<typename T> void bar() {}

template<typename FN>
void qualFoobar(const FN& proc)
{
cout << is_pointer<FN>::value << " " << is_function<FN>::value << " " << is_function<typename remove_pointer<FN>::type>::value << " " << typeid(FN).name() << endl;
}

template<typename FN>
void unqualFoobar(FN proc)
{
cout << is_pointer<FN>::value << " " << is_function<FN>::value << " " << is_function<typename remove_pointer<FN>::type>::value << " " << typeid(FN).name() << endl;
}

qualFoobar(&foo);
qualFoobar(&bar<int>);
unqualFoobar(&foo);
unqualFoobar(&bar<int>);

It returns the following in Visual Studio:
code:
Ptr	Func	FuncWithoutPtr	Typeid
1	0	1		void (__cdecl*)(void)
0	1	1		void __cdecl(void)
1	0	1		void (__cdecl*)(void)
1	0	1		void (__cdecl*)(void)
Whereas in GCC, the 4 are exactly the same. Is this due to VS's lack of two phase lookup or something?

Adbot
ADBOT LOVES YOU

joebuddah
Jan 30, 2005
code:
#include "stdafx.h"
#include <iostream>
#include <cstdlib>
#include <string>
using namespace std;

class Monster
{
public:
	Monster () ( cout << "\n\t Building a Monster";)
		~Monster()(cout << "\n\t destroying a monster";)
		void Rampage()(cout << "destroying a city";)
		int getlife() (return Life;)
		void setlife(int x)(Life = x;)
		string Getmonstername()(return Monstername;)
		void Setmonstername(string x) (Monstername= x;)
				
private:

	int Life;
	string Monstername;
	};
 

	int main()
	{
		Monster Godzilla;
	
		return 0;
	}
I'm working on a classes. its saying that monster has no storage class and that cout is not a type name any help would be appreciated.

raminasi
Jan 25, 2005

a last drink with no ice
That style is eyeball-bleedingly bad but the particular thing that's tripping you up is that function bodies should be surrounded by braces, not parentheses.

joebuddah
Jan 30, 2005
Ok thanks.
Im going off of a video tutorial and its hard to tell the difference sometimes.

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe

Falcorum posted:

Whereas in GCC, the 4 are exactly the same. Is this due to VS's lack of two phase lookup or something?

Nothing to do with two-phase lookup; just a plain old buggy compiler. MSVC has a ton of bugs with l-values and pointers of function type, basically because they model them completely wrong internally — IIRC, they do something like always give functions function-pointer type and then have a ton of hacks to try to clean things up later.

Adiabatic
Nov 18, 2007

What have you assholes done now?
Hey guys.

I'm racking my brain over something in my C programming class and I'd be very grateful for even a hint on what I'm doing wrong here.

The assignment is centered around pointer arithmetic, but I'm getting a warning on the File I/O that I'd like to go away.

It consists of a hw1.c file that was given to us and we aren't allowed to modify. We're graded on the hw1_functions.c file.

The relevant code from hw1.c is this bit:

code:
int read_array(FILE *readfile, int *array, int max_size);
void main(void)
{
	int int_array[SIZE];
	int array_size;
	FILE *infile = NULL;
	char infilename[MAXCHAR];
	FILE *outfile;

	printf("Sort an array of integers from a file using pointer arithmetic\n");

	while(infile == NULL) {
		printf("Input filename:");
		scanf("%s",infilename);
		if((infile = fopen(infilename, "r")) == NULL) {
			printf("ERROR: file %s can not be opened!\n",infilename);
		}
	}
	
	array_size = read_array(infile, int_array, SIZE);
}
and the relevant bit of hw1_functions.c is here:

code:
int read_array(infile, int_array, SIZE)
{
	int *counter;
	int i = 0;
	counter = &int_array + 1;
	
	while(fscanf(infile, "%d\n", counter) != EOF)
	{
		counter++;
		printf("counter is %p\n", counter);
		i++;
	}
	
	return i;
}
I get this warning message when I compile with gcc:



When I change the hw1_functions.c code to make a new FILE pointer with:

code:
FILE *filebuffer = infile;
and change the fscanf argument to then look at "filebuffer" instead of "infile" I then get this warning:



Any advice on how to make this warning go away? Why is "infile" suddenly changing to an integer?

Mr.Radar
Nov 5, 2005

You guys aren't going to believe this, but that guy is our games teacher.

Adiabatic posted:

Any advice on how to make this warning go away? Why is "infile" suddenly changing to an integer?

Because you didn't give it a type when you defined the function (you need to repeat the parameter type declaration in both the declaration of the function and its definition).

Hiowf
Jun 28, 2013

We don't do .DOC in my cave.

Adiabatic posted:

my C programming class

code:
void main(void)

:commissar:

Surprised GCC doesn't warn about it.

Adiabatic
Nov 18, 2007

What have you assholes done now?

Mr.Radar posted:

Because you didn't give it a type when you defined the function (you need to repeat the parameter type declaration in both the declaration of the function and its definition).

Holy poo poo thank you that got it.

Skuto posted:

:commissar:

Surprised GCC doesn't warn about it.

That's the professor's code too!

shrughes
Oct 11, 2008

(call/cc call/cc)
Yawn, who cares, main returning void never hurt anybody.

Qwertycoatl
Dec 31, 2008

Skuto posted:

:commissar:

Surprised GCC doesn't warn about it.

-Wmain (it's in -Wall)

durtan
Feb 21, 2006
Whoooaaaa
So let's say I want to read 4 individual bytes 1 at a time and see if each hex value corresponds to a particular byte I'm looking for, is it possible to check for all 4 bytes at once? Is it written as
code:
0x12 0x13 0x14 0x15
or
code:
0x12131415
Google search isn't helping me on this.

sarehu
Apr 20, 2007

(call/cc call/cc)

durtan posted:

So let's say I want to read 4 individual bytes 1 at a time and see if each hex value corresponds to a particular byte I'm looking for, is it possible to check for all 4 bytes at once? Is it written as
code:
0x12 0x13 0x14 0x15
or
code:
0x12131415
Google search isn't helping me on this.

What does "corresponds" mean? Will you have a lookup table or function telling you what values correspond to what? Can you invert this mapping and just check for equality?

Also you're saying you want to check for all 4 bytes at once. But you just said you were checking for a particular byte that each hex value corresponds to. Did you mean to say that you wanted to check all 4 bytes at once? If so, whether you can do that depends on what it means for hex values to correspond to one another.

hackbunny
Jul 22, 2007

I haven't been on SA for years but the person who gave me my previous av as a joke felt guilty for doing so and decided to get me a non-shitty av
I'm embarrassed to be asking this, but...

I have a function that takes an object as a parameter and puts it in a container. To avoid wasting time and memory on useless copies, I declare the argument as a rvalue reference, and std::move() it to the container's insert(). Won't this "steal" a caller's object if it happens to be an lvalue instead of a temporary? How do I avoid this? My guess is an overload that takes a const reference, but I'm not terribly sure. Little help?

Dicky B
Mar 23, 2004

That is the motivation behind std::forward, which preserves the lvalueness/rvalueness of the expression.

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe

hackbunny posted:

I have a function that takes an object as a parameter and puts it in a container. To avoid wasting time and memory on useless copies, I declare the argument as a rvalue reference, and std::move() it to the container's insert(). Won't this "steal" a caller's object if it happens to be an lvalue instead of a temporary? How do I avoid this? My guess is an overload that takes a const reference, but I'm not terribly sure. Little help?

You can't convert an l-value to an r-value reference, so the implicit error can't happen. If you want be able to accept either an l-value or an r-value, you have three options. You can make the function take the argument as a value instead of a reference (and then move out of it unconditionally); this requires more formal objects, but as long as move-construction really is cheap, it shouldn't be much of a problem. You can provide a second overload that takes a const &, which means repeating some code but should generate optimal behavior. Finally, you can make the function templated, declare it as taking a T&&, and then std::forward<T> the argument over to the insert function.

durtan
Feb 21, 2006
Whoooaaaa

sarehu posted:

What does "corresponds" mean? Will you have a lookup table or function telling you what values correspond to what? Can you invert this mapping and just check for equality?

Also you're saying you want to check for all 4 bytes at once. But you just said you were checking for a particular byte that each hex value corresponds to. Did you mean to say that you wanted to check all 4 bytes at once? If so, whether you can do that depends on what it means for hex values to correspond to one another.

I might've figured it out, but I thought I'd answer your question. So I am working on a program which takes a faw file and finds .jpg images in it for a class. I am looking for 4 hex values which indicate the start of the jpg and I'm unsure how to check for them. The raw file mimics a CF card and apparently uses 512 byte blocks at a time, so I only need to check the first four bytes of each block. However, when I try to write something like
code:
if (buffer == 0x12 0x13 0x14 0x15)
it tells me I should put the closing parenthesis after the first hex number, 0x12. Additionally, writing
code:
0x120x130x140x15
didn't work either. I believe writing in the format of
code:
0x12131415
will get me my results but I've yet to write out a test for it.

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe
Just check the values of each of the first four bytes individually.

durtan
Feb 21, 2006
Whoooaaaa
I thought of doing that, but I figured there'd be a way to check all four values at once and save myself a bunch of if statements. Is one at a time the only way to do it? What would be a good way to go about that?

b0lt
Apr 29, 2005

durtan posted:

I thought of doing that, but I figured there'd be a way to check all four values at once and save myself a bunch of if statements. Is one at a time the only way to do it? What would be a good way to go about that?

memcmp

durtan
Feb 21, 2006
Whoooaaaa
So if I call memcmp four times, will it read whatever size n of bytes consecutively?

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe
You could do this:

C++ code:
const uint8_t magicNumber[] = { 0xff, 0xd8, 0xff, 0xe0 };
if (memcmp(buffer, magicNumber, 4) != 0) {
  /* not a jpeg! */
}
Or you could do this:

C++ code:
if (buffer[0] != 0xff || buffer[1] != 0xd8 || buffer[2] != 0xff || buffer[3] != 0xe0) {
  /* not a jpeg! */
}
To me, the first seems worse, but whatever floats your boat.

The important thing is that there is no way to get there from 0xffd8ffe0 without making endianness assumptions, which you should be learning to avoid in babby's first C project.

Blotto Skorzany
Nov 7, 2008

He's a PSoC, loose and runnin'
came the whisper from each lip
And he's here to do some business with
the bad ADC on his chip
bad ADC on his chiiiiip

rjmccall posted:

The important thing is that there is no way to get there from 0xffd8ffe0 without making endianness assumptions, which you should be learning to avoid in babby's first C project.

arpa/inet.h ?

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe

:rolleyes: My point is that somebody new to C who is legitimately wondering whether memcmp will statefully advance their buffer pointer should be writing the simple, obvious code that does not need to reason about endianness at all.

Bob Morales
Aug 18, 2006


Just wear the fucking mask, Bob

I don't care how many people I probably infected with COVID-19 while refusing to wear a mask, my comfort is far more important than the health and safety of everyone around me!

Is there a decent-size C/C++ project that would make a good subject for a build speed benchmark?

Something that would preferably do OS X and Linux, but not have to build a bunch of other OS-dependent stuff that would really throw it off. I used to use stuff like nmap but it builds in 15 seconds, and I'd use the Linux kernel if it would build on the Mac...

fritz
Jul 26, 2003

Bob Morales posted:

Is there a decent-size C/C++ project that would make a good subject for a build speed benchmark?

Something that would preferably do OS X and Linux, but not have to build a bunch of other OS-dependent stuff that would really throw it off. I used to use stuff like nmap but it builds in 15 seconds, and I'd use the Linux kernel if it would build on the Mac...

The biggest thing I've built recently is the clang source.

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

Firefox is pretty big, or Chrome.

MrMoo
Sep 14, 2000

Phoronix typically uses the Linux kernel or Open Office.

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe
LLVM/clang would not be a totally fair benchmark since, of course, it is something that we actively track our compile time on and other compilers presumably don't. Firefox is a reasonable choice as long as you're comparing builds for the same target platform. If you become interested in benchmarking whole-system cross-platform compile performance (e.g. comparing Linux vs. Mac OS X installs on the same/comparable hardware), GUI projects aren't a good choice because of course the GUI layers will use different toolkits and hence different source code.

hackbunny
Jul 22, 2007

I haven't been on SA for years but the person who gave me my previous av as a joke felt guilty for doing so and decided to get me a non-shitty av

Dicky B posted:

That is the motivation behind std::forward, which preserves the lvalueness/rvalueness of the expression.

rjmccall posted:

You can't convert an l-value to an r-value reference, so the implicit error can't happen. If you want be able to accept either an l-value or an r-value, you have three options. You can make the function take the argument as a value instead of a reference (and then move out of it unconditionally); this requires more formal objects, but as long as move-construction really is cheap, it shouldn't be much of a problem. You can provide a second overload that takes a const &, which means repeating some code but should generate optimal behavior. Finally, you can make the function templated, declare it as taking a T&&, and then std::forward<T> the argument over to the insert function.

Thank you both, I think I get it now, sort of. The point is moot anyway, because I found out I'm limited C++03 :sigh:

BioEnchanted
Aug 9, 2011

He plays for the dreamers that forgot how to dream, and the lovers that forgot how to love.
I'm trying something simpler. I am in the middle of a tictactoe game but can't figure out where my error checking is going wrong. It works fine when I try to put a number in that is too big, but non-numerical entry needs to be taken intoi account as well, e.g. if you enter a string instead, it should say "Please Enter a number". It doesn't though it just gets trapped in an infinite loop of switching between players rapidly and I have no idea why. Any help? I have tried to comment and format it better this time. Also if there are any areas where I am going about it completely the wrong way do let me know:

code:
#include <iostream>
#include <string>

using namespace std;
string tic_tac_grid[3][3];

int player;
int choice_x;
int choice_y;
int choice_x2;
int choice_y2;
bool winner;
string replay;
string char1;

class tic_tac{int width,depth;
        public:
            int create(int,int);
            int update(int,int);
            bool check_winner();
            };

int tic_tac::create(int w,int d){
    width=w;
    depth=d;
    for(w=0;w<3;w++){
        for(d=0;d<3;d++){
            tic_tac_grid[w][d]=".";
        }
        cout<<tic_tac_grid[w][0]<<"|"<<tic_tac_grid[w][1]<<"|"<<tic_tac_grid[w][2]<<"\n";
        if(w<2){
            cout<<"-----\n";
        }
    };
    return 0;
}

int tic_tac::update(int choice_x,int choice_y){
    tic_tac_grid[choice_x][choice_y]=char1;
    int x;
    for(x=0;x<3;x++){
        cout<<tic_tac_grid[x][0]<<"|"<<tic_tac_grid[x][1]<<"|"<<tic_tac_grid[x][2]<<"\n";
            if(x<2){
                cout<<"-----\n";
            }
    };
    return 0;
}

bool tic_tac::check_winner(){
    if (
        ((tic_tac_grid[0][0]==tic_tac_grid[0][1])&&(tic_tac_grid[0][1]==tic_tac_grid[0][2])&&((tic_tac_grid[0][2]=="X")||(tic_tac_grid[0][2]=="O")))||//These three lines heck for any lines made up of the letter X or O
        ((tic_tac_grid[2][0]==tic_tac_grid[2][1])&&(tic_tac_grid[2][1]==tic_tac_grid[2][2])&&((tic_tac_grid[2][2]=="X")||(tic_tac_grid[2][2]=="O")))||//row 3
        ((tic_tac_grid[0][0]==tic_tac_grid[1][0])&&(tic_tac_grid[1][0]==tic_tac_grid[2][0])&&((tic_tac_grid[2][0]=="X")||(tic_tac_grid[2][0]=="O")))||//column 1
        ((tic_tac_grid[0][1]==tic_tac_grid[1][1])&&(tic_tac_grid[1][1]==tic_tac_grid[2][1])&&((tic_tac_grid[2][1]=="X")||(tic_tac_grid[2][1]=="O")))||//column 2
        ((tic_tac_grid[0][2]==tic_tac_grid[1][2])&&(tic_tac_grid[1][2]==tic_tac_grid[2][2])&&((tic_tac_grid[2][2]=="X")||(tic_tac_grid[2][2]=="O")))||// column 3
        ((tic_tac_grid[0][0]==tic_tac_grid[1][1])&&(tic_tac_grid[1][1]==tic_tac_grid[2][2])&&((tic_tac_grid[2][2]=="X")||(tic_tac_grid[2][2]=="O")))||//diagonal tl-br
        ((tic_tac_grid[2][0]==tic_tac_grid[1][1])&&(tic_tac_grid[1][1]==tic_tac_grid[0][2])&&((tic_tac_grid[0][2]=="X")||(tic_tac_grid[0][2]=="O")))//diagonal tr-bl
        ){
            if(char1=="X"){
                cout<<"Player 1 wins";
                winner = true;
            }
            else if(char1=="O"){
                cout<<"Player 2 wins";
                winner = true;
            }
    };
    return true;
}


int main()
{

    winner = false;
    player = 1;
    tic_tac tic;
    tic.create(3,3);
    while(winner!=true){
        switch(player){
            case 1:
                cout<<"Player 1's turn. Which square will you put your letter in(0, 1 or 2)? ";
                cin>>choice_x>>choice_y;
                char1="X";
                if(choice_x > 2||choice_y > 2){//if choice in out of range
                    cout<<"Please Enter a valid choice.(0, 1 or 2) ";
                    cout<<"Which square will you put your letter in(0, 1 or 2)?\n";
                    cin>>choice_x>>choice_y;
                }
                else if(choice_x <= 2 && choice_y <= 2){//if choice is in range
                //update board
                tic.update(choice_x,choice_y);
                //check if winning move
                tic.check_winner();
                if(winner == true){
                    cout<<"Would you like to play again(Y/N)? ";
                    cin>>replay;
                    if(replay=="Y"){
                        tic.create(3,3);
                    }
                    else if(replay=="N"){
                        break;
                    }
                }
                player = 2;
                }
                else{//if not relevant
                    cout<<"Error, choice must be a number.";
                }
            case 2:
                cout<<"Player 2's turn. Which square will you put your letter in(0, 1 or 2)? ";
                cin>>choice_x2>>choice_y2;
                char1="O";
                tic.update(choice_x2,choice_y2);
                tic.check_winner();
                if(winner == true){
                    cout<<"Would you like to play again(Y/N)? ";
                    cin>>replay;
                    if(replay=="Y"){
                        tic.create(3,3);
                    }
                    else if(replay=="N"){
                        break;
                    }
                }
                player=1;
        };
    };
}

Lime
Jul 20, 2004

BioEnchanted posted:

I'm trying something simpler. I am in the middle of a tictactoe game but can't figure out where my error checking is going wrong. It works fine when I try to put a number in that is too big, but non-numerical entry needs to be taken intoi account as well, e.g. if you enter a string instead, it should say "Please Enter a number". It doesn't though it just gets trapped in an infinite loop of switching between players rapidly and I have no idea why. Any help? I have tried to comment and format it better this time. Also if there are any areas where I am going about it completely the wrong way do let me know:

An istream goes into a fail state if it can't turn what it read into a value of the type you passed to operator>>. After that it won't do any more reads until you clear the fail state with clear(). You're going into an infinite loop because cin is just blowing off all reads. You should be testing cin after reading with fail() or just using the overloaded operator! or implicit conversion to bool, e.g.:

code:
if(cin >> choice_x >> choice_y) {
  // both inputs valid ints, process choice
} else {
  cout << "Error, choice must be a number\n";
  cin.clear();
}

Lime fucked around with this message at 12:01 on Sep 8, 2014

Vanadium
Jan 8, 2005

You also need to actually read the non-numeric data out of the stream after clearing, or the next attempt to read an int will return immediately and put the stream into the same failure state again, making no progress.

hooah
Feb 6, 2006
WTF?
As for some other strange things going on in your code, your while loop in main will never end, so you'll want to look into that. In addition, if you've learned about void function returns, then you should use that for any function where you don't actually use the return value, rather than returning something that you never use.

BioEnchanted
Aug 9, 2011

He plays for the dreamers that forgot how to dream, and the lovers that forgot how to love.
I'll try to implement the necessary things, including the void functions, but I have a question about the point on the while loop. I thought that the loop would end after the win condition had been satisfied and the player had said no to continuing. Why is this not true, and how can I resolve the issue?

astr0man
Feb 21, 2007

hollyeo deuroga
C++ code:
                    else if(replay=="N"){
                        break;
                    }
is inside a switch statement, so when you use break there it will break out of that switch case, not the while loop. Also the way your code is written it will always execute both switch cases before it gets back to the beginning of the loop, since your first case will always fall through to the second case.

Switch statements should generally look like:
C++ code:
switch (foo)
{
    case 1:
        // stuff here
        break;
    case 2:
        // more stuff here
        break;
    ...
}
Without the break at the end of a case it will continue running whatever is in the next case and so on.



edit: actually looking at it again I guess might not be what you intended to do with the break there. I can't tell at a quick glance if winner is being set properly, don't use global variables like that it is generally a bad practice and I think it would probably be better to have something like:

C++ code:
int main()
{
    bool winner;
    while (!winner)
    {
        ...
        winner = tictac.check_winner();
        ...
    }

    return 0;
}

astr0man fucked around with this message at 15:09 on Sep 8, 2014

hooah
Feb 6, 2006
WTF?

astr0man posted:

edit: actually looking at it again I guess might not be what you intended to do with the break there. I can't tell at a quick glance if winner is being set properly, don't use global variables like that it is generally a bad practice and I think it would probably be better to have something like:

C++ code:
int main()
{
    bool winner;
    while (!winner)
    {
        ...
        winner = tictac.check_winner();
        ...
    }

    return 0;
}

Yeah, this is what I was getting at. You don't use the return from tictac.check_winner() in any way, so the variable winner never gets changed.

astr0man
Feb 21, 2007

hollyeo deuroga
He sets the global bool winner in tictac.check_winner() so I guess maybe it does work? But yeah as I said before this is terrible code please don't write it this way

Boz0r
Sep 7, 2006
The Rocketship in action.
Is there some way to reliably convert a Visual Studio project to CMake? I want to try the new JetBrains IDE CLion and I have no experience with CMake.

Adbot
ADBOT LOVES YOU

Boz0r
Sep 7, 2006
The Rocketship in action.
I'm trying to build Clang and LLVM by following this guide: http://stackoverflow.com/questions/9427356/how-to-compile-clang-on-windows

But when I get to step 11, the compiler gives me an error:

code:
C:\src\llvm-3.5.0.src\tools\clang\lib\Driver\WindowsToolChain.cpp:32:0: warning: "NOMINMAX" redefined [enabled by default]
In file included from c:\mingw\bin\../lib/gcc/mingw32/4.7.2/include/c++/mingw32/bits/c++config.h:414:0,
                 from c:\mingw\bin\../lib/gcc/mingw32/4.7.2/include/c++/type_traits:38,
                 from C:/src/llvm-3.5.0.src/include/llvm/Support/type_traits.h:17,
                 from C:/src/llvm-3.5.0.src/include/llvm/Support/Casting.h:19,
                 from C:/src/llvm-3.5.0.src/tools/clang/include/clang/Basic/LLVM.h:22,
                 from C:/src/llvm-3.5.0.src/tools/clang/include/clang/Driver/Tool.h:13,
                 from C:\src\llvm-3.5.0.src\tools\clang\lib\Driver\Tools.h:13,
                 from C:\src\llvm-3.5.0.src\tools\clang\lib\Driver\ToolChains.h:13,
                 from C:\src\llvm-3.5.0.src\tools\clang\lib\Driver\WindowsToolChain.cpp:10:
c:\mingw\bin\../lib/gcc/mingw32/4.7.2/include/c++/mingw32/bits/os_defines.h:46:0: note: this is the location of the previous definition
C:\src\llvm-3.5.0.src\tools\clang\lib\Driver\WindowsToolChain.cpp: In function 'bool getSystemRegistryString(const char*, const char*, char*, size_t)':
C:\src\llvm-3.5.0.src\tools\clang\lib\Driver\WindowsToolChain.cpp:138:64: error: 'KEY_WOW64_32KEY' was not declared in this scope
C:\src\llvm-3.5.0.src\tools\clang\lib\Driver\WindowsToolChain.cpp:184:60: error: 'KEY_WOW64_32KEY' was not declared in this scope
tools\clang\lib\Driver\CMakeFiles\clangDriver.dir\build.make:318: recipe for target 'tools/clang/lib/Driver/CMakeFiles/clangDriver.dir/WindowsToolChain.cpp.obj' failed
mingw32-make[2]: *** [tools/clang/lib/Driver/CMakeFiles/clangDriver.dir/WindowsToolChain.cpp.obj] Error 1
CMakeFiles\Makefile2:11953: recipe for target 'tools/clang/lib/Driver/CMakeFiles/clangDriver.dir/all' failed
mingw32-make[1]: *** [tools/clang/lib/Driver/CMakeFiles/clangDriver.dir/all] Error 2
Makefile:136: recipe for target 'all' failed
mingw32-make: *** [all] Error 2
I assume the problem is the KEY_WOW64_32KEY value, but I don't know where it should be declared. Any advice?

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply