Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

undefined references to `DisplayScreen::display_screen(MediaSource const&) #13

Open
onlytailei opened this issue Nov 12, 2015 · 4 comments

Comments

@onlytailei
Copy link

Hi, I use the caffe-dqn as the caffe, and when I do make, I got this.

CMakeFiles/dqn.dir/dqn_main.cpp.o: In function `PlayOneEpisode(ALEInterface&, dqn::DQN&, double, bool)':
dqn_main.cpp:(.text+0xd14): undefined reference to `DisplayScreen::display_screen(MediaSource const&)'
dqn_main.cpp:(.text+0x1124): undefined reference to `DisplayScreen::display_screen(MediaSource const&)'
CMakeFiles/dqn.dir/dqn_main.cpp.o: In function `PlayOneEpisode(ALEInterface&, dqn::DQN&, double, bool) [clone .constprop.106]':
dqn_main.cpp:(.text+0x2414): undefined reference to `DisplayScreen::display_screen(MediaSource const&)'
dqn_main.cpp:(.text+0x283c): undefined reference to `DisplayScreen::display_screen(MediaSource const&)'
CMakeFiles/dqn.dir/dqn_main.cpp.o: In function `main':
dqn_main.cpp:(.text.startup+0xc20): undefined reference to `DisplayScreen::display_screen(MediaSource const&)'
CMakeFiles/dqn.dir/dqn_main.cpp.o:dqn_main.cpp:(.text.startup+0x10a8): more undefined references to `DisplayScreen::display_screen(MediaSource const&)' follow
collect2: error: ld returned 1 exit status
make[2]: *** [dqn] Error 1
make[1]: *** [CMakeFiles/dqn.dir/all] Error 2
make: *** [all] Error 2

By the way, there are also some warnnings:

In file included from /home/tyler_asus/Software/dqn-in-the-caffe/dqn_main.cpp:3:0:
/home/tyler_asus/Software/ale_0.4.4/ale_0_4/src/ale_interface.hpp:124:28: warning: ‘auto_ptr’ is deprecated (declared at /usr/include/c++/4.8/backward/auto_ptr.h:87) [-Wdeprecated-declarations]
     std::auto_ptr<OSystem> theOSystem;
                            ^
/home/tyler_asus/Software/ale_0.4.4/ale_0_4/src/ale_interface.hpp:125:29: warning: ‘auto_ptr’ is deprecated (declared at /usr/include/c++/4.8/backward/auto_ptr.h:87) [-Wdeprecated-declarations]
     std::auto_ptr<Settings> theSettings;
                             ^
/home/tyler_asus/Software/ale_0.4.4/ale_0_4/src/ale_interface.hpp: In function ‘void createOSystem(int, char**, std::auto_ptr<OSystem>&, std::auto_ptr<Settings>&)’:
/home/tyler_asus/Software/ale_0.4.4/ale_0_4/src/ale_interface.hpp:84:49: warning: ignoring return value of ‘FILE* freopen(const char*, const char*, FILE*)’, declared with attribute warn_unused_result [-Wunused-result]
         freopen(outputFile.c_str(), "w", stdout);

@watts4speed
Copy link

I'm using the latest Caffe and I'm not seeing this, though I had to mess with the model and I've not got that to work yet :-( I've also see various warnings about auto pointers and those don't seem to be the problem. I'm either going to figure out how to get the model updated to run with the current caffe or go back to the old dqn-caffe as your doing.

@kilmarnock
Copy link

same problem here, using your caffe repository. Did you solve it?
Why does it happen during the link process?

Linking CXX executable dqn
CMakeFiles/dqn.dir/dqn_main.cpp.o: In function `PlayOneEpisode(ALEInterface&, dqn::DQN&, double, bool)':
dqn_main.cpp:(.text+0xd14): undefined reference to `DisplayScreen::display_screen(MediaSource const&)'
dqn_main.cpp:(.text+0x1124): undefined reference to `DisplayScreen::display_screen(MediaSource const&)'
CMakeFiles/dqn.dir/dqn_main.cpp.o: In function `PlayOneEpisode(ALEInterface&, dqn::DQN&, double, bool) [clone .constprop.108]':
dqn_main.cpp:(.text+0x2414): undefined reference to `DisplayScreen::display_screen(MediaSource const&)'
dqn_main.cpp:(.text+0x283c): undefined reference to `DisplayScreen::display_screen(MediaSource const&)'
CMakeFiles/dqn.dir/dqn_main.cpp.o: In function `main':
dqn_main.cpp:(.text.startup+0xc20): undefined reference to `DisplayScreen::display_screen(MediaSource const&)'
CMakeFiles/dqn.dir/dqn_main.cpp.o:dqn_main.cpp:(.text.startup+0x10a8): more undefined references to `DisplayScreen::display_screen(MediaSource const&)' follow
collect2: error: ld returned 1 exit status

According to your CMakeLists.txt, I use the same ale version 0.4.4

@kilmarnock
Copy link

The solution is to compile ale with USE_SDL := 1, even if you turned it off in CMakeFiles.txt

@onlytailei
Copy link
Author

Sorry kilmarnock.
I implement the dqn network in other environment but not the Atari game. So finally I did not use the SQL.
Hope you have solved it successfully.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants