Post

Replies

Boosts

Views

Activity

Cannot figure out a very basic issue...
Hello everyone. I've been dealing with this issue for over a month on my M1 MBP. I'm using CLion for C++. I cannot get any program I write to compile with g++/gcc. I have taken the following steps to remedy the issue: Update CLion, Reinstall CLion, Update and Reinstall CommandLineTools, Reinstall MacOS, reset the computer to default. I've tried everything I can think of to get this to behave how it was originally. The issue started when I updated to MacOS Ventura. I deeply, deeply regret upgrading at this point but have no way of going back. This is a very basic program I've written to demonstrate the issue. int main() { welcome(); } void welcome(){ std::cout << "Hello world"; } void welcome(); Very, very basic. The issue is that every single time I try to do g++ main.cpp, I get the following error. "welcome()", referenced from: _main in main-fbb48c.o ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation)
2
0
1.5k
Mar ’23
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I'm having a ton of trouble ever since updating to MacOS Ventura on my M1 Pro Macbook. I've tried everything but I have identified when the errors are actually occurring. When I call a function. I've written a very basic "Welcome" program below. The main.cpp file is as follows // C++ #include <iostream> #include "declareFuncs.h" int main() { welcome(); } and the "declareFuncs.h" is as follows // C++ #ifndef UNTITLED_DECLAREFUNCS_H #define UNTITLED_DECLAREFUNCS_H void welcome(); #endif //UNTITLED_DECLAREFUNCS_H and the function is defined in the following source file. // C++ #include <iostream> void welcome(){ std::cout << "Welcome!"; } As you can see, it's a very basic program and should compile fine. But when I go to compile it, the compiler spits this back at me and I cannot for the life of me find a solution. I'm tempted to go buy an external drive and rollback this update. Undefined symbols for architecture arm64: "welcome()", referenced from: _main in main-199bfc.o ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation) What's going wrong here? how can I fix this? It's beyond frustrating at this point.
3
0
4.2k
Jan ’23