Jump to content
×
×
  • Create New...
  • 0

Source won't build with clang


SirBLARGH

Question

Hey there,

 

I'm currently compiling the source on clang but it just won't work.

cipher has always problems with cryptopp at linking stage. The funny part is that the compilation works without any errors but linking always fails. I've removed everything with cryptopp and compiled a new one with clang and -std=libc++ and cryptopp builds perfectly fine. But whenever I try to link against cryptopp it won't work.

 

I've used -v to make sure you're able to see what I did:

clang version 3.7.0 (trunk)clang version 3.7.0 (trunk)

Target: Target: i386-portbld-freebsd9.3i386-portbld-freebsd9.3

Thread model: posixThread model:
posix
 "/usr/bin/ld" --eh-frame-hdr -dynamic-linker /libexec/ld-elf.so.1 --hash-style=both --enable-new-dtags -m elf_i386_fbsd -o ../game_test_striped /usr/lib/crt1.o /usr/lib/crti.o /usr/lib/crtbegin.o -L../../libdevil -L../../libmysql/9.x -L../../../Extern/lib -L../../libthecore/lib -L../../libpoly  -L../../libsql "-L../../libgame/lib/ u-L../../liblua/libs r-L../../libserverkey -L/usr/local/lib -L/usr/lib -rpath/ b/usr/local/lib32/metin2i n--strip-all/ OBJDIR/minilzo.ol OBJDIR/BattleArena.od "OBJDIR/FSM.o  OBJDIR/MarkConvert.o OBJDIR/MarkImage.o OBJDIR/MarkManager.o OBJDIR/OXEvent.o--eh-frame-hdr  OBJDIR/TrafficProfiler.o-dynamic-linker  OBJDIR/ani.o/libexec/ld-elf.so.1  OBJDIR/arena.o--hash-style=both  OBJDIR/banword.o--enable-new-dtags  OBJDIR/battle.o-m  OBJDIR/blend_item.o OBJDIR/block_country.o OBJDIR/buffer_manager.o OBJDIR/building.o elf_i386_fbsdOBJDIR/castle.o  OBJDIR/char.o-o  OBJDIR/char_affect.o../game_test_32 OBJDIR/char_battle.o OBJDIR/char_change_empire.o OBJDIR/char_horse.o  OBJDIR/char_item.o/usr/lib/crt1.o  OBJDIR/char_manager.o/usr/lib/crti.o  OBJDIR/char_quickslot.o/usr/lib/crtbegin.o  OBJDIR/char_resist.o-L../../libdevil  OBJDIR/char_skill.o-L../../libmysql/9.x OBJDIR/char_state.o OBJDIR/PetSystem.o OBJDIR/cmd.o OBJDIR/cmd_emotion.o OBJDIR/cmd_general.o OBJDIR/cmd_gm.o OBJDIR/cmd_oxevent.o OBJDIR/config.o OBJDIR/constants.o OBJDIR/crc32.o OBJDIR/cube.o OBJDIR/db.o OBJDIR/desc.o OBJDIR/desc_client.o OBJDIR/desc_manager.o  OBJDIR/desc_p2p.o-L../../../Extern/lib  OBJDIR/dev_log.o-L../../libthecore/lib  OBJDIR/dungeon.o-L../../libpoly OBJDIR/empire_text_convert.o OBJDIR/entity.o OBJDIR/entity_view.o OBJDIR/event.o  -L../../libsqlOBJDIR/event_queue.o  -L../../libgame/libOBJDIR/exchange.o  -L../../liblua/libOBJDIR/file_loader.o  -L../../libserverkeyOBJDIR/fishing.o  -L/usr/local/libOBJDIR/gm.o  -L/usr/libOBJDIR/guild.o  -rpath /usr/local/lib32/metin2 OBJDIR/minilzo.o OBJDIR/BattleArena.o OBJDIR/FSM.o OBJDIR/MarkConvert.o OBJDIR/MarkImage.o OBJDIR/MarkManager.o OBJDIR/OXEvent.o OBJDIR/TrafficProfiler.o OBJDIR/ani.o OBJDIR/arena.o OBJDIR/banword.o OBJDIR/battle.o OBJDIR/blend_item.o OBJDIR/block_country.o OBJDIR/buffer_manager.o OBJDIR/building.o OBJDIR/castle.o OBJDIR/char.o OBJDIR/char_affect.o OBJDIR/char_battle.o OBJDIR/char_change_empire.o OBJDIR/char_horse.o OBJDIR/char_item.o OBJDIR/char_manager.o OBJDIR/char_quickslot.o OBJDIR/char_resist.o OBJDIR/char_skill.o OBJDIR/char_state.o OBJDIR/PetSystem.o OBJDIR/cmd.o OBJDIR/cmd_emotion.o OBJDIR/cmd_general.o OBJDIR/guild_manager.oOBJDIR/cmd_gm.o OBJDIR/cmd_oxevent.o  OBJDIR/guild_war.oOBJDIR/config.o  OBJDIR/horse_rider.oOBJDIR/constants.o  OBJDIR/horsename_manager.oOBJDIR/crc32.o  OBJDIR/input.oOBJDIR/cube.o  OBJDIR/input_auth.oOBJDIR/db.o  OBJDIR/input_db.oOBJDIR/desc.o  OBJDIR/input_login.oOBJDIR/desc_client.o  OBJDIR/input_main.oOBJDIR/desc_manager.o  OBJDIR/input_p2p.oOBJDIR/desc_p2p.o OBJDIR/input_teen.o OBJDIR/input_udp.o OBJDIR/ip_ban.o OBJDIR/item.o OBJDIR/item_addon.o OBJDIR/item_attribute.o OBJDIR/item_manager.o OBJDIR/item_manager_idrange.o  OBJDIR/locale.oOBJDIR/dev_log.o  OBJDIR/locale_service.oOBJDIR/dungeon.o  OBJDIR/log.oOBJDIR/empire_text_convert.o  OBJDIR/login_data.oOBJDIR/entity.o  OBJDIR/lzo_manager.oOBJDIR/entity_view.o  OBJDIR/marriage.oOBJDIR/event.o  OBJDIR/messenger_manager.oOBJDIR/event_queue.o OBJDIR/mining.o OBJDIR/mob_manager.o OBJDIR/monarch.o OBJDIR/motion.o  OBJDIR/exchange.oOBJDIR/over9refine.o  OBJDIR/file_loader.oOBJDIR/p2p.o  OBJDIR/fishing.oOBJDIR/packet_info.o  OBJDIR/gm.oOBJDIR/party.o  OBJDIR/guild.oOBJDIR/polymorph.o  OBJDIR/guild_manager.oOBJDIR/priv_manager.o  OBJDIR/guild_war.oOBJDIR/pvp.o  OBJDIR/questevent.oOBJDIR/horse_rider.o OBJDIR/unique.o  OBJDIR/horsename_manager.oOBJDIR/questlua.o  OBJDIR/input.oOBJDIR/questlua_affect.o  OBJDIR/input_auth.oOBJDIR/questlua_arena.o  OBJDIR/input_db.oOBJDIR/questlua_ba.o OBJDIR/input_login.o  OBJDIR/questlua_building.o OBJDIR/questlua_danceevent.o OBJDIR/questlua_dungeon.o OBJDIR/input_main.oOBJDIR/questlua_forked.o  OBJDIR/input_p2p.oOBJDIR/questlua_mysql.o  OBJDIR/input_teen.oOBJDIR/questlua_game.o  OBJDIR/input_udp.oOBJDIR/questlua_global.o  OBJDIR/ip_ban.oOBJDIR/questlua_guild.o  OBJDIR/item.oOBJDIR/questlua_horse.o  OBJDIR/item_addon.oOBJDIR/questlua_pet.o  OBJDIR/item_attribute.oOBJDIR/questlua_unique.o  OBJDIR/item_manager.oOBJDIR/questlua_item.o  OBJDIR/item_manager_idrange.oOBJDIR/questlua_marriage.o  OBJDIR/locale.oOBJDIR/questlua_mgmt.o  OBJDIR/locale_service.oOBJDIR/questlua_monarch.o  OBJDIR/log.oOBJDIR/questlua_npc.o  OBJDIR/login_data.oOBJDIR/questlua_oxevent.o OBJDIR/questlua_party.o OBJDIR/questlua_pc.o OBJDIR/questlua_quest.o OBJDIR/questlua_target.o OBJDIR/questlua_console.o  OBJDIR/questmanager.oOBJDIR/lzo_manager.o  OBJDIR/questnpc.oOBJDIR/marriage.o  OBJDIR/questpc.oOBJDIR/messenger_manager.o OBJDIR/refine.o OBJDIR/regen.o OBJDIR/safebox.o OBJDIR/sectree.o OBJDIR/sectree_manager.o OBJDIR/sequence.o OBJDIR/shop.o  OBJDIR/skill.o OBJDIR/mining.oOBJDIR/start_position.o  OBJDIR/mob_manager.oOBJDIR/target.o  OBJDIR/monarch.oOBJDIR/text_file_loader.o  OBJDIR/motion.oOBJDIR/trigger.o  OBJDIR/over9refine.oOBJDIR/utils.o  OBJDIR/p2p.oOBJDIR/vector.o  OBJDIR/packet_info.oOBJDIR/war_map.o  OBJDIR/party.oOBJDIR/wedding.o  OBJDIR/polymorph.oOBJDIR/weather.o  OBJDIR/priv_manager.oOBJDIR/version.o  OBJDIR/pvp.oOBJDIR/panama.o  OBJDIR/questevent.oOBJDIR/threeway_war.o  OBJDIR/unique.oOBJDIR/map_location.o  OBJDIR/questlua.oOBJDIR/BlueDragon.o  OBJDIR/questlua_affect.oOBJDIR/BlueDragon_Binder.o  OBJDIR/questlua_arena.oOBJDIR/DragonLair.o  OBJDIR/questlua_dragonlair.oOBJDIR/questlua_ba.o  OBJDIR/skill_power.oOBJDIR/questlua_building.o  OBJDIR/affect.oOBJDIR/questlua_danceevent.o  OBJDIR/auction_manager.oOBJDIR/questlua_dungeon.o  OBJDIR/FileMonitor_FreeBSD.oOBJDIR/questlua_forked.o  OBJDIR/ClientPackageCryptInfo.oOBJDIR/questlua_mysql.o  OBJDIR/buff_on_attributes.oOBJDIR/questlua_game.o  OBJDIR/dragon_soul_table.oOBJDIR/questlua_global.o  OBJDIR/DragonSoul.o OBJDIR/group_text_parse_tree.o OBJDIR/char_dragonsoul.o OBJDIR/questlua_dragonsoul.o OBJDIR/questlua_guild.oOBJDIR/shop_manager.o  OBJDIR/questlua_horse.oOBJDIR/shopEx.o  OBJDIR/item_manager_read_tables.o OBJDIR/spamblock.o OBJDIR/cipher.o OBJDIR/main.o -lm -lmd -lIL -lpng -ltiff -lmng -llcms -ljpeg -ljbig -llzma -lmysqlclient -lz -lboost_system -lcryptopp -lgtest -lthecore -lpoly -llua -llualib -lsql -lgame -lserverkey -lc++ -lm -lgcc --as-needed -lgcc_s --no-as-needed -lpthread -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib/crtend.o /usr/lib/crtn.o
OBJDIR/questlua_pet.o OBJDIR/questlua_unique.o OBJDIR/questlua_item.o OBJDIR/questlua_marriage.o OBJDIR/questlua_mgmt.o OBJDIR/questlua_monarch.o OBJDIR/questlua_npc.o OBJDIR/questlua_oxevent.o OBJDIR/questlua_party.o OBJDIR/questlua_pc.o OBJDIR/questlua_quest.o OBJDIR/questlua_target.o OBJDIR/questlua_console.o OBJDIR/questmanager.o OBJDIR/questnpc.o OBJDIR/questpc.o OBJDIR/refine.o OBJDIR/regen.o OBJDIR/safebox.o OBJDIR/sectree.o OBJDIR/sectree_manager.o OBJDIR/sequence.o OBJDIR/shop.o OBJDIR/skill.o OBJDIR/start_position.o OBJDIR/target.o OBJDIR/text_file_loader.o OBJDIR/trigger.o OBJDIR/utils.o OBJDIR/vector.o OBJDIR/war_map.o OBJDIR/wedding.o OBJDIR/weather.o OBJDIR/version.o OBJDIR/panama.o OBJDIR/threeway_war.o OBJDIR/map_location.o OBJDIR/BlueDragon.o OBJDIR/BlueDragon_Binder.o OBJDIR/DragonLair.o OBJDIR/questlua_dragonlair.o OBJDIR/skill_power.o OBJDIR/affect.o OBJDIR/auction_manager.o OBJDIR/FileMonitor_FreeBSD.o OBJDIR/ClientPackageCryptInfo.o OBJDIR/buff_on_attributes.o OBJDIR/dragon_soul_table.o OBJDIR/DragonSoul.o OBJDIR/group_text_parse_tree.o OBJDIR/char_dragonsoul.o OBJDIR/questlua_dragonsoul.o OBJDIR/shop_manager.o OBJDIR/shopEx.o OBJDIR/item_manager_read_tables.o OBJDIR/spamblock.o OBJDIR/cipher.o OBJDIR/main.o -lm -lmd -lIL -lpng -ltiff -lmng -llcms -ljpeg -ljbig -llzma -lmysqlclient -lz -lboost_system -lcryptopp -lgtest -lthecore -lpoly -llua -llualib -lsql -lgame -lserverkey -lc++ -lm -lgcc --as-needed -lgcc_s --no-as-needed -lpthread -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib/crtend.o /usr/lib/crtn.o
OBJDIR/cipher.o:(.rodata[_ZTVN8CryptoPP20AutoSeededRandomPoolE]+0x34): undefined reference to `CryptoPP::RandomPool::GenerateIntoBufferedTransformation(CryptoPP::BufferedTransformation&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long long)'
OBJDIR/cipher.o:(.rodata[_ZTVN8CryptoPP36CipherModeFinalTemplate_CipherHolderINS_16BlockCipherFinalILNS_9CipherDirE0ENS_3RC63EncEEENS_20ConcretePolicyHolderINS_5EmptyENS_22AdditiveCipherTemplateINS_20AbstractPolicyHolderINS_28AdditiveCipherAbstractPolicyENS_14CTR_ModePolicyEEEEESA_EEEE]+0x15c): undefined reference to `CryptoPP::RandomNumberGenerator::GenerateIntoBufferedTransformation(CryptoPP::BufferedTransformation&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long long)'
OBJDIR/cipher.o:(.rodata[_ZTVN8CryptoPP36CipherModeFinalTemplate_CipherHolderINS_16BlockCipherFinalILNS_9CipherDirE0ENS_4MARS3EncEEENS_20ConcretePolicyHolderINS_5EmptyENS_22AdditiveCipherTemplateINS_20AbstractPolicyHolderINS_28AdditiveCipherAbstractPolicyENS_14CTR_ModePolicyEEEEESA_EEEE]+0x15c): undefined reference to `CryptoPP::RandomNumberGenerator::GenerateIntoBufferedTransformation(CryptoPP::BufferedTransformation&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long long)'
OBJDIR/cipher.o:(.rodata[_ZTVN8CryptoPP36CipherModeFinalTemplate_CipherHolderINS_16BlockCipherFinalILNS_9CipherDirE0ENS_7Twofish3EncEEENS_20ConcretePolicyHolderINS_5EmptyENS_22AdditiveCipherTemplateINS_20AbstractPolicyHolderINS_28AdditiveCipherAbstractPolicyENS_14CTR_ModePolicyEEEEESA_EEEE]+0x15c): undefined reference to `CryptoPP::RandomNumberGenerator::GenerateIntoBufferedTransformation(CryptoPP::BufferedTransformation&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long long)'
OBJDIR/cipher.o:(.rodata[_ZTVN8CryptoPP36CipherModeFinalTemplate_CipherHolderINS_16BlockCipherFinalILNS_9CipherDirE0ENS_7Serpent3EncEEENS_20ConcretePolicyHolderINS_5EmptyENS_22AdditiveCipherTemplateINS_20AbstractPolicyHolderINS_28AdditiveCipherAbstractPolicyENS_14CTR_ModePolicyEEEEESA_EEEE]+0x15c): undefined reference to `CryptoPP::RandomNumberGenerator::GenerateIntoBufferedTransformation(CryptoPP::BufferedTransformation&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long long)'
OBJDIR/cipher.o:(.rodata[_ZTVN8CryptoPP36CipherModeFinalTemplate_CipherHolderINS_16BlockCipherFinalILNS_9CipherDirE0ENS_7CAST2564BaseEEENS_20ConcretePolicyHolderINS_5EmptyENS_22AdditiveCipherTemplateINS_20AbstractPolicyHolderINS_28AdditiveCipherAbstractPolicyENS_14CTR_ModePolicyEEEEESA_EEEE]+0x15c): undefined reference to `CryptoPP::RandomNumberGenerator::GenerateIntoBufferedTransformation(CryptoPP::BufferedTransformation&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long long)'
OBJDIR/cipher.o:(.rodata[_ZTVN8CryptoPP36CipherModeFinalTemplate_CipherHolderINS_16BlockCipherFinalILNS_9CipherDirE0ENS_4IDEA4BaseEEENS_20ConcretePolicyHolderINS_5EmptyENS_22AdditiveCipherTemplateINS_20AbstractPolicyHolderINS_28AdditiveCipherAbstractPolicyENS_14CTR_ModePolicyEEEEESA_EEEE]+0x15c): more undefined references to `CryptoPP::RandomNumberGenerator::GenerateIntoBufferedTransformation(CryptoPP::BufferedTransformation&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long long)' follow
OBJDIR/cipher.o:(.rodata[_ZTVN8CryptoPP20AutoSeededRandomPoolE]+0x34): undefined reference to `CryptoPP::RandomPool::GenerateIntoBufferedTransformation(CryptoPP::BufferedTransformation&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long long)'
OBJDIR/cipher.o:(.rodata[_ZTVN8CryptoPP36CipherModeFinalTemplate_CipherHolderINS_16BlockCipherFinalILNS_9CipherDirE0ENS_3RC63EncEEENS_20ConcretePolicyHolderINS_5EmptyENS_22AdditiveCipherTemplateINS_20AbstractPolicyHolderINS_28AdditiveCipherAbstractPolicyENS_14CTR_ModePolicyEEEEESA_EEEE]+0x15c): undefined reference to `CryptoPP::RandomNumberGenerator::GenerateIntoBufferedTransformation(CryptoPP::BufferedTransformation&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long long)'
OBJDIR/cipher.o:(.rodata[_ZTVN8CryptoPP36CipherModeFinalTemplate_CipherHolderINS_16BlockCipherFinalILNS_9CipherDirE0ENS_4MARS3EncEEENS_20ConcretePolicyHolderINS_5EmptyENS_22AdditiveCipherTemplateINS_20AbstractPolicyHolderINS_28AdditiveCipherAbstractPolicyENS_14CTR_ModePolicyEEEEESA_EEEE]+0x15c): undefined reference to `CryptoPP::RandomNumberGenerator::GenerateIntoBufferedTransformation(CryptoPP::BufferedTransformation&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long long)'
OBJDIR/cipher.o:(.rodata[_ZTVN8CryptoPP36CipherModeFinalTemplate_CipherHolderINS_16BlockCipherFinalILNS_9CipherDirE0ENS_7Twofish3EncEEENS_20ConcretePolicyHolderINS_5EmptyENS_22AdditiveCipherTemplateINS_20AbstractPolicyHolderINS_28AdditiveCipherAbstractPolicyENS_14CTR_ModePolicyEEEEESA_EEEE]+0x15c): undefined reference to `CryptoPP::RandomNumberGenerator::GenerateIntoBufferedTransformation(CryptoPP::BufferedTransformation&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long long)'
OBJDIR/cipher.o:(.rodata[_ZTVN8CryptoPP36CipherModeFinalTemplate_CipherHolderINS_16BlockCipherFinalILNS_9CipherDirE0ENS_7Serpent3EncEEENS_20ConcretePolicyHolderINS_5EmptyENS_22AdditiveCipherTemplateINS_20AbstractPolicyHolderINS_28AdditiveCipherAbstractPolicyENS_14CTR_ModePolicyEEEEESA_EEEE]+0x15c): undefined reference to `CryptoPP::RandomNumberGenerator::GenerateIntoBufferedTransformation(CryptoPP::BufferedTransformation&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long long)'
OBJDIR/cipher.o:(.rodata[_ZTVN8CryptoPP36CipherModeFinalTemplate_CipherHolderINS_16BlockCipherFinalILNS_9CipherDirE0ENS_7CAST2564BaseEEENS_20ConcretePolicyHolderINS_5EmptyENS_22AdditiveCipherTemplateINS_20AbstractPolicyHolderINS_28AdditiveCipherAbstractPolicyENS_14CTR_ModePolicyEEEEESA_EEEE]+0x15c): undefined reference to `CryptoPP::RandomNumberGenerator::GenerateIntoBufferedTransformation(CryptoPP::BufferedTransformation&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long long)'
OBJDIR/cipher.o:(.rodata[_ZTVN8CryptoPP36CipherModeFinalTemplate_CipherHolderINS_16BlockCipherFinalILNS_9CipherDirE0ENS_4IDEA4BaseEEENS_20ConcretePolicyHolderINS_5EmptyENS_22AdditiveCipherTemplateINS_20AbstractPolicyHolderINS_28AdditiveCipherAbstractPolicyENS_14CTR_ModePolicyEEEEESA_EEEE]+0x15c): more undefined references to `CryptoPP::RandomNumberGenerator::GenerateIntoBufferedTransformation(CryptoPP::BufferedTransformation&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long long)' follow

As you can see, it fails at CryptoPP::RandomNumberGenerator::GenerateIntoBufferedTransformation. I've googled it and the only thing I could notice is that the std::__1:: namespace is defined by the version of your compiler, it's when you use clang with libc++. But that's also the same thing I used for cryptopp. Even when I install cryptopp via ports or packages it won't work, I tried everything with that (of course I deleted the Extern cryptopp stuff then). As you can see -lcryptopp is within the linker flags so cryptopp will be included.

 

Maybe some of you know how to fix that.

 

Best regards,

SirBLARGH

Link to comment
Share on other sites

  • Answers 1
  • Created
  • Last Reply

Top Posters For This Question

Top Posters For This Question

1 answer to this question

Recommended Posts

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.