@yuma_t wrote:
Please tell me what I did wrong.
Hi I'm new to oF and programming.
I've been trying to develop my VJ application and add ofxLaunchControlXL to the application. However, I there is one error and I can't solve it:
ld: 2 duplicate symbols for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)
That addon's example has only cpp file, and there was no problem while compiling.
But if I change these 3 files main.cpp, ofApp.h, ofApp.cpp, that error appears.So I guess the reason is because I rewrote to those 3 files.
Please tell me what I did wrong.
ofApp.h
#pragma once #include "ofMain.h" #include "ofxLaunchControl.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 mouseEntered(int x, int y); void mouseExited(int x, int y); void windowResized(int w, int h); void dragEvent(ofDragInfo dragInfo); void gotMessage(ofMessage msg); ofxLaunchControlXL control; ofFloatColor fg, bg; bool toggle_button, not_toggle_button; int fader_values[8]; };
ofApp.cpp
void ofApp::setup(){ control.setup(); control.registerValue(fg.r, ofxLaunchControlXL::TopKnob, 0, ofxLaunchControlXL::LedColorGreen); control.registerValue(fg.g, ofxLaunchControlXL::TopKnob, 1, ofxLaunchControlXL::LedColorRed); control.registerValue(fg.b, ofxLaunchControlXL::TopKnob, 2, ofxLaunchControlXL::LedColorYellow); control.registerValue(bg.r, ofxLaunchControlXL::CenterKnob, 0, ofxLaunchControlXL::LedColorGreenFullRange); control.registerValue(bg.g, ofxLaunchControlXL::CenterKnob, 1, ofxLaunchControlXL::LedColorRedFullRange); control.registerValue(bg.b, ofxLaunchControlXL::CenterKnob, 2, ofxLaunchControlXL::LedColorYellowFullRange); control.registerValueAsToggle(toggle_button, ofxLaunchControlXL::TopButton, 0, ofxLaunchControlXL::LedColorGreen); control.registerValue(not_toggle_button, ofxLaunchControlXL::TopButton, 1, ofxLaunchControlXL::LedColorRedFullRange); for(int i = 0; i < 8; i++) { control.registerValue(fader_values[i], ofxLaunchControlXL::Fader, i); } control.setTemplate(0); ofSetRectMode(OF_RECTMODE_CENTER); }
Thanks in advance.
Posts: 2
Participants: 2