![]() |
|
#1
|
|||
|
|||
linking libraries removes variableshello,
In my project, some variables global variables are placed in a library. These variables are used in a class that also has a global instance in that library. The contructor of that class places pointers to the data in a list that is defined elsewhere. The data is never looked at directly, but through that list. It seems that the linker is getting rid of all data used in this manner, so the data is not available. When I put all data and the instance of the class in the min cpp file, the linker puts it in the executable. I'm using the gcc compiler. Any attributes, linker options, ... available to force the system to keep the data in the executable?? Thanks, Stefaan |
|
#2
|
|||
|
|||
Re: linking libraries removes variablesSome progress.
It seems that the file as a whole entity is removed. As soon as I force the linker to use a small part of the file, the rest of tha data is also available. I've put another global variable in the source file (int dummy The problem is that I will have a lot of such issues, and I can not use a dummy variable in the main project file for every library I use. Any idea's? Stefaan |
Recent GIDBlog
Welcome to Baghdad by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| passing variables out of an iframe by url | JUNK KED | MySQL / PHP Forum | 5 | 31-Jul-2007 09:33 |
| Bloodshed Dev C++ Project Options | JdS | C++ Forum | 6 | 11-Nov-2005 17:23 |
| The Use of GLobal variables | Peter11111 | C Programming Language | 3 | 12-Aug-2005 08:08 |
| variables return to previous value after i try to set them | nasaiya | MS Visual C++ / MFC Forum | 2 | 14-Jun-2005 00:43 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The