Go Back   ZeroC Forums > Help Center

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
  #1 (permalink)  
Old 05-18-2006
albertods albertods is offline
Registered User
 
Name: Alberto Della Santina
Organization: University of Pisa - department of IT Engineering
Project: Mobile remote controller
 
Join Date: Feb 2006
Location: Pisa (Italy)
Posts: 58
Ice 3.0.1 & Visual Studio 2005 (Express edition)

Hello,
I tried to move my development from linux to windows in order to work with another C++ IDE than suits better my needs than KDevelop (except Eclipse), and I'm using the new Visual Studio 2005 express edition, that is free of charge.

With the package downladable from the ZeroC website, with all the PATH set properly and with the right directories set in the properties of VS, I'm able to compile without errors all the demos included in the package.
The problem comes when I want to create a new project for example called ChatClient, which has the same sources as ChatC just to learn the usage of VS with Ice. Consider that the "Custom build step" for the file .ice is correctly set.

In the linking phase I get this kind of error (several times):
Client.obj : error LNK2005: "void __cdecl IceInternal::incRef(class Demo::ChatCallback *)" (?incRef@IceInternal@@YAXPAVChatCallback@Demo@@@Z) already defined in Chat.obj

...and these errors (again...several times):
Chat.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall IceProxy::Glacier2::Session::Session(void)" (__imp_??0Session@Glacier2@IceProxy@@QAE@XZ) referenced in function "public: __thiscall IceProxy::Demo::ChatSession::ChatSession(void)" (??0ChatSession@Demo@IceProxy@@QAE@XZ)
Client.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall IceProxy::Glacier2::Session::Session(void)" (__imp_??0Session@Glacier2@IceProxy@@QAE@XZ)


What are the causes of these errors?
I have followed the instructions presented in this post:
Compiling slice2cpp-generated-code on Win. XP Pro


Thank you in advance


With my very best regards



Alberto
__________________
Alberto Della Santina
IT Engineering Department
University of Pisa (Italy)
www.ing.unipi.it
www.iet.unipi.it
Reply With Quote
  #2 (permalink)  
Old 05-18-2006
bernard's Avatar
bernard bernard is offline
ZeroC Staff
 
Name: Bernard Normier
Organization: ZeroC, Inc.
Project: Ice
 
Join Date: Feb 2003
Location: Palm Beach Gardens, FL
Posts: 816
Hi Alberto,

This looks like a project properties problem; you should double-check in particular Configuration Properties/C/C++/Code Generation/Runtime Library. It should be Multi-threaded Debug (if you link with Iced.lib) or Multi-threaded Release (if you link with Ice.lib).

If you can't figure it out, please attach your project file (.vcproj).

For the unresolved Glacier2 symbols, you need to link with Glacier2, i.e. add glacier2.lib to your list of libraries.

Cheers,
Bernard
__________________
Bernard Normier
ZeroC, Inc.

Last edited by bernard : 05-18-2006 at 01:41 PM.
Reply With Quote
  #3 (permalink)  
Old 05-18-2006
albertods albertods is offline
Registered User
 
Name: Alberto Della Santina
Organization: University of Pisa - department of IT Engineering
Project: Mobile remote controller
 
Join Date: Feb 2006
Location: Pisa (Italy)
Posts: 58
Hi Bernard,
thank you very much for your quick reply to my post.

Unfortunately the MultiThreaded Debug is properly set, using the Iced.lib IceUtild.lib libraries, I can't figure out where is the problem.

You will find attached the project file (compressed).

Where sould I specify the link to the glacier2.lib?


Thank you


Cheers


Alberto
Attached Files
File Type: zip ChatClient_Project.zip (1.5 KB, 12 views)
__________________
Alberto Della Santina
IT Engineering Department
University of Pisa (Italy)
www.ing.unipi.it
www.iet.unipi.it
Reply With Quote
  #4 (permalink)  
Old 05-18-2006
bernard's Avatar
bernard bernard is offline
ZeroC Staff
 
Name: Bernard Normier
Organization: ZeroC, Inc.
Project: Ice
 
Join Date: Feb 2003
Location: Palm Beach Gardens, FL
Posts: 816
Hi Alberto,

Please try to set
Configuration Properties/C/C++/Language/Enable Run-Time Type Info to Yes

'Yes' should be the default, but I don't see anything else suspicious in your project file. Don't forget to rebuild your application afterwards.

You also need to add 'glacier2d.lib' [debug] or 'glacier2.lib' [release] to
Configuration Properties/Linker/Input/Additional dependencies.

Cheers,
Bernard
__________________
Bernard Normier
ZeroC, Inc.
Reply With Quote
  #5 (permalink)  
Old 05-19-2006
bernard's Avatar
bernard bernard is offline
ZeroC Staff
 
Name: Bernard Normier
Organization: ZeroC, Inc.
Project: Ice
 
Join Date: Feb 2003
Location: Palm Beach Gardens, FL
Posts: 816
Could you post Client.cpp?

Thanks,
Bernard
__________________
Bernard Normier
ZeroC, Inc.
Reply With Quote
  #6 (permalink)  
Old 05-19-2006
albertods albertods is offline
Registered User
 
Name: Alberto Della Santina
Organization: University of Pisa - department of IT Engineering
Project: Mobile remote controller
 
Join Date: Feb 2006
Location: Pisa (Italy)
Posts: 58
Dear Bernard,
sorry for the inconvenience!

I've resolved everything! It was just a mispelling...

Thanks a lot for your help!

Do I have to include only the needed libraries for the project? For example: this one needs: Iced.lib IceUtild.lib glacier2d.lib
In the case I would include all of them for a "simple" project like this, will I experience a big loss of performance?
I'm asking this just not to remember to take care also of the properties of the project when I will write some more complicate source codes.



Thanks again


Sincerely


Alberto


With my very best regards
__________________
Alberto Della Santina
IT Engineering Department
University of Pisa (Italy)
www.ing.unipi.it
www.iet.unipi.it
Reply With Quote
  #7 (permalink)  
Old 05-19-2006
bernard's Avatar
bernard bernard is offline
ZeroC Staff
 
Name: Bernard Normier
Organization: ZeroC, Inc.
Project: Ice
 
Join Date: Feb 2003
Location: Palm Beach Gardens, FL
Posts: 816
Hi Alberto,

Glad to hear you figured it out!

You can list as many libraries as you like: Visual C++ will only use the ones it needs: there is no downside. However this is not true on all platforms; for example on Linux and Solaris, you'd better link with only the libraries you need.

Cheers,
Bernard
__________________
Bernard Normier
ZeroC, Inc.
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem building IceSSL for CS with Visual Studio 2005 Vivien Delage Help Center 4 11-28-2006 09:55 AM
Visual Studio 2005 C# ICE Issues jborg Bug Reports 3 12-23-2005 06:42 PM
IceE1.0.0 on Visual C++ 2005 hgp Help Center 3 12-02-2005 12:14 PM
C# samples all throw exceptions on VS.Net 2005 express Leaf Help Center 2 10-09-2004 10:18 PM
Visual studio net xdm Help Center 1 02-06-2004 10:56 PM


All times are GMT -4. The time now is 09:57 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0
(c) 2008 ZeroC, Inc.