Raised This Month: $12 Target: $400
 3% 

Solved Undefined symbol GetCPUInformation


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Benoist3012
Veteran Member
Join Date: Mar 2014
Location: CWave::ForceFinish()
Old 03-10-2017 , 16:36   Undefined symbol GetCPUInformation
Reply With Quote #1

Hello everyone, I've been running lately into an issue with my sourcemod extension, everytime I try to load it, here what happens:
[04] <FAILED> file "testextension.ext.2.tf2.so": extensionpathhere: undefined symbol: GetCPUInformation

So I visited the sdk2013 repo, I saw that:
https://github.com/alliedmodders/hl2...atform.h#L1224
I included the header hoping it would solve my problem, but I knew it wouldn't, and yeah it didn't solve the problem.
And right now I'm clueless on how solving it, so any help on that would be highly appreciated
__________________

Last edited by Benoist3012; 03-11-2017 at 09:51. Reason: Solved
Benoist3012 is offline
psychonic

BAFFLED
Join Date: May 2008
Old 03-11-2017 , 07:37   Re: Undefined symbol GetCPUInformation
Reply With Quote #2

Tier0 isn't being linked.
psychonic is offline
Benoist3012
Veteran Member
Join Date: Mar 2014
Location: CWave::ForceFinish()
Old 03-11-2017 , 08:51   Re: Undefined symbol GetCPUInformation
Reply With Quote #3

ldd -d "/home/benoist3012/Desktop/tf2 pluginbot/build/pluginbot.ext.2.tf2/pluginbot.ext.2.tf2.so"
linux-gate.so.1 => (0xf77bf000)
libstdc++.so.6 => /usr/lib/i386-linux-gnu/libstdc++.so.6 (0xf75c5000)
libm.so.6 => /lib/i386-linux-gnu/libm.so.6 (0xf7570000)
libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xf73b9000)
/lib/ld-linux.so.2 (0x56633000)
libgcc_s.so.1 => /lib/i386-linux-gnu/libgcc_s.so.1 (0xf739c000)
undefined symbol: GetCPUInformation(/home/benoist3012/Desktop/tf2 pluginbot/build/pluginbot.ext.2.tf2/pluginbot.ext.2.tf2.so)

It's not linked yeah.

Isn't this script https://github.com/alliedmodders/sou...ript#L312#L319
https://github.com/alliedmodders/sou...ript#L386#L391
supposed to add them?
__________________

Last edited by Benoist3012; 03-11-2017 at 09:01.
Benoist3012 is offline
psychonic

BAFFLED
Join Date: May 2008
Old 03-11-2017 , 09:02   Re: Undefined symbol GetCPUInformation
Reply With Quote #4

I believe that the generated command line order is improper for GCC, which causes tier0 and vstdlib to get skipped. It should work on Clang, or you can figure out what the order needs to be and fix the script.
psychonic is offline
Benoist3012
Veteran Member
Join Date: Mar 2014
Location: CWave::ForceFinish()
Old 03-11-2017 , 09:31   Re: Undefined symbol GetCPUInformation
Reply With Quote #5

Ah well now they are "added" but not found.
ldd -d "/home/benoist3012/Desktop/tf2 pluginbot/build/pluginbot.ext.2.tf2/pluginbot.ext.2.tf2.so"
linux-gate.so.1 => (0xf7718000)
libvstdlib_srv.so => not found
libtier0_srv.so => not found
libm.so.6 => /lib/i386-linux-gnu/libm.so.6 (0xf7645000)
libstdc++.so.6 => /usr/lib/i386-linux-gnu/libstdc++.so.6 (0xf74ce000)
libgcc_s.so.1 => /lib/i386-linux-gnu/libgcc_s.so.1 (0xf74b1000)
libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xf72fb000)
/lib/ld-linux.so.2 (0x565c2000)
undefined symbol: GetCPUInformation (/home/benoist3012/Desktop/tf2 pluginbot/build/pluginbot.ext.2.tf2/pluginbot.ext.2.tf2.so)
__________________
Benoist3012 is offline
psychonic

BAFFLED
Join Date: May 2008
Old 03-11-2017 , 09:40   Re: Undefined symbol GetCPUInformation
Reply With Quote #6

They should be at runtime. If you want ldd to find them, you'll have to pass it the same LD_LIBRARY_PATH that the srcds_run script passes to the srcds binary. (Basically making sure that the engine bin directory is included).

Last edited by psychonic; 03-11-2017 at 10:02. Reason: i <2 typos
psychonic is offline
Benoist3012
Veteran Member
Join Date: Mar 2014
Location: CWave::ForceFinish()
Old 03-11-2017 , 09:51   Re: Undefined symbol GetCPUInformation
Reply With Quote #7

Yeah I talked too early it loads fine now thanks!
__________________
Benoist3012 is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 13:17.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode