Jump to content

target systemc-2.3.0 to 64-bits windows platform with Visual Studio


chunrong

Recommended Posts

 

hi, 

   I tried to re-target the SystemC.lib to 64-bits windows system.

 

   What I did is,

   (1) Downloaded systemc-2.3.0 and extract it.

   (2) Opened the C++ project in systemc 2.3.0\....\msvc80\SystemC (within my Visual Studio 2005)

         (according to INSTALL: installation notes for Windows)

   (3) New x64 solution/project and copy project setting from Win32

         (according to http://msdn.microsoft.com/en-us/library/9yb4317s(VS.80).aspx).

   (4) Build the new library within the x64 projects.

 

   In this way I can actually get new SystemC.lib from msvc80\SystemC\x64\Release(or Debug).

 

   Unfortunately when I link this SystemC.lib with other 64bits binaries for a final 64bits EXE I got below error message:

 

   SystemC.lib(sc_time.obj) : fatal error LNK1112: module machine type 'x64' conflicts with target machine type 'X86'

   So I think the systemc.lib what I built is still 32bits.

 

   I checked the content of SystemC.vcproj and see it is somehow simple.

   Anyway I just want to know if others have similar experiences. Thanks.
Link to comment
Share on other sites

It seems as if the problem is with your "64-bit application", not with the SystemC library itself.  The message says, the module were of type 'x64', while your current target is 'x86'.  Please ckeck.

 

Also note that SystemC on 64-bit Windows is not really tested.  You should see an awful lot of compiler warnings and most of them are not known to be ignorable.

 

/Philipp

Link to comment
Share on other sites

 Thanks a lot. That make sense.

 I also find that my self-build 64-bits systemc.lib can work with my unit-test-64bits-systemc-project. So the previous problem should be in the details of my target project (somehow large). :-)

 

 Yes I misunderstood the error message, in my unit test to link 32 bits SystemC.lib with 64bits unit-test-project, what I get is actually another error :-)

     SystemC.lib(sc_simcontext.obj) : fatal error LNK1112: module machine type 'X86' conflicts with target machine type 'x64'.

Link to comment
Share on other sites

Yes I misunderstood the error message, in my unit test to link 32 bits SystemC.lib with 64bits unit-test-project, what I get is actually another error :-)

     SystemC.lib(sc_simcontext.obj) : fatal error LNK1112: module machine type 'X86' conflicts with target machine type 'x64'.

It's hard to say anything about this except for: Check your compiler/toolchain setup, the library directories and the build settings in general.
Link to comment
Share on other sites

 No problem.

 I know there will be errors since I manually triggered it by "link 32 bits SystemC.lib with 64bits unit-test-projec". I just want to see what is the look of the error message.

 I finally fixed my project so it now links well with the 64bits SystemC.lib. Thanks again.

Link to comment
Share on other sites

  • 8 months later...

Hello, 

 

I am facing a similar problem. This is why i don't create a new thread. i hope this is fine with you.

 

I am working on Windows 7, 64Bit operating system. I want to be able to call Matlab from my systemC TLM Model in Microsoft Visual Studio 2012. So I did the following settings:

     1.- Set Path variable in Advanced System Settings-> environment variables: C:\Program Files\MATLAB\R2010a\bin\win64 (or the path where libeng.dll is located)

     2.- In project properties of VisualStudio, link in Additional Include directories of C++->General:"C:\Program Files\MATLAB\R2010a\extern\include"

     3.- In project properties, linker->general, Additional Library Directories: "C:\Program Files\MATLAB\R2010a\extern\lib\win64\microsoft"

     4.- Add the following libraries in Linker->Additional Dependencies: libeng.lib libmx.lib

     5.- Change the Active Solution Platform to x64 (Because my Matlab intallation is x64)

Now i am getting the following error when I compile my code:

error LNK1112: module machine type 'X86' conflicts with target machine type 'x64'   Datei: \systemc.lib(sc_time.obj)
 
I was able to build and execute a simple c++ program calling MATLAB in MVS2012. 
So the problem must be coming from Systemc.
 
Any ideas on how I can fix this?
 
Thank you.
Link to comment
Share on other sites

     5.- Change the Active Solution Platform to x64 (Because my Matlab intallation is x64)

Now i am getting the following error when I compile my code:

error LNK1112: module machine type 'X86' conflicts with target machine type 'x64'   Datei: \systemc.lib(sc_time.obj)

 

In order to fix this problem, you would need to compile SystemC as a 64-bit library as well.  Unfortunately. the current SystemC proof-of-concept implementation (2.3.0) does not support 64-bit builds on MS Visual Studio.  It is possible to port SystemC to MSVC 64-bit, but this requires some effort and will likely be part of the next version of SystemC.

 

/Philipp

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...