• Advertisement
Sign in to follow this  

Unity 64-bit compiling (again)

This topic is 4184 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I was going to post a reply to my last thread, but it's been retired. I'm still having issues with 64-bit compiling, this time on a much simpler project (I gave up with x64 on my larger project). I get the exact same error message: DruinkEdit.obj : error LNK2001: unresolved external symbol __CxxFrameHandler3 I can't disable exceptions, since then I get a bunch of errors about exceptions being disabled comming from the STL. Even this simple program doesn't link:
#include <windows.h>
#include <string>

static void ErrorBox(const std::wstring& strError)
{
	MessageBox(NULL, strError.c_str(), L"Error", MB_OK | MB_ICONERROR);
}

int WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
{
	ErrorBox(L"Test");
}



With the following errors:
------ Build started: Project: bar, Configuration: Release Win32 ------
Compiling...
Main.cpp
Linking...
Main.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) protected: wchar_t const * __cdecl std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> >::_Myptr(void)const " (__imp_?_Myptr@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@IEBAPEB_WXZ)
Main.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: wchar_t const * __cdecl std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> >::c_str(void)const " (__imp_?c_str@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEBAPEB_WXZ)
Main.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __cdecl std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> >::~basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> >(void)" (__imp_??1?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAA@XZ)
Main.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __cdecl std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> >::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> >(wchar_t const *)" (__imp_??0?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAA@PEB_W@Z)
c:\foo\bar\Release\bar.exe : fatal error LNK1120: 4 unresolved externals
Build log was saved at "file://c:\foo\bar\bar\Release\BuildLog.htm"
bar - 5 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========



Anyone got any [more] ideas? EDIT: It links fine if I remove the STL stuff and don't use any exceptions. But that's not very useful...

Share this post


Link to post
Share on other sites
Advertisement
It looks to me like it simply isn't linking the libs into the rest of the code. Which seems strange if it can include standard libs. I am in no way meaning to insult you but just thought I'd try a memory test, did you check and insure the libs you're using are included in the project?

Since STL deals with templates perhaps that has something to do with it. Have you tried compiling using a library that doesn't use templates? Not that this is a long term solution but it may help isolate or define the problem.

Share this post


Link to post
Share on other sites
Yup, it's only linking in the standard libs. I tried creating an application not using the STL, and that works fine. An empty application with exceptions (try, catch, throw) in it also won't link.

Share this post


Link to post
Share on other sites
That won't affect anything, it's a link problem rather than a compile problem.

Tried it, no difference.

Share this post


Link to post
Share on other sites
Quote:
Original post by Evil Steve
That won't affect anything, it's a link problem rather than a compile problem.

Tried it, no difference.


Stupid question, but are you including the x64 versions of the standard libs? I'm new to the x64 platform myself, however I do know that a x64 application cannot link to an x86 dll (and vice versa). If I understand it correctly, it is because the 32 bit applications must be executed by the WOW64 service. In order to provide linking between the two, it would be quite a costly operation. I would imagine that an x64 app could not link to previously compiled x86 lib's because of the differences in code generation between the two. Not sure if this helps, you may even have looked into this already.

Share this post


Link to post
Share on other sites
can you please post you complete compilation and ofcourse linking line(s) ...

may be he links to the rwong libraries?
im just guessing that the standard setup links to the 32bit version and thus its crashing.

(and yes i have no visual studio 2005 avail, to try it myself)

did you set up the correct library and include directories in your settings ? ( i remember, that there are some subdirectorys with "x64" in it.)


... why is there a penguin at the title (without this penguin i probably would have never whatched this one :lol:)

Share this post


Link to post
Share on other sites
All the compiler directories are set to the /win64/amd64 folders where possible (E.g. E:\Microsoft Platform SDK\Bin\win64\AMD64).

My compiler line is:
/Od /I "E:\Source Control\DruinkClient\/" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_CRT_SECURE_NO_DEPRECATE" /D "_CRT_NON_CONFORMING_SWPRINTFS" /D "_UNICODE" /D "UNICODE" /FD /EHsc /MDd /GS- /GR- /Fo"Debug x64\\" /Fd"Debug x64\vc80.pdb" /W4 /WX /nologo /c /Wp64 /Zi /TP /errorReport:prompt

And my linker line is:
/OUT:"E:\Source Control\DruinkClient\Debug x64\DruinkClient.exe" /INCREMENTAL /NOLOGO /MANIFEST /MANIFESTFILE:"Debug x64\DruinkClient.exe.intermediate.manifest" /DEBUG /PDB:"e:\Source Control\DruinkClient\Debug x64\DruinkClient.pdb" /SUBSYSTEM:WINDOWS /MACHINE:X64 /ERRORREPORT:PROMPT kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib

I'm using VC2005 Professional if it makes a difference (Which does support x64).

Share this post


Link to post
Share on other sites
well i dont understand much of this, but i doubt that this is everything ...
e.g. where is the linking of this crt stuff?

can you enable verbose output or sth like that?
or what does you build log say? (post it)

and did you try it without unicode? (at least i think that this "w"-stuff is unicode)


e.g. my gcc (amd64 ubuntu) says:
--------------------------------

#include <string>

int main( int argc, char **argv ) {

std::string s("asdf");

return 0;
}


---------------------------------------------
--------Compile------------------------------
---------------------------------------------
$ g++ -v -c test.cpp

Ziel: x86_64-linux-gnu
Konfiguriert mit: ../src/configure -v --enable-languages=c,c++,java,f95,objc,ada,treelang --prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --program-suffix=-4.0 --enable-__cxa_atexit --enable-clocale=gnu --enable-libstdcxx-debug --enable-java-awt=gtk-default --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.4.2-gcj-4.0-1.4.2.0/jre --enable-mpfr --disable-werror --enable-checking=release x86_64-linux-gnu
Thread-Modell: posix
gcc-Version 4.0.3 (Ubuntu 4.0.3-1ubuntu5)
/usr/lib/gcc/x86_64-linux-gnu/4.0.3/cc1plus -quiet -v -D_GNU_SOURCE test.cpp -quiet -dumpbase test.cpp -mtune=k8 -auxbase test -version -o /tmp/ccPTwlkQ.s
nicht vorhandenes Verzeichnis »/usr/local/include/x86_64-linux-gnu« wird ignoriert
nicht vorhandenes Verzeichnis »/usr/include/x86_64-linux-gnu« wird ignoriert
#include "..." - Suche beginnt hier:
#include <...> - Suche beginnt hier:
/usr/lib/gcc/x86_64-linux-gnu/4.0.3/../../../../include/c++/4.0.3
/usr/lib/gcc/x86_64-linux-gnu/4.0.3/../../../../include/c++/4.0.3/x86_64-linux-gnu
/usr/lib/gcc/x86_64-linux-gnu/4.0.3/../../../../include/c++/4.0.3/backward
/usr/local/include
/usr/lib/gcc/x86_64-linux-gnu/4.0.3/include
/usr/include
Ende der Suchliste.
GNU C++ version 4.0.3 (Ubuntu 4.0.3-1ubuntu5) (x86_64-linux-gnu)
compiled by GNU C version 4.0.3 (Ubuntu 4.0.3-1ubuntu5).
GGC-Heuristik: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
as -V -Qy --64 -o test.o /tmp/ccPTwlkQ.s
GNU assembler version 2.16.91 (x86_64-linux-gnu) using BFD version 2.16.91 20060118 Debian GNU/Linux


---------------------------------------------
--------Link---------------------------------
---------------------------------------------
$ g++ -v -o test test.o

Ziel: x86_64-linux-gnu
Konfiguriert mit: ../src/configure -v --enable-languages=c,c++,java,f95,objc,ada,treelang --prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --program-suffix=-4.0 --enable-__cxa_atexit --enable-clocale=gnu --enable-libstdcxx-debug --enable-java-awt=gtk-default --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.4.2-gcj-4.0-1.4.2.0/jre --enable-mpfr --disable-werror --enable-checking=release x86_64-linux-gnu
Thread-Modell: posix
gcc-Version 4.0.3 (Ubuntu 4.0.3-1ubuntu5)
/usr/lib/gcc/x86_64-linux-gnu/4.0.3/collect2 --eh-frame-hdr -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 -o test /usr/lib/gcc/x86_64-linux-gnu/4.0.3/../../../../lib64/crt1.o /usr/lib/gcc/x86_64-linux-gnu/4.0.3/../../../../lib64/crti.o /usr/lib/gcc/x86_64-linux-gnu/4.0.3/crtbegin.o -L/usr/lib/gcc/x86_64-linux-gnu/4.0.3 -L/usr/lib/gcc/x86_64-linux-gnu/4.0.3 -L/usr/lib/gcc/x86_64-linux-gnu/4.0.3/../../../../lib64 -L/usr/lib/gcc/x86_64-linux-gnu/4.0.3/../../.. -L/lib/../lib64 -L/usr/lib/../lib64 test.o -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/lib/gcc/x86_64-linux-gnu/4.0.3/crtend.o /usr/lib/gcc/x86_64-linux-gnu/4.0.3/../../../../lib64/crtn.o

Share this post


Link to post
Share on other sites
Quote:
Original post by Billr17
Is the project set as Win32? If so, have you tried setting it as x64 in the configuration manager?

Look around page 5 for the correct VS 2005 settings:
This may be useful to you
Ah ha! I didn't think of configuration from Win32, it seems to be working great now, thanks [smile]

Share this post


Link to post
Share on other sites
64-bit compiling is compiling applications for 64-bit operating systems like Windows XP x64. x64 refers to 64-bit CPUs and OSs, x86 refers to the 32-bit 386, 486, 586, etc family of CPUs.

Share this post


Link to post
Share on other sites
Quote:
Original post by Evil Steve
64-bit compiling is compiling applications for 64-bit operating systems like Windows XP x64. x64 refers to 64-bit CPUs and OSs, x86 refers to the 32-bit 386, 486, 586, etc family of CPUs.


To be correct, x86 refers to the "86" line of intel products (+ clones and derivative products, such as the 8088). The list includes:

* 8086, 8088 (first generation, 16 bit processor)
* 80186, 80188 (never really hit the shelves)
* 80286
* 80386 (first 32 bit CPU in this line)
* 80486
* Pentium (80586)
* Pentium II (80686)
* Pentium III
* Pentium IV
* AMD processors (Duron, Athlon, ...)

Current dual core processors and 64 bits processors are also part of this product line.

Regards,

Share this post


Link to post
Share on other sites
It's a reference to the native word size of the platform. IA64 and IA32 have very different register mappings. In fact, IA32 technically has provision for registers of many sizes which are not 32 bits (floating point registers, in particular, as well as stuff for SIMD instruction sets).

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
  • Advertisement
  • Popular Tags

  • Advertisement
  • Popular Now

  • Similar Content

    • By Manuel Berger
      Hello fellow devs!
      Once again I started working on an 2D adventure game and right now I'm doing the character-movement/animation. I'm not a big math guy and I was happy about my solution, but soon I realized that it's flawed.
      My player has 5 walking-animations, mirrored for the left side: up, upright, right, downright, down. With the atan2 function I get the angle between player and destination. To get an index from 0 to 4, I divide PI by 5 and see how many times it goes into the player-destination angle.

      In Pseudo-Code:
      angle = atan2(destination.x - player.x, destination.y - player.y) //swapped y and x to get mirrored angle around the y axis
      index = (int) (angle / (PI / 5));
      PlayAnimation(index); //0 = up, 1 = up_right, 2 = right, 3 = down_right, 4 = down

      Besides the fact that when angle is equal to PI it produces an index of 5, this works like a charm. Or at least I thought so at first. When I tested it, I realized that the up and down animation is playing more often than the others, which is pretty logical, since they have double the angle.

      What I'm trying to achieve is something like this, but with equal angles, so that up and down has the same range as all other directions.

      I can't get my head around it. Any suggestions? Is the whole approach doomed?

      Thank you in advance for any input!
       
    • By devbyskc
      Hi Everyone,
      Like most here, I'm a newbie but have been dabbling with game development for a few years. I am currently working full-time overseas and learning the craft in my spare time. It's been a long but highly rewarding adventure. Much of my time has been spent working through tutorials. In all of them, as well as my own attempts at development, I used the audio files supplied by the tutorial author, or obtained from one of the numerous sites online. I am working solo, and will be for a while, so I don't want to get too wrapped up with any one skill set. Regarding audio, the files I've found and used are good for what I was doing at the time. However I would now like to try my hand at customizing the audio more. My game engine of choice is Unity and it has an audio mixer built in that I have experimented with following their tutorials. I have obtained a great book called Game Audio Development with Unity 5.x that I am working through. Half way through the book it introduces using FMOD to supplement the Unity Audio Mixer. Later in the book, the author introduces Reaper (a very popular DAW) as an external program to compose and mix music to be integrated with Unity. I did some research on DAWs and quickly became overwhelmed. Much of what I found was geared toward professional sound engineers and sound designers. I am in no way trying or even thinking about getting to that level. All I want to be able to do is take a music file, and tweak it some to get the sound I want for my game. I've played with Audacity as well, but it didn't seem to fit the bill. So that is why I am looking at a better quality DAW. Since being solo, I am also under a budget contraint. So of all the DAW software out there, I am considering Reaper or Presonus Studio One due to their pricing. My question is, is investing the time to learn about using a DAW to tweak a sound file worth it? Are there any solo developers currently using a DAW as part of their overall workflow? If so, which one? I've also come across Fabric which is a Unity plug-in that enhances the built-in audio mixer. Would that be a better alternative?
      I know this is long, and maybe I haven't communicated well in trying to be brief. But any advice from the gurus/vets would be greatly appreciated. I've leaned so much and had a lot of fun in the process. BTW, I am also a senior citizen (I cut my programming teeth back using punch cards and Structured Basic when it first came out). If anyone needs more clarification of what I am trying to accomplish please let me know.  Thanks in advance for any assistance/advice.
    • By Yosef BenSadon
      Hi , I was considering this start up http://adshir.com/, for investment and i would like a little bit of feedback on what the developers community think about the technology.
      So far what they have is a demo that runs in real time on a Tablet at over 60FPS, it runs locally on the  integrated GPU of the i7 . They have a 20 000 triangles  dinosaur that looks impressive,  better than anything i saw on a mobile device, with reflections and shadows looking very close to what they would look in the real world. They achieved this thanks to a  new algorithm of a rendering technique called Path tracing/Ray tracing, that  is very demanding and so far it is done mostly for static images.
      From what i checked around there is no real option for real time ray tracing (60 FPS on consumer devices). There was imagination technologies that were supposed to release a chip that supports real time ray tracing, but i did not found they had a product in the market or even if the technology is finished as their last demo  i found was with a PC.  The other one is OTOY with their brigade engine that is still not released and if i understand well is more a cloud solution than in hardware solution .
      Would there  be a sizable  interest in the developers community in having such a product as a plug-in for existing game engines?  How important  is Ray tracing to the  future of high end real time graphics?
    • By bryandalo
      Good day,

      I just wanted to share our casual game that is available for android.

      Description: Fight your way from the ravenous plant monster for survival through flips. The rules are simple, drag and release your phone screen. Improve your skills and show it to your friends with the games quirky ranks. Select an array of characters using the orb you acquire throughout the game.

      Download: https://play.google.com/store/apps/details?id=com.HellmodeGames.FlipEscape&hl=en
       
      Trailer: 
       
    • By khawk
      Watch the latest from Unity.
       
  • Advertisement