Undefined Symbols for Architecture X86_64: Which Architecture Should I Use

Undefined symbols for architecture x86_64: Which architecture should I use?

The error isn't that it's the wrong architecture, it's that std::cout (and other symbols) isn't defined.

You should compile and link with g++ not gcc, to automatically link with correct C++ libraries.

Undefined symbols for architecture x86_64 with Qt create

As Botje said in the comments dropping the namespace{} from globalvarible.cpp fixed it.

Undefined symbols for architecture x86_64 error when using multiple files

in C++ if you want to compile some code that is located in more than one file, you have to tell explicitly to the compiler where to find certain function, in this case the function add, so in order to achive this, you have to specify the files in to the compiler in this way:

g++ main.cpp add.cpp 

and after the compiling, the compiler will generate a a.out file with the compiled file, and to run it just do ./a.out.

Probably, Atom, not being a IDE for c++, just tries to compile that file, and the C++ compile can't find the function add in a object file (.o extension).

Undefined symbols for architecture x86_64 with QNetworkReply

Your declaration

void myOnFinishSlot(QNetworkReply* x)

Does not match your definition:

void myOnFinishSlot()

You effectively defined two methods with different overloads.

Either merge the definition and declaration:

public slots:
void myOnFinishSlot(QNetworkReply* x) { exit(); }

or move the definition outside of the class block:

void checkinapp::myOnFinishSlot(QNetworkReply* x) { exit(); }

Additionally, don't use the SIGNAL/SLOT notation, since it leads to hard-to-debug errors at runtime. Your connect call should be:

connect(m_networkManager, &QNetworkAccessManager::finished, this, &checkinapp::myOnFinishSlot);

Xcode 9 undefined symbols for architecture x86_64

When I ran build for profiling, it was working, but with classic build there were mentioned errors. After searching through logs it seems there is some weird behaviour with flags, particularly -fprofile-instr-generate. The solution was to set flag Enable Code Coverage to No in build settings of the library project. This was shooting into the dark but somehow got it working.



Related Topics



Leave a reply



Submit