I Cannot Embed My Header File to Main.cpp












0















I have a homework which is done with C++. I coded it using a Main.cpp and a header file (datastruct.h). Homework was done, compiled and run successfully; but submission rules allow me to use just one main.cpp. When I tried to include my code in header to main.cpp I get:



[main] C:cygnuscygwin-b20H-i586-cygwin32bing++.exe 1000 (0) handle_exceptions: Exception: STATUS_ACCESS_VIOLATION
[main] g++ 1000 (0) handle_exceptions: Dumping stack trace to g++.exe.core


Note that: My question is not just about this error, it is about I get this error only I embed my header code to main.cpp. When they are separated, it works fine.
Here is my main.cpp when header codes were not included:



#include <iostream>
#include <fstream>
#include "datastruct.h"
using namespace std;

int main(int argc, char *argv)
{
Game myGame;
myGame.initializer(argv[1]);
cout << myGame.gamePlay();
myGame.cleaner();

return 0;
}


And here is "datastruct.h":



#ifndef DATASTRUCT_H
#define DATASTRUCT_H

#include <iostream>
#include <fstream>
using namespace std;

int abs(int k) {
if(k < 0) k = -k;
return k;
}

struct Card {
int value;
Card* prev;
};

struct Deck {
Card* top ;
int cardNum;
void addCard(int xd);
int dropCard();
void create();
void clear();
void print();
};

void Deck::clear(/* arguments */) {
Card *p;
while(top)
{
p = top;
top = top -> prev;
delete p;
}
}

int Deck::dropCard(/* arguments */) {
Card* cardPtr;
int returnVal = top -> value;
cardPtr = top;
top = top -> prev;
delete cardPtr;
cardNum--;
return returnVal;
}

void Deck::create() {
cardNum = 0;
top = NULL;
}

void Deck::addCard(int xd) {
Card* newCard;
newCard = new struct Card;
newCard -> value = xd;
newCard -> prev = top;
top = newCard;
cardNum++;
}

struct Game {
Deck* p1;
Deck* p2;
Deck* table;
Deck* bin;
void initializer(char* filename);
void cleaner();
void gamePrint();
void p1gives();
void p2gives();
int gamePlay();
};

int Game::gamePlay()
{
int cardTaken;

while (true)
{
if((p1->cardNum ==0) || (p2->cardNum ==0) || (table->cardNum ==0)) break;

cardTaken = table->dropCard();
if (cardTaken < 0) {
for (int i = 0; i < abs(cardTaken); i++) {
if(p1->top == NULL) break;
p1gives();
}
} else {
for (int i = 0; i < cardTaken; i++) {
if(p2->top == NULL) break;
p2gives();
}
}

if((p1->cardNum ==0) || (p2->cardNum ==0) || (table->cardNum ==0)) break;

cardTaken = table->dropCard();
if (cardTaken < 0) {
for (int i = 0; i < abs(cardTaken); i++) {
if((p1->top == NULL) || (p2->top == NULL)) break;
p2gives();
}
} else {
for (int i = 0; i < cardTaken; i++) {
if((p1->top == NULL) || (p2->top == NULL)) break;
p1gives();
}
}
}
return (bin -> cardNum);
}

void Game::p1gives()
{
if(p2 -> top == NULL)
p2 -> addCard(p1 -> dropCard());
else if (p1 -> top -> value > p2 -> top -> value)
p2 -> addCard(p1 -> dropCard());
else if (p1 -> top -> value <= p2 -> top -> value)
bin -> addCard(p1 -> dropCard());
}

void Game::p2gives()
{
if (p1 -> top == NULL)
p1 -> addCard(p2 -> dropCard());
else if(p2 -> top -> value > p1 -> top -> value)
p1 -> addCard(p2 -> dropCard());
else if(p2 -> top -> value <= p1 -> top -> value)
bin -> addCard(p2 -> dropCard());
}

void Game::cleaner()
{
p1 -> clear();
p2 -> clear();
table -> clear();
bin -> clear();

delete p1;
delete p2;
delete table;
delete bin;
}

void Game::initializer(char* filename)
{
ifstream myFile(filename);
int tableDeckCount, playerDeckCount;
myFile >> tableDeckCount;
myFile >> playerDeckCount;

p1 = new struct Deck;
p1 -> create();
p2 = new struct Deck;
p2 -> create();
table = new struct Deck;
table -> create();
bin = new struct Deck;
bin -> create();

for (int i = 0; i < tableDeckCount; i++) {
int x;
myFile >> x;
table -> addCard(x);
}
for (int i = 0; i < playerDeckCount; i++) {
int x;
myFile >> x;
p1 -> addCard(x);
}
for (int i = 0; i < playerDeckCount; i++) {
int x;
myFile >> x;
p2 -> addCard(x);
}
}

void Deck::print(/* arguments */) {
Card* traverse;
traverse = top;
while (traverse) {
cout << traverse -> value << " , " ;
traverse = traverse -> prev;
}
cout << endl;
}

void Game::gamePrint()
{
cout << "P1:" << endl;
p1 -> print();
cout << "P2:" << endl;
p2 -> print();
cout << "TABLE:" << endl;
table -> print();
cout << "BIN:" << endl;
bin -> print();
}
#endif


I need to include header into main.cpp but when I copy codes I get error. Can someone help me?



Expected work example:



>g++ -std=c++0x -Wall -Wextra -Werror main.cpp -o cardgame 
>./cardgame example.game
1


example.game file:



1 3
-2
6
7
8
1
5
4









share|improve this question

























  • Maybe you're supposed to only have a single file, where you put everything from the header file literally inside the main.cpp source file?

    – Some programmer dude
    Nov 23 '18 at 12:39











  • Possible duplicate of C++ STATUS_ACCESS_VIOLATION error when program runs

    – Joshpbarron
    Nov 23 '18 at 12:40











  • why not debug "g++.exe.core" this core file present?!

    – Vineet Kumar
    Nov 23 '18 at 12:43











  • Cygwin B20 is twenty years old. I'm surprised it works at all.

    – molbdnilo
    Nov 23 '18 at 12:53


















0















I have a homework which is done with C++. I coded it using a Main.cpp and a header file (datastruct.h). Homework was done, compiled and run successfully; but submission rules allow me to use just one main.cpp. When I tried to include my code in header to main.cpp I get:



[main] C:cygnuscygwin-b20H-i586-cygwin32bing++.exe 1000 (0) handle_exceptions: Exception: STATUS_ACCESS_VIOLATION
[main] g++ 1000 (0) handle_exceptions: Dumping stack trace to g++.exe.core


Note that: My question is not just about this error, it is about I get this error only I embed my header code to main.cpp. When they are separated, it works fine.
Here is my main.cpp when header codes were not included:



#include <iostream>
#include <fstream>
#include "datastruct.h"
using namespace std;

int main(int argc, char *argv)
{
Game myGame;
myGame.initializer(argv[1]);
cout << myGame.gamePlay();
myGame.cleaner();

return 0;
}


And here is "datastruct.h":



#ifndef DATASTRUCT_H
#define DATASTRUCT_H

#include <iostream>
#include <fstream>
using namespace std;

int abs(int k) {
if(k < 0) k = -k;
return k;
}

struct Card {
int value;
Card* prev;
};

struct Deck {
Card* top ;
int cardNum;
void addCard(int xd);
int dropCard();
void create();
void clear();
void print();
};

void Deck::clear(/* arguments */) {
Card *p;
while(top)
{
p = top;
top = top -> prev;
delete p;
}
}

int Deck::dropCard(/* arguments */) {
Card* cardPtr;
int returnVal = top -> value;
cardPtr = top;
top = top -> prev;
delete cardPtr;
cardNum--;
return returnVal;
}

void Deck::create() {
cardNum = 0;
top = NULL;
}

void Deck::addCard(int xd) {
Card* newCard;
newCard = new struct Card;
newCard -> value = xd;
newCard -> prev = top;
top = newCard;
cardNum++;
}

struct Game {
Deck* p1;
Deck* p2;
Deck* table;
Deck* bin;
void initializer(char* filename);
void cleaner();
void gamePrint();
void p1gives();
void p2gives();
int gamePlay();
};

int Game::gamePlay()
{
int cardTaken;

while (true)
{
if((p1->cardNum ==0) || (p2->cardNum ==0) || (table->cardNum ==0)) break;

cardTaken = table->dropCard();
if (cardTaken < 0) {
for (int i = 0; i < abs(cardTaken); i++) {
if(p1->top == NULL) break;
p1gives();
}
} else {
for (int i = 0; i < cardTaken; i++) {
if(p2->top == NULL) break;
p2gives();
}
}

if((p1->cardNum ==0) || (p2->cardNum ==0) || (table->cardNum ==0)) break;

cardTaken = table->dropCard();
if (cardTaken < 0) {
for (int i = 0; i < abs(cardTaken); i++) {
if((p1->top == NULL) || (p2->top == NULL)) break;
p2gives();
}
} else {
for (int i = 0; i < cardTaken; i++) {
if((p1->top == NULL) || (p2->top == NULL)) break;
p1gives();
}
}
}
return (bin -> cardNum);
}

void Game::p1gives()
{
if(p2 -> top == NULL)
p2 -> addCard(p1 -> dropCard());
else if (p1 -> top -> value > p2 -> top -> value)
p2 -> addCard(p1 -> dropCard());
else if (p1 -> top -> value <= p2 -> top -> value)
bin -> addCard(p1 -> dropCard());
}

void Game::p2gives()
{
if (p1 -> top == NULL)
p1 -> addCard(p2 -> dropCard());
else if(p2 -> top -> value > p1 -> top -> value)
p1 -> addCard(p2 -> dropCard());
else if(p2 -> top -> value <= p1 -> top -> value)
bin -> addCard(p2 -> dropCard());
}

void Game::cleaner()
{
p1 -> clear();
p2 -> clear();
table -> clear();
bin -> clear();

delete p1;
delete p2;
delete table;
delete bin;
}

void Game::initializer(char* filename)
{
ifstream myFile(filename);
int tableDeckCount, playerDeckCount;
myFile >> tableDeckCount;
myFile >> playerDeckCount;

p1 = new struct Deck;
p1 -> create();
p2 = new struct Deck;
p2 -> create();
table = new struct Deck;
table -> create();
bin = new struct Deck;
bin -> create();

for (int i = 0; i < tableDeckCount; i++) {
int x;
myFile >> x;
table -> addCard(x);
}
for (int i = 0; i < playerDeckCount; i++) {
int x;
myFile >> x;
p1 -> addCard(x);
}
for (int i = 0; i < playerDeckCount; i++) {
int x;
myFile >> x;
p2 -> addCard(x);
}
}

void Deck::print(/* arguments */) {
Card* traverse;
traverse = top;
while (traverse) {
cout << traverse -> value << " , " ;
traverse = traverse -> prev;
}
cout << endl;
}

void Game::gamePrint()
{
cout << "P1:" << endl;
p1 -> print();
cout << "P2:" << endl;
p2 -> print();
cout << "TABLE:" << endl;
table -> print();
cout << "BIN:" << endl;
bin -> print();
}
#endif


I need to include header into main.cpp but when I copy codes I get error. Can someone help me?



Expected work example:



>g++ -std=c++0x -Wall -Wextra -Werror main.cpp -o cardgame 
>./cardgame example.game
1


example.game file:



1 3
-2
6
7
8
1
5
4









share|improve this question

























  • Maybe you're supposed to only have a single file, where you put everything from the header file literally inside the main.cpp source file?

    – Some programmer dude
    Nov 23 '18 at 12:39











  • Possible duplicate of C++ STATUS_ACCESS_VIOLATION error when program runs

    – Joshpbarron
    Nov 23 '18 at 12:40











  • why not debug "g++.exe.core" this core file present?!

    – Vineet Kumar
    Nov 23 '18 at 12:43











  • Cygwin B20 is twenty years old. I'm surprised it works at all.

    – molbdnilo
    Nov 23 '18 at 12:53
















0












0








0








I have a homework which is done with C++. I coded it using a Main.cpp and a header file (datastruct.h). Homework was done, compiled and run successfully; but submission rules allow me to use just one main.cpp. When I tried to include my code in header to main.cpp I get:



[main] C:cygnuscygwin-b20H-i586-cygwin32bing++.exe 1000 (0) handle_exceptions: Exception: STATUS_ACCESS_VIOLATION
[main] g++ 1000 (0) handle_exceptions: Dumping stack trace to g++.exe.core


Note that: My question is not just about this error, it is about I get this error only I embed my header code to main.cpp. When they are separated, it works fine.
Here is my main.cpp when header codes were not included:



#include <iostream>
#include <fstream>
#include "datastruct.h"
using namespace std;

int main(int argc, char *argv)
{
Game myGame;
myGame.initializer(argv[1]);
cout << myGame.gamePlay();
myGame.cleaner();

return 0;
}


And here is "datastruct.h":



#ifndef DATASTRUCT_H
#define DATASTRUCT_H

#include <iostream>
#include <fstream>
using namespace std;

int abs(int k) {
if(k < 0) k = -k;
return k;
}

struct Card {
int value;
Card* prev;
};

struct Deck {
Card* top ;
int cardNum;
void addCard(int xd);
int dropCard();
void create();
void clear();
void print();
};

void Deck::clear(/* arguments */) {
Card *p;
while(top)
{
p = top;
top = top -> prev;
delete p;
}
}

int Deck::dropCard(/* arguments */) {
Card* cardPtr;
int returnVal = top -> value;
cardPtr = top;
top = top -> prev;
delete cardPtr;
cardNum--;
return returnVal;
}

void Deck::create() {
cardNum = 0;
top = NULL;
}

void Deck::addCard(int xd) {
Card* newCard;
newCard = new struct Card;
newCard -> value = xd;
newCard -> prev = top;
top = newCard;
cardNum++;
}

struct Game {
Deck* p1;
Deck* p2;
Deck* table;
Deck* bin;
void initializer(char* filename);
void cleaner();
void gamePrint();
void p1gives();
void p2gives();
int gamePlay();
};

int Game::gamePlay()
{
int cardTaken;

while (true)
{
if((p1->cardNum ==0) || (p2->cardNum ==0) || (table->cardNum ==0)) break;

cardTaken = table->dropCard();
if (cardTaken < 0) {
for (int i = 0; i < abs(cardTaken); i++) {
if(p1->top == NULL) break;
p1gives();
}
} else {
for (int i = 0; i < cardTaken; i++) {
if(p2->top == NULL) break;
p2gives();
}
}

if((p1->cardNum ==0) || (p2->cardNum ==0) || (table->cardNum ==0)) break;

cardTaken = table->dropCard();
if (cardTaken < 0) {
for (int i = 0; i < abs(cardTaken); i++) {
if((p1->top == NULL) || (p2->top == NULL)) break;
p2gives();
}
} else {
for (int i = 0; i < cardTaken; i++) {
if((p1->top == NULL) || (p2->top == NULL)) break;
p1gives();
}
}
}
return (bin -> cardNum);
}

void Game::p1gives()
{
if(p2 -> top == NULL)
p2 -> addCard(p1 -> dropCard());
else if (p1 -> top -> value > p2 -> top -> value)
p2 -> addCard(p1 -> dropCard());
else if (p1 -> top -> value <= p2 -> top -> value)
bin -> addCard(p1 -> dropCard());
}

void Game::p2gives()
{
if (p1 -> top == NULL)
p1 -> addCard(p2 -> dropCard());
else if(p2 -> top -> value > p1 -> top -> value)
p1 -> addCard(p2 -> dropCard());
else if(p2 -> top -> value <= p1 -> top -> value)
bin -> addCard(p2 -> dropCard());
}

void Game::cleaner()
{
p1 -> clear();
p2 -> clear();
table -> clear();
bin -> clear();

delete p1;
delete p2;
delete table;
delete bin;
}

void Game::initializer(char* filename)
{
ifstream myFile(filename);
int tableDeckCount, playerDeckCount;
myFile >> tableDeckCount;
myFile >> playerDeckCount;

p1 = new struct Deck;
p1 -> create();
p2 = new struct Deck;
p2 -> create();
table = new struct Deck;
table -> create();
bin = new struct Deck;
bin -> create();

for (int i = 0; i < tableDeckCount; i++) {
int x;
myFile >> x;
table -> addCard(x);
}
for (int i = 0; i < playerDeckCount; i++) {
int x;
myFile >> x;
p1 -> addCard(x);
}
for (int i = 0; i < playerDeckCount; i++) {
int x;
myFile >> x;
p2 -> addCard(x);
}
}

void Deck::print(/* arguments */) {
Card* traverse;
traverse = top;
while (traverse) {
cout << traverse -> value << " , " ;
traverse = traverse -> prev;
}
cout << endl;
}

void Game::gamePrint()
{
cout << "P1:" << endl;
p1 -> print();
cout << "P2:" << endl;
p2 -> print();
cout << "TABLE:" << endl;
table -> print();
cout << "BIN:" << endl;
bin -> print();
}
#endif


I need to include header into main.cpp but when I copy codes I get error. Can someone help me?



Expected work example:



>g++ -std=c++0x -Wall -Wextra -Werror main.cpp -o cardgame 
>./cardgame example.game
1


example.game file:



1 3
-2
6
7
8
1
5
4









share|improve this question
















I have a homework which is done with C++. I coded it using a Main.cpp and a header file (datastruct.h). Homework was done, compiled and run successfully; but submission rules allow me to use just one main.cpp. When I tried to include my code in header to main.cpp I get:



[main] C:cygnuscygwin-b20H-i586-cygwin32bing++.exe 1000 (0) handle_exceptions: Exception: STATUS_ACCESS_VIOLATION
[main] g++ 1000 (0) handle_exceptions: Dumping stack trace to g++.exe.core


Note that: My question is not just about this error, it is about I get this error only I embed my header code to main.cpp. When they are separated, it works fine.
Here is my main.cpp when header codes were not included:



#include <iostream>
#include <fstream>
#include "datastruct.h"
using namespace std;

int main(int argc, char *argv)
{
Game myGame;
myGame.initializer(argv[1]);
cout << myGame.gamePlay();
myGame.cleaner();

return 0;
}


And here is "datastruct.h":



#ifndef DATASTRUCT_H
#define DATASTRUCT_H

#include <iostream>
#include <fstream>
using namespace std;

int abs(int k) {
if(k < 0) k = -k;
return k;
}

struct Card {
int value;
Card* prev;
};

struct Deck {
Card* top ;
int cardNum;
void addCard(int xd);
int dropCard();
void create();
void clear();
void print();
};

void Deck::clear(/* arguments */) {
Card *p;
while(top)
{
p = top;
top = top -> prev;
delete p;
}
}

int Deck::dropCard(/* arguments */) {
Card* cardPtr;
int returnVal = top -> value;
cardPtr = top;
top = top -> prev;
delete cardPtr;
cardNum--;
return returnVal;
}

void Deck::create() {
cardNum = 0;
top = NULL;
}

void Deck::addCard(int xd) {
Card* newCard;
newCard = new struct Card;
newCard -> value = xd;
newCard -> prev = top;
top = newCard;
cardNum++;
}

struct Game {
Deck* p1;
Deck* p2;
Deck* table;
Deck* bin;
void initializer(char* filename);
void cleaner();
void gamePrint();
void p1gives();
void p2gives();
int gamePlay();
};

int Game::gamePlay()
{
int cardTaken;

while (true)
{
if((p1->cardNum ==0) || (p2->cardNum ==0) || (table->cardNum ==0)) break;

cardTaken = table->dropCard();
if (cardTaken < 0) {
for (int i = 0; i < abs(cardTaken); i++) {
if(p1->top == NULL) break;
p1gives();
}
} else {
for (int i = 0; i < cardTaken; i++) {
if(p2->top == NULL) break;
p2gives();
}
}

if((p1->cardNum ==0) || (p2->cardNum ==0) || (table->cardNum ==0)) break;

cardTaken = table->dropCard();
if (cardTaken < 0) {
for (int i = 0; i < abs(cardTaken); i++) {
if((p1->top == NULL) || (p2->top == NULL)) break;
p2gives();
}
} else {
for (int i = 0; i < cardTaken; i++) {
if((p1->top == NULL) || (p2->top == NULL)) break;
p1gives();
}
}
}
return (bin -> cardNum);
}

void Game::p1gives()
{
if(p2 -> top == NULL)
p2 -> addCard(p1 -> dropCard());
else if (p1 -> top -> value > p2 -> top -> value)
p2 -> addCard(p1 -> dropCard());
else if (p1 -> top -> value <= p2 -> top -> value)
bin -> addCard(p1 -> dropCard());
}

void Game::p2gives()
{
if (p1 -> top == NULL)
p1 -> addCard(p2 -> dropCard());
else if(p2 -> top -> value > p1 -> top -> value)
p1 -> addCard(p2 -> dropCard());
else if(p2 -> top -> value <= p1 -> top -> value)
bin -> addCard(p2 -> dropCard());
}

void Game::cleaner()
{
p1 -> clear();
p2 -> clear();
table -> clear();
bin -> clear();

delete p1;
delete p2;
delete table;
delete bin;
}

void Game::initializer(char* filename)
{
ifstream myFile(filename);
int tableDeckCount, playerDeckCount;
myFile >> tableDeckCount;
myFile >> playerDeckCount;

p1 = new struct Deck;
p1 -> create();
p2 = new struct Deck;
p2 -> create();
table = new struct Deck;
table -> create();
bin = new struct Deck;
bin -> create();

for (int i = 0; i < tableDeckCount; i++) {
int x;
myFile >> x;
table -> addCard(x);
}
for (int i = 0; i < playerDeckCount; i++) {
int x;
myFile >> x;
p1 -> addCard(x);
}
for (int i = 0; i < playerDeckCount; i++) {
int x;
myFile >> x;
p2 -> addCard(x);
}
}

void Deck::print(/* arguments */) {
Card* traverse;
traverse = top;
while (traverse) {
cout << traverse -> value << " , " ;
traverse = traverse -> prev;
}
cout << endl;
}

void Game::gamePrint()
{
cout << "P1:" << endl;
p1 -> print();
cout << "P2:" << endl;
p2 -> print();
cout << "TABLE:" << endl;
table -> print();
cout << "BIN:" << endl;
bin -> print();
}
#endif


I need to include header into main.cpp but when I copy codes I get error. Can someone help me?



Expected work example:



>g++ -std=c++0x -Wall -Wextra -Werror main.cpp -o cardgame 
>./cardgame example.game
1


example.game file:



1 3
-2
6
7
8
1
5
4






c++






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 23 '18 at 12:49

























asked Nov 23 '18 at 12:35







user10615429




















  • Maybe you're supposed to only have a single file, where you put everything from the header file literally inside the main.cpp source file?

    – Some programmer dude
    Nov 23 '18 at 12:39











  • Possible duplicate of C++ STATUS_ACCESS_VIOLATION error when program runs

    – Joshpbarron
    Nov 23 '18 at 12:40











  • why not debug "g++.exe.core" this core file present?!

    – Vineet Kumar
    Nov 23 '18 at 12:43











  • Cygwin B20 is twenty years old. I'm surprised it works at all.

    – molbdnilo
    Nov 23 '18 at 12:53





















  • Maybe you're supposed to only have a single file, where you put everything from the header file literally inside the main.cpp source file?

    – Some programmer dude
    Nov 23 '18 at 12:39











  • Possible duplicate of C++ STATUS_ACCESS_VIOLATION error when program runs

    – Joshpbarron
    Nov 23 '18 at 12:40











  • why not debug "g++.exe.core" this core file present?!

    – Vineet Kumar
    Nov 23 '18 at 12:43











  • Cygwin B20 is twenty years old. I'm surprised it works at all.

    – molbdnilo
    Nov 23 '18 at 12:53



















Maybe you're supposed to only have a single file, where you put everything from the header file literally inside the main.cpp source file?

– Some programmer dude
Nov 23 '18 at 12:39





Maybe you're supposed to only have a single file, where you put everything from the header file literally inside the main.cpp source file?

– Some programmer dude
Nov 23 '18 at 12:39













Possible duplicate of C++ STATUS_ACCESS_VIOLATION error when program runs

– Joshpbarron
Nov 23 '18 at 12:40





Possible duplicate of C++ STATUS_ACCESS_VIOLATION error when program runs

– Joshpbarron
Nov 23 '18 at 12:40













why not debug "g++.exe.core" this core file present?!

– Vineet Kumar
Nov 23 '18 at 12:43





why not debug "g++.exe.core" this core file present?!

– Vineet Kumar
Nov 23 '18 at 12:43













Cygwin B20 is twenty years old. I'm surprised it works at all.

– molbdnilo
Nov 23 '18 at 12:53







Cygwin B20 is twenty years old. I'm surprised it works at all.

– molbdnilo
Nov 23 '18 at 12:53














1 Answer
1






active

oldest

votes


















0














Run the compilation in elevated privileges on Windows? (right-click run as administrator) /edit. Right-click on sh.exe for cygwin and go to compatibility and check the box "run as administrator")



also, for reference to those who negatively voted: https://developer.qualcomm.com/forum/qdn-forums/mobile-technologies/multimedia-optimization-hexagon-sdk/toolsinstallation/27100






share|improve this answer





















  • 2





    Thank you very much, it worked. But can you explain or give me link about why I need to use administrator mode?

    – user10615429
    Nov 23 '18 at 12:44











  • Great it worked! I'm glad. The link should contain a short description, but basically it is windows UAC stopping the correct execution trying to protect your file system from potential virusses that can modify it. I'm not AS technically capable of explaining it though, sorry :) remember to mark as the answer if you're happy!

    – zuckerburg
    Nov 23 '18 at 12:51











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53446829%2fi-cannot-embed-my-header-file-to-main-cpp%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown
























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














Run the compilation in elevated privileges on Windows? (right-click run as administrator) /edit. Right-click on sh.exe for cygwin and go to compatibility and check the box "run as administrator")



also, for reference to those who negatively voted: https://developer.qualcomm.com/forum/qdn-forums/mobile-technologies/multimedia-optimization-hexagon-sdk/toolsinstallation/27100






share|improve this answer





















  • 2





    Thank you very much, it worked. But can you explain or give me link about why I need to use administrator mode?

    – user10615429
    Nov 23 '18 at 12:44











  • Great it worked! I'm glad. The link should contain a short description, but basically it is windows UAC stopping the correct execution trying to protect your file system from potential virusses that can modify it. I'm not AS technically capable of explaining it though, sorry :) remember to mark as the answer if you're happy!

    – zuckerburg
    Nov 23 '18 at 12:51
















0














Run the compilation in elevated privileges on Windows? (right-click run as administrator) /edit. Right-click on sh.exe for cygwin and go to compatibility and check the box "run as administrator")



also, for reference to those who negatively voted: https://developer.qualcomm.com/forum/qdn-forums/mobile-technologies/multimedia-optimization-hexagon-sdk/toolsinstallation/27100






share|improve this answer





















  • 2





    Thank you very much, it worked. But can you explain or give me link about why I need to use administrator mode?

    – user10615429
    Nov 23 '18 at 12:44











  • Great it worked! I'm glad. The link should contain a short description, but basically it is windows UAC stopping the correct execution trying to protect your file system from potential virusses that can modify it. I'm not AS technically capable of explaining it though, sorry :) remember to mark as the answer if you're happy!

    – zuckerburg
    Nov 23 '18 at 12:51














0












0








0







Run the compilation in elevated privileges on Windows? (right-click run as administrator) /edit. Right-click on sh.exe for cygwin and go to compatibility and check the box "run as administrator")



also, for reference to those who negatively voted: https://developer.qualcomm.com/forum/qdn-forums/mobile-technologies/multimedia-optimization-hexagon-sdk/toolsinstallation/27100






share|improve this answer















Run the compilation in elevated privileges on Windows? (right-click run as administrator) /edit. Right-click on sh.exe for cygwin and go to compatibility and check the box "run as administrator")



also, for reference to those who negatively voted: https://developer.qualcomm.com/forum/qdn-forums/mobile-technologies/multimedia-optimization-hexagon-sdk/toolsinstallation/27100







share|improve this answer














share|improve this answer



share|improve this answer








edited Dec 1 '18 at 10:35









Yvette Colomb

20.3k1470110




20.3k1470110










answered Nov 23 '18 at 12:39









zuckerburgzuckerburg

35916




35916








  • 2





    Thank you very much, it worked. But can you explain or give me link about why I need to use administrator mode?

    – user10615429
    Nov 23 '18 at 12:44











  • Great it worked! I'm glad. The link should contain a short description, but basically it is windows UAC stopping the correct execution trying to protect your file system from potential virusses that can modify it. I'm not AS technically capable of explaining it though, sorry :) remember to mark as the answer if you're happy!

    – zuckerburg
    Nov 23 '18 at 12:51














  • 2





    Thank you very much, it worked. But can you explain or give me link about why I need to use administrator mode?

    – user10615429
    Nov 23 '18 at 12:44











  • Great it worked! I'm glad. The link should contain a short description, but basically it is windows UAC stopping the correct execution trying to protect your file system from potential virusses that can modify it. I'm not AS technically capable of explaining it though, sorry :) remember to mark as the answer if you're happy!

    – zuckerburg
    Nov 23 '18 at 12:51








2




2





Thank you very much, it worked. But can you explain or give me link about why I need to use administrator mode?

– user10615429
Nov 23 '18 at 12:44





Thank you very much, it worked. But can you explain or give me link about why I need to use administrator mode?

– user10615429
Nov 23 '18 at 12:44













Great it worked! I'm glad. The link should contain a short description, but basically it is windows UAC stopping the correct execution trying to protect your file system from potential virusses that can modify it. I'm not AS technically capable of explaining it though, sorry :) remember to mark as the answer if you're happy!

– zuckerburg
Nov 23 '18 at 12:51





Great it worked! I'm glad. The link should contain a short description, but basically it is windows UAC stopping the correct execution trying to protect your file system from potential virusses that can modify it. I'm not AS technically capable of explaining it though, sorry :) remember to mark as the answer if you're happy!

– zuckerburg
Nov 23 '18 at 12:51




















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53446829%2fi-cannot-embed-my-header-file-to-main-cpp%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Tonle Sap (See)

I get strange results when I access the Sqlitedatabase with Unity C# via XAMPP

Guatemaltekische Davis-Cup-Mannschaft