Architecture Error or Syntax Error?

I’m getting this error, as begginer in OF, I don’t know if this error is about my code, classes or the compiler.

I’m running Mavericks 10.9
Deployment target is: 10.9
BASE SDK - Lastest OS X

Undefined symbols for architecture i386:
"ofAleixo::ofAleixo()", referenced from:
  _main in main.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

This is my code

//ofAleixo.h

#ifndef OFALEIXO_H
#define OFALEIXO_H
#include "../ofApp.h"

class ofAleixo {
    public:
        void setup();
        void update();
        void draw();
        ofAleixo();
};

#endif // OFALEIXO_H

//ofAleixo.cpp
#include "ofAleixo.h"
//--------------------------------------------------------------
ofAleixo::ofAleixo(){}
//--------------------------------------------------------------
void ofAleixo::setup(){}
//--------------------------------------------------------------
void ofAleixo::update(){}
//--------------------------------------------------------------
void ofAleixo::draw(){
    ofCircle(200, 300, 60);
}

//ofApp.cpp
#include "ofApp.h"
//--------------------------------------------------------------
void ofApp::setup(){}
//--------------------------------------------------------------
void ofApp::update(){}
//--------------------------------------------------------------
void ofApp::draw(){
    ofSetColor(255, 0, 255);
    ofCircle(500, 300, 100);
    canvas1.draw();
}

//ofApp.h
#pragma once

#include "ofMain.h"
#include "of_aleixo/ofAleixo.h"

class ofApp : public ofBaseApp{

    public:
        void setup();
        void update();
        void draw();

        void keyPressed(int key);
        void keyReleased(int key);
        void mouseMoved(int x, int y );
        void mouseDragged(int x, int y, int button);
        void mousePressed(int x, int y, int button);
        void mouseReleased(int x, int y, int button);
        void windowResized(int w, int h);
        void dragEvent(ofDragInfo dragInfo);
        void gotMessage(ofMessage msg);
        
        ofAleixo canvas1;
    
        
};

Thanks in advance.

UPDATE

I changed the setup to 64 bits, Intel, other versions and I’m still getting different kinds of errors.

check if the file ofAlexio.cpp is in your compile sources. click on the project in the navigator then go to build phases. That error means that the function ofAleixo::ofAleixo() is not defined.

1 Like

Well, a lot of things.

First, I renamed the folders and classes to keep well coded:

of_Aleixo -----> OFAleixo

Second, when I put the code I answered to put files relative to group.

And third,

I changed this include

#include "/OFAleixo/OFAleixo.h"

to

#include "OFAleixo.h"